Questions tagged [game-loop]
The central code loop responsible for handling the running gameplay. At its most basic state, it accepts input, resolves the actions of entities, and renders the scene.
487 questions
1
vote
0
answers
123
views
Correctly handling input in case of frame drop
My game loop looks roughly like this:
...
1
vote
0
answers
68
views
Common Methods to Restrict User Movement and Prevent Other Objects from Acting in Games
I am a web and mobile app programmer. Compared to web and mobile app source code, I haven't seen much game programming source code.
In web applications, all elements are essentially static (?), and ...
0
votes
0
answers
214
views
Struggling with stuttering in my 2D C++/OpenGL game
I'm building a 2D game from scratch using C++ and OpenGL, but I've run into a frustrating issue: a simple sprite moving from left to right occasionally stutters. Tracking down the cause has been ...
1
vote
0
answers
51
views
1
vote
1
answer
289
views
Fixed timestep without cloning game state
I'm doing a JS game with hundreds of moving physical particles.
I've read the famous "fix your timestep" article. So far I've implemented basic prototype with janky game loop tied to FPS and ...
1
vote
2
answers
329
views
Making a game loop to run multiple threads
I'm having a really hard time understanding Threads and their contents.
What I'd like to have is a main game object (which I have) and a loop, where I can measure the time it takes for two threads to ...
0
votes
1
answer
82
views
When does SFML deal with user input
I have an SFML programme using window.setFramerateLimit() to determine the time step of the game.
I have a game loop that looks like this:
...
1
vote
2
answers
443
views
How to implement C# methods that automatically get called in the game loop, like Unity's Update() etc.?
I've been working on my own game engine for some time, I ideally need a way to create global function implementations to make it easy to do things within the game loop.
Heres an example:
...
0
votes
0
answers
70
views
Why do Unity UI toggle groups update *after* the default time in Execution Order settings?
Why is toggle group after default time in the default script execution order in Unity?
1
vote
0
answers
93
views
How do I create a build from a custom Game Engine?
I have an custom Game Engine, made in C++ and made in Microsoft Visual Studio 2019.
Currently, this Game Engine has a .sln with the following projects:
TheGameEditor, which is the current entry point ...
1
vote
1
answer
216
views
When should I call the physics simulation within the game loop?
I am thinking about where to call the physics simulation. The current situation is that I first update the entities and then the physics immediately before rendering. As you can see in the following ...
4
votes
1
answer
805
views
What causes some web game engines work in "slow mo" mode instead of reducing FPS but continuing to show the true time/tick state of things?
I used game engines that are capable of cross-platform export: Cocos Creator, Godot, Unity, others.
Some game engines have this thing, called "physics update" or "fixed update". ...
1
vote
1
answer
177
views
How to call every method with a certain name from a set of classes in C#
I have the following case:
I have a class called App.cs and here I have a function called Render, that runs once every frame:
...
0
votes
1
answer
417
views
Simulated light for a 2D tile-map with just SDL2?
I'm working on a 2D tile-map RPG with C++17 and SDL2 + SDL_Image.
There are daily cycles, weekly cycles and seasons. Even a kind of weather engine provides atmosphere. The moods and times of day are ...
17
votes
3
answers
6k
views
Game loop isn't performing well enough, so my frame rate is too low (Windows Form + GDI+)
I decided to learn about building games, so I picked up C# to use it along with Windows Form - I already have C# experience, so that was the main reason I did so. That said, I tasked myself to build a ...