Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Baguettator

#341
Advanced Technical Forum / Re: Game's Size
Thu 06/08/2020 18:44:38
And if I authorize the game to compress the sprite files in the General Settings, will the quality be a lot less in quality ? Or is it not so a huge difference that it is worthy to chose that ?
#342
Advanced Technical Forum / Re: Game's Size
Thu 06/08/2020 17:58:28
Whaoo, so I am far far far to reach the limit !!!!!!!!!!!!!!!!!!!! :D

Many thanks for all these precisions, I will try to decrease the game's size in any case, but I am so happy now that I know the limit is just huuuuuuge :D
#343
Advanced Technical Forum / Re: Game's Size
Thu 06/08/2020 16:44:29
OK, so sorry for my misunderstanding, but if I understand well, the previous limit was 2GB and know it is about 18 000 000 GB ???  :confused:
#344
Advanced Technical Forum / Re: Game's Size
Thu 06/08/2020 14:53:11
Quote64-bit file size, which is something like 18 446 744 073 709 551 616 bytes, should be enough for a while :P.

When you say that number of bytes, you mean how much octets ? more than 10Go ?
#345
Advanced Technical Forum / Re: Game's Size
Thu 06/08/2020 13:52:53
QuoteBut you do not have to use labels if they do not look good, in this case you could try having one background sprite and smaller sprites with text on them, for example.

You mean that it is best to have one sprite for the background and 100 sprites with only the texts (and transparent background for the text) that are placed on the background sprite than having 100 sprites with the same background and their own text together ?

QuoteBefore AGS 3.5.0 the limit of ascprset.spr is roughly 2 GB. Since AGS 3.5.0 you can have much more.

So, what's the limit for AGS 3.5.0 ? I use this version of AGS, so I'm happy that it could manage a lot more files with larger size :D

QuoteThat was a workaround that could solve the issue of sprite file being too big before AGS 3.5.0.
Also, this may be used as a way to provide downloadable update :).
But in general, extra files on disk are also part of game files, so total size is still the same, is not it?

Well I thought that by using large sprites (especially those that are 1920*1080) in an extra folder, that is not compiled in the game, it could help to have a game more stable, but maybe I was wrong. Maybe it has to be used only if I get over the limit of number of sprites ! :)

#346
Advanced Technical Forum / Re: Game's Size
Thu 06/08/2020 12:18:35
Sorry, I didn't notice your answer :)

My game resolution is 1920*1080, and actually I use almost 2200 sprites. Some are very small, but some (maybe 100 of them) are 1920*1080.

I think I could reduce drastically the number of sprites by replacing some sprites with Label GUI (in fact, lots of my sprites are with a common background, but a different text on it). I think I can get 400-500 sprites less by using GUI Labels, but it will be less practical to use Labels GUI for the Text (and maybe less pretty :) )

However, my game's size is 2Gb, and I think it could be decreased a lot. And I'm afraid of something : maybe my Game's Size is huge because of the resolution. But if I change Resolution of the game, I will be obliged to rework on each sprite and give it the right size according the new resolution ?

And because my game isn't finished, will I get a limit if I use too much sprites or if the game's size is too much ?

Actually, ascprset.spr is 1 998 350 Ko . :S

EDIT : also I was thinking about : I have readen something that the game can use files on the computer that have not been compiled. Maybe I didn't well understand, but... could be a solution to use large sprites outside the compiled game to reduce his size ?
#347
In fact, every background has not the nine buttons type. Maybe for one background, there will be 3 buttons type "garage", 2 buttons type "salon", 3 buttons type "chambre", but for another background, it will be 1 button type "cuisine", 2 buttons type "salon" and that's all...

9 is the maximum buttons a  background can have. But it is possible that there will be several buttons of a type, none of another type etc...

That's why I wanted to use pointers to say : "now this button is a garage, this button is also a garage, but this one is a cuisine, and the others are not use so no pointer needed for those now."

#348
OK, I didn't know that I can use the parameters of the function On click ! Thanks for the information :)

