Re:My first game with Carimbo, my homemade engine
by delduca on Tuesday October 08, 2024 @01:43PM
(#41779863)
The prefetching works like this: a list of assets is provided, and in each main loop iteration, the engine opens and loads a single one into memory (an unordered map of shared pointers). It would be more effective in a longer game, where as the player moves, the assets are already being prepared for use.
There’s also a mechanism to collect and remove unused assets from memory.
Regarding the asset prefetching, you mention that they are loaded lazily. Maybe I'm misunderstanding but to me prefetching and lazy loading are the opposite (i.e. you would prefetch during a loading screen in order to avoid loading things on demand since it could affect the game loop). Could you elaborate?