realtime loading

realtime loading

i am trying to write a realtime loading routine for my game level, including setting up havok collision data. i found hkpMoppUtility::buildCode will block for quite a long time, which is not good for loading. but if i put it into a seperate loading thread, it will crash. so anyone can tell me how to build a havok world without blocking in realtime?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
havokchris's picture

Hi carriton,

MOPP building is slow; there's not much you can do about that. Is it possible to build the MOPPs offline, and save them with your level information? This is the approach that almost every game takes.

If you're using the Havok serialization system, this should happen fairly automatically. If not, you can still load it fairly easily from a separate file as shown in the MoppCodeStreamingDemo. It would also be easy to load from an address in memory, e.g. if you embed it in your own packfile system.

If you really really need it to happen at load time (the only real excuse I can think of is a procedurally generated environment), it should still be possible to load it in a separate thread. Can you build with the debug libraries and send on any warnings/asserts you're hitting, along with the callstack? Don't forget to call hkBase::initThread in your worker thread!

-Chris

Login to leave a comment.