What I want to do is that my character arrive in a room (1 for example), and in this room a map is randomly chosen. To show the map (understand the background image of the room that shows a building's interior), I use a Dynamic Sprite that draws the chosen sprite on the background of the room (that works perfectly, no problem for that).

Depending which map is chosen, I have to place up to 9 buttons of a transparent GUI (only the small buttons are important), and when the player click on a button it happens an event randomly chosen depending which "type" of button has been clicked.

In my first "design", I made 9 buttons of each type (garage, salon, chambre...) to represent all the possibilities, and if the 1st button to place was a type "garage", I get garage1.Visible=true. If it was a "salon", salon1.Visible=true. For the second button, if it was a chambre, chambre2.Visible=true. etc... up to the 9th.

So what I want to do is to reduce the number of buttons and mechanicly reduce the script by simplifying : instead of 9 buttons for each type (at the moment it is a total of 81 buttons for me !!!), just have 9 buttons "generic", and instead of "when you click garage1 or other button named garage, it calls the function Garage()", replace by something like "when you click on button1, if the pointer that point to button1 is garage[1], call the function Garage()"

I hope I am clearer now, but it is not easy to explain that kind of thing I think :S (or my english is so bad that... umpf :) )
#349
Hello again !

I encounter a new problem. I'm trying to simplify my code now that I have learnt a lot since I started AGS a few month ago.

I tried to create a specific function with parameters to simplify the code (and hugely decrease the size of the script !!!). But I encounter problems while using pointers in parameters.

I created Button pointers in my script :

Code: ags
Button *garage[10];
Button *salon[10];


And I want to do something like :

Code: ags
function Objectifs(int obj, Button *type)
{
  int control;
  if (obj==1) control=32;
  if (obj==2) control=45;
  type[obj]=gAffichageexpedition.Controls[control].Asbutton;
}


And I think that when I click the button, it could be like this :

Code: ags
function Button1_Onclick
{
  if (garage[1]==this) Garage(1, 25); // assuming there is a function "Garage" that does something in the case this button is a "garage"
  if (salon[1]==this) Salon(1, 56); // the same if this button is a "salon"
}


Is my code correct ? I don't manage to get it working, so probably I made a mistake or don't understand how it works...
#350
Awesome, I tried what Crimson Wizard explains and it works so well !

Effectively, no use of Global variables. Laura Hunts learns something too :)

Thanks to both of you !
#351
Hi !

I am trying to do something that I can't manage to do, about Audiochannel that I have never used before, and certainly I don't understand well how it works.

My situation is that when I enter the room 1, a song starts playing. Like :

Code: ags
// this code is in room1 script
room before fadein
{
aValses.Play();
}


I have a hotspot that can make the player character to go to room 2. Okay, it works. The aValses is still playing because I didn't write anything to stop it, and that's wonderful.

In the room 2 I have a hotspot that makes the player character to go to room 1. And when I come back in room 1, the aValses is stopping and then restarting from the beginning, so we hear an interruption when the room changes, and the music restarts from the beginning.

What I want is that when I enter the room 1 (from other rooms but NOT from room 2), the music "Valses" starts to play, but if I change from room 2 to room 1, I want the music to continue and NOT to restart. I hope I'm clear, because, I'm not english :S

By reading the manual, I tried some things using Audiochannel *valse.IsPlaying, I correctly used the syntax but it didn't manage to do what I want in the game. I am almost sure that it is something like that, but I don't know how to do it correctly. And maybe it is another thing...

Does someone know how to script that situation correctly ?

Many thanks ! :D
#352
Advanced Technical Forum / Re: Game's Size
Sun 05/07/2020 16:19:52
Thanks for the answer ! I understood that Game's size is most linked to the number of sprites the game use, so maybe I'm going to check if I can reduce the number of sprites, in fact I think it can bo done with a bit of work :)
#353
Advanced Technical Forum / Game's Size
Tue 30/06/2020 10:47:12
I created this topic because it was starting in another topic, but it is clearier (and more interessant, I think) (and more fair, I believe !) to put it in a specific topic, maybe it could help someone else :)

I was asking about what can we do to decrease Game's Size. There were the first answers :

Snarky said :

