Confusing about game_save

Posted By: Emre

Confusing about game_save - 05/05/14 20:41

The manual says; " All .._create and .._remove functions, except for creating and removing level entities, must be executed before the first game_save or game_load call. "

is it true? is it mean if i use game_save, i can't use any _create and _remove function after the first save?

I search forum and find also this
Originally Posted By: Superku
If you use any _create function except ent_create (so if you create panels at runtime or something like that) you sadly cannot use game_save.


I've tested it. I've created a panel after first save, remove it and load game without any error. But i don't trust that little test.

So i'm confused. Can someone please enlighten me?
Posted By: Superku

Re: Confusing about game_save - 05/05/14 21:53

If you remove all panels (/ other objects) that you've created after the game_save before you load the file again everything should be fine. The problem in not doing so is that the load instruction simply will fail because of a different number of objects of each type (I don't know if things like removing the oldest panels instead of the newest panels could work too so you have the same amount of objects, there may be other problems with different C_LINK index values and so on, you'd have to test that).
Posted By: Emre

Re: Confusing about game_save - 05/05/14 23:38

Thank you Felix. Glad to hear it. My game use just about 1 GB ram. it's so much for this indie game you know. (Well, my game isn't damn FarCry2) Now i can reduce it. bmap_create, mtl_create and snd_create will really help.

Quote:
(I don't know if things like removing the oldest panels instead of the newest panels could work too so you have the same amount of objects, there may be other problems with different C_LINK index values and so on, you'd have to test that).

I don't think it will work that way, as you said. But just removed the newest object -without error- fine for me.
Posted By: Superku

Re: Confusing about game_save - 05/05/14 23:45

Have you checked the memory usage in a published version of your game yet? The memory requirements are usually notably higher in a debug/ test run than those of the final executable.
Posted By: Emre

Re: Confusing about game_save - 05/06/14 00:43

Yes. The memory requirements of published version is almost 150 MB less than the test version. Published version of demo use 680 MB. But full game version much more than. For example, i have 10 R32F texture for static indoor shadows. (5 for level2, 5 for level3) Each one of them 6 MB. (3072x512) -EDIT:i mean 6 MB for hdd. in memory each one of them 10 MB.- And i have about 1 minute .ogg song for level 2. It means 10 MB in memory, even in publish version. (Think i have 5 different songs) i can't use media_play because of license things. (some sounds had to be in wrs.)

I mean there is almost 200 MB for other levels. Maybe much much more than. I believe -_create remove- things are really will helpful.
© 2024 lite-C Forums