Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,119 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Optimizing size of levels (memory issues) #357819
02/08/11 20:44
02/08/11 20:44
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Hello again,

I`m on optimizing the size of my levels, because I ran into serious memory problems (E1004 "No memory left").
I just optimized the geometry textures by successfully converting them into DDS. But the problems aren`t that smaller. Here`s the performance chart after loading my biggest level.



My questions:

The architecture of the level is very complex. The memory in kb of "m", "shd" and "v" are very, very high while the 16MB for geometry are okay.


- How can I optimize memory consumption in an efficient way?
- Is it possible to use DDS for panel graphics? (I use TGA+alpha channel at the moment).
- Does complex geometry waste much memory space?
- Is an entity count of 1636 too high? (80% of it is vegetation, grass, flowers etc. -> Is there a good vegatation script out there that automatically places plants on certain textures / uneven terrain?)


Thanks very much
- Rondidon laugh

Re: Optimizing size of levels (memory issues) [Re: Rondidon] #357823
02/08/11 20:58
02/08/11 20:58
Joined: Jan 2011
Posts: 120
United States
Logan Offline
Member
Logan  Offline
Member

Joined: Jan 2011
Posts: 120
United States
I will leave your questions for those who are wiser than I, but I do know for certain that the "v" number is the amount of video memory AVAILABLE left--not how much you have used. So you can rest a bit more at ease about that number. The higher the better.

See the manual page on "default.c" for more information about what all those numbers are.

Re: Optimizing size of levels (memory issues) [Re: Logan] #357824
02/08/11 21:01
02/08/11 21:01
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
how can he have two gb video memory left?

Re: Optimizing size of levels (memory issues) [Re: Joey] #357826
02/08/11 21:10
02/08/11 21:10
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
My system:
Core 2 Quad Q6600
Geforce 8800 GTS 512MB
4GB Ram
Windows 7 x64 Pro

-------------------
From default.c :



(memory)

- nx = nexus = i.e. file cache used by the current level.

- m = sys_memory = Virtual memory currently allocated by the engine for nexus, level, entities, and engine objects.

- geo = level textures

- shd = d3d_texsmaps = Amount of video memory currently used for wmb shadow maps. Adding the d3d_tex.. variables gives the total sum of video memory currently used for the game. Due to swapping and compression, the total value can be remarkably higher than the amount of video memory available on the 3D card.

- ent = d3d_texskins = Amount of video memory currently used for level models. Adding the d3d_tex.. variables gives the total sum of video memory currently used for the game. Due to swapping and compression, the total value can be remarkably higher than the amount of video memory available on the 3D card.

- v = d3d_texfree = Indicates the amount of texture memory still available on the 3D card, in MB . Is also displayed in the statistics panel. Can be inaccurate, depending on the 3D card driver. The real amount available for 3D textures is less than the memory on the 3D card, due to screen and other buffers. The video memory normally available at game start is can be several 1000 MB on new 3D cards, but 30 MB or less on old cards (TNT2).


Re: Optimizing size of levels (memory issues) [Re: Rondidon] #357854
02/08/11 21:58
02/08/11 21:58
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
If you want to convert your model textures to DDS read on.

Maybe it helps, it will only work if your models have external textures.
Even better: External textures with the same filetype, for example 24 bit tga.

Make a backup
Use "HexEditor NEO" to search and replace "tga" or "pcx" or "bmp" in the mdl files with "dds". You can do it in a batch process.
Convert your model textures to DDS.
Copy them into the model folder.
Voila.



Last edited by fogman; 02/08/11 22:00.

no science involved
Re: Optimizing size of levels (memory issues) [Re: fogman] #357874
02/08/11 22:19
02/08/11 22:19
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Very, very interesting:

Does anybody remember the random E1513 bugs "Crash in SYS" that Larry_Laffer with IntenseX, the guys behind Maniac Mansion 3D and William with Project Silas discovered? I`ve got them, too, now. They only appear RANDOMLY when the sys_memory (the used memory by the engine) is above 512MB and many c_trace functions are running parallely (my vegetation script. IntenseX made use of many c_trace funtions, too). When the used memory is above 900MB the engine also crashes randomly on every second to fourth level_load with "out of memory" although I`ve got 4GB RAM. These crashes are absolutly random. Sometimes the levels load without any problems, sometimes not. Sometimes there are some heavy slowdowns, sometimes not. And all those problems only appear when the memory usage is above a certain value.
Isn`t that interesting? IntenseX is dead because of those E1513s. Project Silas, although very optimized, has some trouble with E1005 and E1513s, too. It seems like most bigger projects reached that limit (look at the forum topics about e1005 and e1513). Hm..

Re: Optimizing size of levels (memory issues) [Re: Rondidon] #357960
02/09/11 12:16
02/09/11 12:16
Joined: May 2009
Posts: 439
T
TerraSame Offline
Senior Member
TerraSame  Offline
Senior Member
T

Joined: May 2009
Posts: 439
Rondidon,
You obviously have a great deal of time invested in both, your project and in understanding 3dgs...
I too have had issues with system crashes in the past. Therefore, I also watch these variables closly.

The optimizing process is a major concern constantly as I create a new project. You are right to use .dds textures wherever you can.
My biggest concern and problems in the past have been with to high a nexes value and I have found that the best way to keep that number as low as possable is to minimize the number of entities in a level.

As I understand, as the engine loads a level, it allocated memory for each entity by counting both wed placed objects and script placed objects.
That is why I created a run-time vegetation placement script that allows for trees etc to be placed when the player is close to the ground and removed as it's no longer required. That enables the forest/houses etc. count to be low at engine level load and therefore a lower nexes requirement.

With the A8.04.2b version a new convienient method of placing vegetation was included called, the "ent_seed" function and can be used to seed entities on terrain, depending on colors on a mask image. That may help you.

Other than memory allocated for texture and the level entity count value, there is the concern of verticie count value especially with the animated player. I do suggest in your optimizing process that you also constantly review the verticie count and minimize as you can...
Best of luck...

Re: Optimizing size of levels (memory issues) [Re: TerraSame] #358174
02/09/11 20:23
02/09/11 20:23
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Thanks very much for your tipps and experiences, Terrasame. They were very interesting.
I could manage to get rid of the crashes by reducing the entity size from 1600 to about 500 and optimizing some models and the sky boxes by using DDS textures. Superku helps me to code a performance friendly vegetation script.

Re: Optimizing size of levels (memory issues) [Re: Rondidon] #358204
02/09/11 22:09
02/09/11 22:09
Joined: May 2009
Posts: 439
T
TerraSame Offline
Senior Member
TerraSame  Offline
Senior Member
T

Joined: May 2009
Posts: 439
Rondidon,
It sounds like your on your way to an optimized project.
You should not have needed to reduce from 1600 to 500, that is, if you are refering to verticies.
1600 verticies should not be that big, some of mine are about 10000.

BTW, I had noticed that your nexus number is below 200. That's really good.
In the documentation it has been written that we should try to keep at or below that number.
That is not possable in my huge lanscapes. I am lucky to stay below 400.

About your "Sky boxes"... have you thought about getting away from those big things and use a system like "Mysty Mood" offers?
I have spent a great deal of time experimenting with sky boxes and sky domes.
I really like the Mysty Mood system... If you haven't checked it out, I suggest that you do...

Keep pounding the keys...
And post some shots for us to view so we can offer you our thoughts...


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