Inefficient scripting makes no significant difference to game size (it could potentially cause it to run slower), but reducing GUIs and buttonsâ€"as long as you also delete the associated spritesâ€"might.

The game size is almost entirely made up of graphics (sprites and room backgrounds) and audio. Importing the same graphics multiple times, or being inefficient when you have small variations (huge sprites that are nearly exactly the same except for a small difference, instead of just having the static part as one sprite and the bit that varies separately) tends to bloat the game size. Also avoid excessive frame-by-frame animations, which should instead be done as videos. If an animation is more than say 100 frames (of individual sprites), you may want to rethink. Many things can be done in-engine instead of being pre-rendered as separate sprites. Similarly, many, large room backgrounds take up a lot of space, and there are ways to store them more efficiently (typically using tile-based drawing or other standard elements that you can reuse in order to create different rooms from the same small set of graphics).

For audio, it's mostly about using efficient sound compression, e.g. OGG format (and of course not importing the same sound multiple times, or sound you're not using).

Edit: That's not to say that you shouldn't simplify and clean up your code. Bad code is difficult and tedious to work with, and can drain your energy for working on the game. If you've learned a significantly better way to do it, it's often worth going back and fixing it. (Though at the same time, if it works, you shouldn't put so much work into polishing it that you don't make any other progress.)

Crimson Wizard said :

Right, this is the first reason to simplify the code :) Improving game's perfomance is a reason to optimise it, but that's kind of a different thing (and sometimes you have to write more complex code when doing that).

I said : (my last answer with some questions)

OK, thanks a lot for your replies about decreasing the Game's Size. Effectively I could  decrease that by separating existing sprites in several sprites (one for the part that doesn't change, for example the "background" of a button, and other sprites for the part that changes, for example the "text" of the button.). Maybe also by using "labels" for some texts, but labels are less "flexible" for text alignment, so I have to test before.

About audio's format (OGG you said), I will take a look at that. It won't be difficult to change that quickly since I use a very few audios in my game, and it is still not ready to play.

What's about image's format ? I'm using basically PNG and BMP, but I didn't think a lot about that, and I am not an expert about compressing the image, or choose the right format...
#354
OK, thanks a lot for your replies about decreasing the Game's Size. Effectively I could  decrease that by separating existing sprites in several sprites (one for the part that doesn't change, for example the "background" of a button, and other sprites for the part that changes, for example the "text" of the button.). Maybe also by using "labels" for some texts, but labels are less "flexible" for text alignment, so I have to test before.

About audio's format (OGG you said), I will take a look at that. It won't be difficult to change that quickly since I use a very few audios in my game, and it is still not ready to play.

What's about image's format ? I'm using basically PNG and BMP, but I didn't think a lot about that, and I am not an expert about compressing the image, or choose the right format...
#355
Many thanks Khris and Crimson Wizard for the help to "simplify" the code !

About that, I was asking myself : is bad scripting a reason that the game could be "heavier" than it could be ?

By "heavier", I mean it can be 1,5 Go for the whole built game whereas it could be only 1 Go if the code has been simplified (less lines, so liter ?), and if the number of GUIS or buttons has been reduced to the strict needed.

In fact, as I started scripting with AGS a month ago, from the beginning (no experience in that at all), I realize that I have already scripted a lot of things that I could simplify a LOT, and maybe it could make the game a bit liter than it is actually.

For example : in many situations, I made several GUIS that have the same "design", exactly the same, only the "text" of the button is different and of course the script of each button is different, but very short and not so much different. I think it could be easily simplified to one GUI with the "design" needed, and the NormalGraphic of the button can change when the GUI is called, according to the situation. Then, the script can easily be reduced to the "generic buttons" script, with conditions "if/else".

Other example : A GUI with a LOOOOOT of buttons, because I need 50 buttons (1 for each character), and when I click one of them, the button disappear and a new one (at the same position) appears, with the only difference of a green cross on the character to show if it has been selected. It results in 100 buttons, while I think I can reduce that to 50, and only change the NormalGraphic when it is clicked. For the script, with "bool" and "int", I can easily reduce a "two buttons script" in "one button script" with conditions.

