Game Loop
11–20 of 58 posts
Re: Game Loop
#12 next_world_state = UpdateWorld(inputs, previous_world_state)
Where inputs is all external inputs (user inputs and "time"). How the inputs is updated (and how frequently) is totally decoupled from how the game engine operates. Additionally, from the next_world_state, you can derive what to render to the screen, what audio to play, what text to render, etc. If you want to drop frames, just don't render each world state.Re: Game Loop
#13Earlier quoted context omitted.
I love this book as well. I think part of what makes it so good is that the patterns are discussed in a very domain-specific context and their usage is not overly abstracted. I often find it hard to see why a particular "widget" or "foo/bar" pattern or structure is used/useful, but when you put the examples in a very specific context like this, it's much easier to understand their value and remember why/when/how to u…
I similarly have difficulty learning a concept when it's presented using real-world metaphors that aren't often actually expressed via code. This is how object oriented programming was taught to me: imagine a door object, which contains methods open and close, and it contains a knob property, which is its own object with functions to turn left and right, and so forth. Once you're familiar with OOP this might seem lik…
The only time these overlap is in video games, which is usually not used as the context for teaching software development when OOP is taught.
Re: Game Loop
#14Back then I was doing mobile game development for PocketPC.
After I left that company, some ex-colleague had to do some changes in my code, or port it, I can't remember. So he was looking at that game loop that I implemented, and was thinking "What the hell is he doing here???". So he did a google search to see if he could find something, and immediately stumbled upon an article, written by that same programmer :D.
He told me years later when I saw him, and said "What are the chances that you search something on google because of code you're going through, and find the article that explains it written by the same programmer".
I was still a junior back then, so probably I should have commented my code a bit better (instead of not at all ;)).
I still want to write a revised deWiTTERS game loop article, because the steps in a physics engine could make the extrapolation redundant.
Re: Game Loop
#15I have a funny story about the deWiTTERS game loop that I wrote a long time ago (referred to in the article above) Back then I was doing mobile game development for PocketPC. After I left that company, some ex-colleague had to do some changes in my code, or port it, I can't remember. So he was looking at that game loop that I implemented, and was thinking "What the hell is he doing here???". So he did a google search…
Re: Game Loop
#16I have a funny story about the deWiTTERS game loop that I wrote a long time ago (referred to in the article above) Back then I was doing mobile game development for PocketPC. After I left that company, some ex-colleague had to do some changes in my code, or port it, I can't remember. So he was looking at that game loop that I implemented, and was thinking "What the hell is he doing here???". So he did a google search…
When I google "game loop", I found deWiTTERS Game Loop, http://www.koonsolo.com/news/dewitters-gameloop/ which I still not fully understand.
Re: Game Loop
#17While this book seems to get a lot of praise (as it deserves, obviously), I wish the style of teaching complex programming topics walked me through the pain of making something work, exploring a few alternative solutions, showing the tradeoffs, and then after the pain has been experienced by the learner, a proper solution is finally introduced and recommended. IMO it's a much more powerful technique for teaching if y…
The one that springs to mind for me is Functional Programming in Scala.
Re: Game Loop
#18Earlier quoted context omitted.
When I google "game loop", I found deWiTTERS Game Loop, http://www.koonsolo.com/news/dewitters-gameloop/ which I still not fully understand.
What is the part that is not clear?
Re: Game Loop
#19While this book seems to get a lot of praise (as it deserves, obviously), I wish the style of teaching complex programming topics walked me through the pain of making something work, exploring a few alternative solutions, showing the tradeoffs, and then after the pain has been experienced by the learner, a proper solution is finally introduced and recommended. IMO it's a much more powerful technique for teaching if y…
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Pyt...
Re: Game Loop
#20Extrapolating up to one physics frame is still not a good solution, it will be noticeable. For example a falling object will clip in the ground for tens of ms of displacement which is definitely visually significant. A better solution is to either only interpolate and live with the additional frames of input latency (fine for a lot of games) or resimulate the next physics frame with the new player input, and live wit…
https://gafferongames.com/post/fix_your_timestep/
I’ve had a great experience so far following Glenn’s suggested solution.