U
User
Guest
Hi!
1) When i developing the game, i use some images, objects, instances. The volume of my graphics (images) will be about 100-200 megabytes. So i need to load it in my game.
I created objects and place objects in my room. Now i need to load sprites.
I see two ways.
First - load all sprites to all objects at the begining of my game. All at once.
Create loading_room with a progress bar, load graphics and change progress bar value.
Why am I doing this? I'm afraid of a delay in loading graphics in my game.
The maximum image size will be no more than 1 MB.
Second - load sprites to objects when i need an object.
Place object in my room and using script like
Which way is better?
2) Can i create objects from the code? Like "create_object(my_new_object);" Or it is bad idea and i must allways create objects using GMS2 editor?
3) I can create instance using "instance_create_depth" function. I can create this instance in my RoomCreationCode. So it will be created once? No matter how many times I visit the room...
4) What will happens to memory (video memory, CPU load etc.) when player played a game?
Is it true that - the more rooms the user will visit, the bigger amount of memory and CPU resources needed? In the first room we create 3 instance and load 3 sprites. In second 2 instance and load 2 sprites.
So now we have in our memory 5 instance and 5 sprites. Or we allways need to destroy instance?
Has GMS2 a garbage disposal mechanism or not? How should we act?
(In delphi - List.free or my_object.destroy. In php unset($my_var) to optimize memory usage when we need it)
1) When i developing the game, i use some images, objects, instances. The volume of my graphics (images) will be about 100-200 megabytes. So i need to load it in my game.
I created objects and place objects in my room. Now i need to load sprites.
I see two ways.
First - load all sprites to all objects at the begining of my game. All at once.
Create loading_room with a progress bar, load graphics and change progress bar value.
Why am I doing this? I'm afraid of a delay in loading graphics in my game.
The maximum image size will be no more than 1 MB.
Second - load sprites to objects when i need an object.
Place object in my room and using script like
Code:
//set position
main_logo.x=10;
main_logo.y=10;
//set sprite
main_logo.sprite_index=sprite_add("main_logo_spite.png", 1, 0, 0, 0, 0);
//set depth
main_logo.depth=-1;
2) Can i create objects from the code? Like "create_object(my_new_object);" Or it is bad idea and i must allways create objects using GMS2 editor?
3) I can create instance using "instance_create_depth" function. I can create this instance in my RoomCreationCode. So it will be created once? No matter how many times I visit the room...
4) What will happens to memory (video memory, CPU load etc.) when player played a game?
Is it true that - the more rooms the user will visit, the bigger amount of memory and CPU resources needed? In the first room we create 3 instance and load 3 sprites. In second 2 instance and load 2 sprites.
So now we have in our memory 5 instance and 5 sprites. Or we allways need to destroy instance?
Has GMS2 a garbage disposal mechanism or not? How should we act?
(In delphi - List.free or my_object.destroy. In php unset($my_var) to optimize memory usage when we need it)
Last edited by a moderator: