Engine Planning!

Started by
22 comments, last by Rellik 20 years, 4 months ago
A memory pool is allways a good thing, but you shouldnt use several pools, you should use one.

How you then partition that memory pool is another thing all together.

You can assign an area for objects inferior to 1KB, another for objects inferior to 10KB, etc, the list goes on.

Another excelent thing is that when you handle memory like this you know everything about what is going on, and you can fill statistics sheets, what is the average mem block allocated, how many allocations per second, etc.

You can then use that data to tweak the assigned areas, so that memory fragmentation becomes more and more rare.

You can also create real-time analisers that predict allocations and do that tweaking in real time...

[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
Stop reading my signature and click it!

Advertisement
Another thing i forgot to mention before is a file system that supports:
- Archives
- Compression

Archives are those files that have more files in them. Let call them .BIG files. You can read a .big file''s header and virtually map all files inside into a virtual folder so to speak.

The game doesnt see the game''s data folder as it is, instead it sees all files that inside the archives, and doesnt see the archives themselfs. (this is just a design option, you can revert to normal folder status).

Also seamless Compression/Decompression is a huge plus. Imagining having data blocks that allways have a 2 byte header that tells the File.Read class if the next block is compressed or not. This way the class can decide itself to load the data and decompress it automaticly.

For the programmer, this is seamless. He doesn''t have to know if the file is compressed or not, as long as the tools used to create the file create the appropriate headers.

Such a file system allows us to have compressed resources inside archives, creating a neatly packed data folder:
Sounds.big, Meshes.big, Textures.big, Scripts.Big, etc....

[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
Stop reading my signature and click it!

Just be aware that there is overhead with compression -- decompression. If load times are a concern, this may either help or hinder, depending on the bottleneck.

Just saying, its a good option, but not a requirement by any means.
Well, not a requirement of course, but it doesnt hurt if its there. The Compression subsystem can be turned off entirely, and it isnt even invoked if your files dont contain compressed blocks.

If the game is 200MB compressed then there is little gain, might as well leave it uncompressed and fill an entire CD.

I imagine you could easily implement an option for file "mounting", in which compressed files could be decompressed, therefore saving in loading times, if the user is "rich" in disk space.

No one sins in adding features....

[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
Stop reading my signature and click it!

This topic is closed to new replies.

Advertisement