Menu

Preload et al

Happy Holidays to all!

We have been working on a way to pre-load GL resources, so you can avoid having start-up lag as the various textures and whatnots get demand-loaded.

This required some heavy re-work in the GLResource implementations, mainly so we could create an arbitrary number of GL resources while on the GL thread. This made synchronization easier too, since there is still only one sync operation, between the caller of ContextResourceLoader methods, and the GL thread.

An additional complication is that because of thread sync with GL thread, the GameCycle is not the place to invoke these operations. We struggled with this for a while, then remembered there's a dedicated thread in AGE for this purpose, the ResourceLoader task.

So wrapping this tale up, there is a new ResourcePreloader GO that you create with the lists of shaders and textures you want pre-loaded, and the rest is Happy Christmas! This GO should be sent through the Install Pipeline as soon as possible (first!) after your GameCycle gets the callback. Once this GO completes the pipeline, calls to ResourceLoader.createTexture() should return a cached object, and not have to load one.

We have also started another game, a puzzle-based strategy game based on an old-time curses flavored classic! This has exposed some additional opportunities for improvement, in particular GameHost now has some additional responsibilities, like handling Start Game UI and Loading UI etc. things that keep the user "informed" and head-off unwanted user input.

This game has a rather large board, and provided some challenges to the game design with respect to the Install Pipeline. It was rather easy to "choke" the pipeline, and this would cause GameCycle to deadlock on submitting messages to itself!

We did two things to ease this: first the GameCycle constructor has more parameters so you can control the BQ size and work-chunk size. We then used a different strategy when processing the tile set (80-by-25 or 2000 tiles). Since it is grid-based, we processed the layout one row at a time, avoiding saturating the Install Pipeline.

Aside from this small detour, we had our new game up-and-running in only 2 days, and that included time in Blender to make OBJ models w/UV mapping, and GIMP to make textures.

Watch for another Files update soon!

Posted by g-dollar 2014-12-27 Labels: status

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.