I would like to ask some advice on my issue:
I’m making a pretty simple game. The logical units of the game are divided into separate “appstate”, (enemy, hud, player, sound, etc.). I load all of the “appstate” beginning of the game, but due to the loading time, the game starts faster than it actually rendering on the screen.
Wondering how to solve this problem? What is the right way to load the appstates and assets? How can I delay or timed the start of a game?
You could start the game paused and wait for user input to unpause
Make an app state which loads everything and then enables/attaches all the other appstates?
The game starts faster than actually rendering on screen sounds a bit strange though. Technically this shouldn’t be possible, because even when loading, it just freezes the game.
So I interpreted this as: My app states fail because the objects cannot be found yet? Like the models?
If the problem is that the game starts before the user can really do something: @QSDragon is right.
Or have a main menu where one can click start OR have a countdown from 3 or something. There are many possible ideas.
What I do is display a loading screen while loading the level on the background. Once everything is loaded and attached to scene graph I call
This will do some magic (send data to graphics card…?). After that I just signal that I’m ready to start the game and remove the loading screen. This provides a relatively stutter free transition to the game.
Thanks for the quick response. Based on the above, it appears that the problem has been resolved.