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\$
1
  • \$\begingroup\$ That's the maximum size of one object. \$\endgroup\$
    – user253751
    Nov 4, 2018 at 3:51

1 Answer 1

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\$
2
  • \$\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\$ Jan 15, 2018 at 17:05
  • 1
    \$\begingroup\$ Break that "500x500" meter map into pieces as well. \$\endgroup\$
    – user1430
    Jan 15, 2018 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .