0
\$\begingroup\$

i were asking myself how could i load a large Level? My gameengine is written in C# and is rendering with Direct3D11. I just have my class called "Scenery" and the class is able to store all objects in a level (sceneryObject) with their components and features. My engine loads the serialized scenery, but i know that the maximal size of a .net object is 2gb. So how could my Scenery class load bigger levels? The .Scenery class contains a List with all the objects, and the Assets are included within the sceneryClass. Do you thinkthe Scenery class should not include the Assets, and they should be stored extern?

Maybe somebody have a suggestion :)

Best Regards and thanks in advance!

\$\endgroup\$
  • \$\begingroup\$ That's the maximum size of one object. \$\endgroup\$ – immibis Nov 4 '18 at 3:51
2
\$\begingroup\$

Break the level into smaller chunks and load those instead.

This will give you a number of extra benefits, decreasing overall memory usage and enabling you to stream levels in and out to decrease perceived load times.

A basic approach to subdividing a level is to do it based on a fixed-size grid, where each chunk is a grid cell. To start with, you could just do the chunking piece: break everything up into chunks however you need to (including splitting your source map assets, if necessary) and load them all, assuming you have the memory. Once that works, worry about figuring out how to load only the parts that are immediately needed and stream the rest in and out.

\$\endgroup\$
  • \$\begingroup\$ But if i use Photoscanned Assets and a 500x500 meter chunk has more than 2gb - what should i do then? And if a chunk should be much smaller. And should each Chunk has his own DataFile? \$\endgroup\$ – Kerbo Games Jan 15 '18 at 17:05
  • \$\begingroup\$ Break that "500x500" meter map into pieces as well. \$\endgroup\$ – Josh Jan 15 '18 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.