So, by reducing the script height and the number of GUIS and Buttons, I think it could decrease the Game Size. What do you think about that ? :)
#356
OOOOOOOOOOOOOOOOOOOOOOOOOOWWWWWWWW....

I'M SOOOOOOOOO SOOOOOOOOOORRRRRRYYYYYYYYYYY...

I realized my mistake...

Everything is working ! I just forgot something, it is a bit long to explain, but it is like "I want Pionzombie1 visible if zombies1<3, so I write zombies1=Random(11), and if the luck is with me, Pionzombie1 will be Visible, and by clicking a button I will set it Invisible or Visible again. The problem was that if zombies1 > 3, it is ALSO < 12 (because : RANDOM(11) !!!), so if I want that only the Pionzombie that have been "chosen" (with their attached variables < 3 when they are set to Random(11) ), I have to do something like that :
Code: ags
zombies1=Random(11);
zombies2=Random(11);
zombies3=Random(11);
zombies4=Random(11);
zombies5=Random(11);
zombies6=Random(11);
zombies7=Random(11);
zombies8=Random(11);
zombies9=Random(11);
zombies10=Random(11);

if (zombies1 < 3)
{
  Pionzombie1.SetPosition(346, 336);
  Pionzombie1.Visible=true;
}
else zombies1=15; // the LINE of the HELL
if (zombies2 < 3)
{
  Pionzombie2.SetPosition(464, 336);
  Pionzombie2.Visible=true;
}
else zombies2=15; // again the LINE of the HELL
// etc until zombies10 and Pionzombie10...


So, to conclude : scripting is a good work to loose weight, because by get fire in your head, you loose a LOT of calories :)

Many thanks to those that tried to help me ! AGS has no problem, the men and women that worked on that are genious :D

And "Spaciba Balchoï" :p
#357
Another detail : I'm using AGS 3.50. Source of the problem ?
#358
If by "defined" you mean that I wrote :
Code: ags
int zombies1=0


So my answer is : NO, in the room before fade in, I didn't wrote that. Just :

Code: ags
zombies1=15
//a lot of script that doesn't link with the problem

zombies1=Random(11);


I really don't know what happens. I tried with something like :
Code: ags
if (zombies1 > 30) Pionzombie1.Visible = !Pionzombie1.Visible;


And, hurra, nothing happens. I check the values, they are all under 30 (15 or Random(11) ).

But with the good code, I check the values before, it shows the right values, but each button is affected like each variable was < 12...

I check in the Global Variable Panel for "find all usages" of the variables, no problem from that side.

I really don't understand what is happenning... It's a good thing that Khris managed to get it working, that shows that AGS engine has no problem. But I have a problem (certainly my head's engine ^^ )
#359
No, they are not reset to 0 elsewhere because I made a "Display" that show their values when I press a key, and it shows me that they have the value that I intended.

The GUI with the button that make the "Pionzombie" Visible or Invisible is scripted in Global Script, as far I know, it is an obligation, I can't put a function "Button_OnClick" elsewhere. Maybe I'm wrong ?

All the codes are given in my first post. The GUI is set to Visible in the Room_before fade in. The button's script is in my first post, in the Global Script. These variables are NOT anywhere that in the Global Variables Panel. And even if the variable zombie9=15, when I click on the button, "Pionzombie9" get Visible or invisible, even if I scripted :

Code: ags
if (Pionzombie9.Visible==true && zombies9 < 12) Pionzombie9.Visible=false;
else if (Pionzombie9.Visible==false && zombies9 < 12) Pionzombie9.Visible=true;


So... I'm a bit lost :)
#360
These variables are defined in the Global Variables Pannel, with a starting value of 0.

In the room, they are defined in Room_before fade in.

After the fade in, when I check the values, the values are the good one I attempted : Random(11) in some cases, or 15 for the others.

But the script of the button (this button is in a GUI that appears before the fade in too) is in the Global script, and it is like it doesn't know that these variables aren't equal to 0 (or anything else < 12...)

I thinked that Global Variables are readable for each scripts, even the rooms. But... there is something I don't understand...
SMF spam blocked by CleanTalk