I have a template with a bunch of systems and subsystems I usually reuse, built around my own code architecture and custom methods, like:
- Event bus
- Material preloading
- Input manager (the one that tells the navigation hints which button icons to show)
- Save system
- Menus
- Etc.
I've been building and improving it with every jam I participate in. A lot of things tend to repeat, so that let me focus in the game.
There's also another template on the Wild Jam page where I found some interesting ideas, like input mapping.
But getting to the point!
For web builds, shader compilation and resource loading can cause some nasty stutters, especially since threading is more limited in the browser.
What I do is keep a list of all the objects, materials, resources, and particles I need. During the loading screen, I instantiate them in front of a camera on a layer that isn't visible to the player, but is still rendered internally. This forces the renderer to prepare the materials and shaders ahead of time.
That way, when those objects actually appear in the game, most of the expensive work has already been done, and they're ready to go!
On desktop, you have more flexibility to load resources on the fly, but on the web, I prefer to prepare everything before gameplay starts to avoid stuttering.
GPU particles are still a bit tricky, though. I haven't fully figured out how to prewarm those reliably yet!
But feel free to ask me anything :D