Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Game_load, slowly increasing nexus usage #468582
10/11/17 02:52
10/11/17 02:52
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hello!

Im playing around with game_save and game_load. Everytime I save the game with:

game_save("test_save",1,SV_FUNCTIONS+SV_LEVEL);

and load the game with:

game_load("test_save",1);

My nexus usage goes up every load, and eventually I get the "nexus too small" error. What could cause nexus memory to increase every load??

Re: Game_load, slowly increasing nexus usage [Re: jumpman] #468583
10/11/17 03:07
10/11/17 03:07
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
the SV_LEVEL is increasing my nexus usage each load. Why do you think that is?

Re: Game_load, slowly increasing nexus usage [Re: jumpman] #468587
10/11/17 06:33
10/11/17 06:33
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
are you creating/deleting a lot of entities?


Visit my site: www.masterq32.de
Re: Game_load, slowly increasing nexus usage [Re: MasterQ32] #468612
10/11/17 16:14
10/11/17 16:14
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
I was creating alot of entities, throwing them up in the air, saving, and reloading. The game would load correctly, and the objects would load in the air and drop, but the nexus would slightly increase on every load.

I have then tried loading a NULL level then game_load the save file, which kind of helped, but loading the save file increased the nexus usage anyway.

After some testing, I have found 1 culprit, which was PSSM shadows. When i pssm_run(0); correctly, and waited 1 frame before reactivating them, the nexus nor the sys_memory increased. Nothing was being incremented laugh

However, my next questions pertain to what are good practices concerning where to perform game_save and game_load. Currently, I am doing game_save and load through panel buttons! Its not advised in the manual, without a wait before hand. Do you do game_save and load through startup_ loops?

SV_VARS seems to balloon my sav file from just a couple kilobytes to 20 megs! What does SV_VARS save exactly?

Re: Game_load, slowly increasing nexus usage [Re: jumpman] #468614
10/11/17 16:21
10/11/17 16:21
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
I think it's a good idea to write your own loading / saving function. That way you have more control over what's being stored and how it should be saved or loaded. This can be a bit tricky and time consuming, though smirk


POTATO-MAN saves the day! - Random
Re: Game_load, slowly increasing nexus usage [Re: Kartoffel] #468624
10/11/17 18:10
10/11/17 18:10
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
How do you do your saving and loading kartoffel?

In the manual it says: A single var is 4 bytes. So if i did this:

var Max_Nodes[999999];

Its 4 bytes multiplied by 999999, which gives me 3999996 bytes, which equates to 3.999996 megs. So this single array currently would take up 4 megs of space/memory.

So if I use SV_VARS, it will save every array, and I have multiples of these huge arrays. Is this the reason why my .sav file is 20 megs?

I have 60 of these huge empty arrays. If each of them is 4 megs, the total should be 244 megs. Why isnt the .sav file over 244 megs?

Re: Game_load, slowly increasing nexus usage [Re: jumpman] #468661
10/12/17 13:55
10/12/17 13:55
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
I don't know how the engine decides what to save, so I can't help you with that. If I had to write my own function I'd start by deciding what data I want to save, in what order and so on. Storing it in a file is basically just binary writing / reading. You could add some level of encryption & file integrity checking to prevent people from easily fiddling around with savegames aswell.


POTATO-MAN saves the day! - Random
Re: Game_load, slowly increasing nexus usage [Re: Kartoffel] #468666
10/12/17 14:43
10/12/17 14:43
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hi Kartoffel!

Do you write them into txt files? I was able to do that once.

Currently, I have the save and load working so far, but as you know, once you declare something working, it will crash soon after laugh If you'd like to know how I got it working so far, I can let you know if you'd like, incase you want to use the native save/load system.

Re: Game_load, slowly increasing nexus usage [Re: jumpman] #468693
10/13/17 03:38
10/13/17 03:38
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
I am using file_var_write and file_var_read to save, then load data from a .txt file. You will also need file_open_write, file_open_append and file_open_read to get these things working.

It is complex and tricky to set up, but I was unable to get around the problems caused by Game_save and Game_load ... well worth the trouble.

Re: Game_load, slowly increasing nexus usage [Re: Dooley] #468717
10/13/17 19:04
10/13/17 19:04
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
what problems did you run into using game_save and game_load dooley? Im assuming your txt file load system wont save the actual game state, but it will save the relevant information at certain checkpoints?


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1