Skip to main content

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
289 views

When writing a game loop from scratch in java for an android game applications, it is very common in many tutorials I have read that the keyword synchronized is used to synchronize update and ...
Alex Bükk's user avatar
0 votes
1 answer
512 views

Please can somebody help me as I'm a lil bit new to game dev and user interface designing. I am trying to create a simple Texas holdem poker using phaser3 for multiplayer application. I have a few ...
user8903551's user avatar
0 votes
0 answers
208 views

I currently implement my game loop using a variable fixed timestep, i.e. dt = 1 / monitor_refresh_rate with vsync (or pseudo vysnc with delays where vsync is ...
Edward Chamberlain's user avatar
0 votes
1 answer
217 views

I am creating an implementation of Snakes and ladders and I run into some issues.The game is updating too fast and I want to limit the framerate kinda,or make a pause so that the move is actually ...
laegirl's user avatar
  • 101
0 votes
1 answer
652 views

After looking at some code sources out there I noticed Java Swing Games usually create a class implementing Runnable, create a new Thread and set up the game loop ...
Jean Henry's user avatar
3 votes
2 answers
2k views

I am decreasing my velocity by 50% every second using a guide I found online. I am using the code here and it gives the right result but only for very small values for dt: ...
user avatar
0 votes
1 answer
229 views

I implemented a high level components system for my renderer and am curious about the right way to update the transforms components of models that have a physics rigidbody attached. I am using ...
D3d_dev's user avatar
  • 338
3 votes
2 answers
196 views

I am developing a fast-paced multiplayer shooting game and following instructions from this source http://www.gabrielgambetta.com/entity-interpolation.html. In the article it says that: several ...
anekix's user avatar
  • 145
2 votes
2 answers
4k views

I tried to create an array Entity[] with elements Human and Zomby. ...
JonnFranMore's user avatar
0 votes
1 answer
264 views

I am making a JavaScript game called "Spoop: The Clicker", and I have a variable shown by text: ...
Mr________'s user avatar
0 votes
2 answers
294 views

I am trying to make a 3D game with C++, SDL, and OpenGL. My program roughly looks like this: control function has only CPU operations. draw function has CPU and OpenGL functions operations. I just ...
Emre Kaya's user avatar
  • 555
0 votes
0 answers
144 views

I'm currently working on iocp game server. My game is just like diablo3 basically. 1~4 players join a separate session. I did basic iocp preparations and now I'm working on game session class. The ...
Jeongmin Heo's user avatar
1 vote
0 answers
101 views

I'm working on a simulator project. Computer A which uses a stick as a controller to produce operation data and calculate simulate data which will be sent to computer B as camera positions to render ...
Sheldon Wang's user avatar
0 votes
1 answer
302 views

I made a html canvas example of an infinite scrolling map with objects in static places. As you can see in the Fiddle below, when you move left with the Arrow Keys, you can see that the map does not ...
Jon Potts's user avatar
1 vote
1 answer
345 views

So I'm working on a real time multiplayer game in NodeJs (Client and Server). Both loops handle the same "physics" (movement at a constant rate) and both are running at 40hz or 40 times per second. I ...
DanteVentura's user avatar
3 votes
1 answer
2k views

The code I'm using is like so: ...
LASER BEAR ASSAULT UNIT's user avatar
0 votes
1 answer
1k views

I found that in game development, most people set a timer that gets triggered every 16ms to do the rendering. As an Android programmer, I'm familiar with the Choreographer. You set a callback that ...
ravenisadesk's user avatar
0 votes
1 answer
174 views

Say I build a snooker game, where balls need to jitter around. Balls belong to a class (ball class), where all the ball functions are defined. In the animation, time evolves by a clock ticking ...
feynman's user avatar
  • 1,243
0 votes
2 answers
1k views

I am trying to multi-thread my game so that one thread updates and renders the player, while the other listens for inputs. I used a while loop to keep my detached thread running in the background, ...
Priswall's user avatar
1 vote
1 answer
610 views

I have a big problem with my Java games. In every game I make the movement of the player and objects just looks awfull. The framerate is 60 fps without any problems. But the movement looks extremly ...
MarTUN Up's user avatar
1 vote
1 answer
599 views

I'm trying to build play with MonoGame and I'm trying basing this regarding the GameTime steps. In my main Game class that is being run in the main entrypoint of my project, I'm doing something like ...
Kamigaku's user avatar
  • 177
0 votes
1 answer
219 views

I have a game that should draw many shapes on the canvas and in every frame these shapes position will change, the game is running smooth but after adding more shapes some jerk arise and it drops some ...
Afshin Izadi's user avatar
5 votes
1 answer
2k views

For some time now i have no been able to pinpoint the nature of the rendering stutter shown above(by not clearing the screen, not using SwapBuffers and drawing only to the front buffer). See the big ...
user avatar
0 votes
3 answers
2k views

I have been thinking about this a lot and don't know if i'm thinking incorrectly. Most games have one game loop that can be split into three functions. A basic game loop would look something like ...
Dolfos's user avatar
  • 11
2 votes
2 answers
872 views

How can set up time elapsed based events separate from the game loop? I want the character to heal over real time rather than per cycle of the game loop. How might i do that?
Richard Carpenter's user avatar
0 votes
1 answer
2k views

My game loop below doesn't sleep as log as it should. The delta value always ends up less than 1, when it's supposed to be 16.6666 or close to 16.6666 ...
I_Suck_At_Everything's user avatar
4 votes
1 answer
12k views

I was watching 2 video tutorials on how to make java game and read a couple articles about game loop. However, I'm still confused about how game loop actually works. The first tutorial used code that ...
Zerro97's user avatar
  • 53
1 vote
1 answer
231 views

thank you for checking out my issue! I am trying to develop a game in java, but I have run into a problem. I would like to keep the physics as realistic as possible, so I am using a fixed time-step ...
Fruot's user avatar
  • 11
11 votes
2 answers
3k views

Im making more games and asking more stupid questions. Hopefully this one is very brief. I'm making a very basic class which just moves a Player object by applying force to a rigidbody, but it got me ...
Big T Larrity's user avatar
0 votes
1 answer
148 views

Let's say a game engine had a central game class as well as multiple systems (as objects) that are stored within it. These systems (such as input, rendering, sound, etc) would also be updated by this ...
user avatar
0 votes
2 answers
983 views

I've tried to create a simple start menu for my game which informs the player to press a key to start the game but the problem is that it works only if the key is pressed all the time...i'm not sure ...
Truica Sorin's user avatar
1 vote
1 answer
932 views

I am using Turbo C++ to make a game using the graphics.h library (I know it's a bit old). In this game, the player can move left, right and they can jump using A, D ...
kross's user avatar
  • 11
5 votes
1 answer
512 views

Do games have a frame rate at X fps that updates logic and also renders? Or do games update logic at a much slower frame rate than rendering? Let's say 20-25 fps for logic, and 60+ fps for rendering....
Mike5050's user avatar
  • 181
1 vote
1 answer
169 views

I read some article about a gameloop, based on Actor system. (yes, it is Development & Deployment of Multiplayer Online Games Vol.2 by 'No Bugs' Hare) Here is pseudocode. ...
Kichang Kim's user avatar
0 votes
1 answer
56 views

I have this code to add 10 point if someone click the button and change the question. But it returns 10 point every time. I want to make it 10,20,30,40... etc. ...
dogankirnaz's user avatar
0 votes
1 answer
84 views

Does anybody know the best method for taking game data and setting up java to read the data then print it to the window... of which you want the game loop to start the game and read the data... Here ...
John Nay's user avatar
0 votes
1 answer
331 views

I am making a basic game loop based on this article. This is the nearly final version: ...
anekix's user avatar
  • 145
9 votes
3 answers
11k views

I'm wondering how drawing simple geometry with textures can eat up so much performance (below 60fps)? Even my good graphics card (GTX 960) can "only" draw up to 1000 sprites smoothly. The textures I'm ...
kalidali's user avatar
  • 333
0 votes
2 answers
384 views

I am currently writing a 2D top-down shooting multiplayer game using Java. I have a game loop at the client-side that does the following in order in each game tick (The client is running in a tick ...
ccy1997's user avatar
1 vote
1 answer
682 views

I´m playing around and trying to make myself an easy platformer using the Box2D physics, before that I was not using it and was using my own physics implementation(just simple movements with timestep)....
Pins's user avatar
  • 589
0 votes
2 answers
432 views

I've been writing my own game engine and I was wondering the correct way to handle my game objects. Each game object is different. The only thing they have in common is a set of operations to handle ...
renno's user avatar
  • 115
-1 votes
1 answer
254 views

I'm having a long headache (which may not be that complicated) with this frame rate thing. I already tested several frame rate algorithms, lastly I tested this here and they all gave something strange ...
Dormin's user avatar
  • 34
1 vote
1 answer
194 views

I am trying to make a fighting game where two characters are fighting with hands or can have some weapon in their hands. It's a multiplayer game targeting initially for mobile devices. In Game, there ...
LebRon's user avatar
  • 252
1 vote
0 answers
579 views

Hi i'd just like to preface this by saying i'm new to game development and currently learning the ins and outs of libGDX. I want to create the board game scrabble however i'm having trouble figuring ...
sleepingOnion's user avatar
1 vote
2 answers
108 views

I am developing an athletics game, and working on the mechanics of the 100 meter dash. The player controls an athlete, that during the race has acceleration and a max speed. To win the race, the ...
LongInt's user avatar
  • 121
7 votes
1 answer
1k views

My games usually start lagging quite easily when there are a couple hundred of boxes representing possible characters. While games like SimCity or even Anno have hundreds of characters. I realized ...
MisteriosM's user avatar
3 votes
2 answers
733 views

Let´s say I have a single frame stack allocator, so I´m using it for allocating memories for my temporary data. ...
Pins's user avatar
  • 589
2 votes
1 answer
1k views

I am a mildly experienced programmer who has created several game engine templates and small 2D games in Java. I am currently expanding to 3D game engines and I am re-writing a previous engine to be ...
Ryan's user avatar
  • 41
2 votes
1 answer
13k views

I'm currently in the process of making a game loop in a console application. I'm trying to make the game loop wait at the end of its loop for ...
Trr1ppy's user avatar
  • 23
0 votes
1 answer
72 views

I am a newbie game developer. I have one problem. Consider the following case. I have a simple game with only one object - a ball. A ball can move only up and down from one side to another. A User ...
solderingiron's user avatar

1 2
3
4 5
10