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.

learn more… | top users | synonyms (1)

1
vote
0answers
63 views

How Many Particles at a Time?

How many particles should a particle system be able to process in a single step/game loop? I designed a system and it can run up to 5000 particles with my 2GB RAM PC (I only run the particle system ...
1
vote
1answer
55 views

In the game loop, apply dt before the loop starts, or after it finishes?

Say I have a Game class with an update loop that receives a time increment dt by parameter. I was wondering if it's better or customary to apply this dt before the loop starts or after the loop ...
11
votes
2answers
1k views

Pausing the game inside the game loop

Inside the game loop, the game is paused by pressing P, meaning that the game loop does not run anymore. Problem is that after this loop is halted, P cannot be pressed again to resume the loop, since ...
3
votes
2answers
956 views

Events and objects being skipped in GameMaker

Update: Turns out it's not an issue with this code (or at least not entirely). Somehow the objects I use for keylogging and player automation (basic ai that plays the game) are being 'skipped' or not ...
-1
votes
0answers
17 views

deterministic game loop with fixed and variable rendering

reading this article I worked out a game loop that has deterministic time steps but I am having some trouble finishing up the renderer to use interpolated data. article: ...
2
votes
1answer
66 views

A deterministic game loop

I want to make a game loop that is deterministic sort of like a physics engine but it's for game update and rendering. I've done a lot of reading and I still was a bit confused. I've read these ...
0
votes
1answer
49 views

Smooth animation using delta times - big delays ocurring … [closed]

I'm writing a game on Android using OpenGL ES 2.0 for fun. I'm developing on Samsung Galaxy Note 3. I want to try to master smooth animation, i.e. correct frame transition and movement. I am focusing ...
0
votes
2answers
475 views

Cocos2d: Moving background on update: offsett issue

working with Objective C, iOS and Cocos2d I am developing a vertical scrolling shooter game for iPhone (retina display models with 640 width x 960 height pixel resolution). My basic algorithm works ...
0
votes
3answers
180 views

how to handle interactive choice in the middle of the game loop?

I am programming a turn-based game, 2D tile-based, overhead view. I have an update function and a render function running in separate threads. When it's the player's turn, the player can e.g. ...
0
votes
1answer
294 views

Android Game-Loop (rendering & logic removed, but still 'skipping frames')

Overview Guys really hopeing for some help here. My game loop is based on code from Fix Your Timestep!. I've read the article more than a few times, but I can't quite work out what exactly is ...
0
votes
1answer
210 views

Multiplying by delta not giving smooth movement

I started working on my first proper game but reached a problem straight away. In short I have a game that runs most of the time at 60 fps. ( I am using Libgdx a popular Java framework) but my game ...
0
votes
1answer
156 views

android game development: why is my screen black?

so, im strarting an android game from scratch, and every time I try i stumble uppon the same problem, my screen is not displaying what i want it to. I've read various tutorials but they are either ...
2
votes
1answer
808 views

How to implement the server-side game loop?

The server needs to handle the physics, because all the movement will be handled by it. So for that I need a game loop. The thing is that the server doesn't have the render part, it's just a console. ...
0
votes
1answer
129 views

NodeJS setTimeOut - How to run callback before delay time exceeded

I'm developing a card game server. I want to do this : While server process a turn for players, players have 20 seconds to do something. If players send a request to server within 20 secs, timer will ...
0
votes
2answers
55 views

How to create a Update function in Java

I have recently started using Java, but have been programming in javascript, and actionscript 3 for a while. I am used to the language giving me the ability to simply do something like: private ...
8
votes
3answers
785 views

UPS and FPS - What should I limit and why?

I'm currently writing a game using C++ and SDL2 and there's one thing that I'm wondering about - does it make sense to limit my frames per second (FPS) and/or my updates per second (UPS)? I get the ...
0
votes
1answer
120 views

How BufferStrategy works

I've used this piece of code a lot in my games, but I still don't know exactly how it works. // Main loop while (!done) { // Prepare for rendering the next frame // ... // Render ...
3
votes
1answer
74 views

Endless Running Game - Changing Lane Function in JAVA

I am developing a kind of vertical endless running game, where the character has 4 possible lanes to be in. I am using libGDX and want the character to change lanes by adding a horizontal velocity to ...
16
votes
2answers
3k views

Why does my sprite player move faster when I move the mouse?

I'm trying to develop a simple game made with Pygame (Python library). I have a sprite object which's the player and I move it using arrow keys. If I don't move the mouse, the sprite moves normally, ...
0
votes
1answer
60 views

is this approach correct to make my game framerate indipendent in javascript?

this is what i did my game loop is run every REFRESH milliseconds loop = setInterval(tick,REFRESH); in the loop i calculate how much time is passed since last tick and subdivide that for how much ...
2
votes
2answers
5k views

Android: Improving surfaceView?

I'm using Surfaceview in my Android app. I have two threads, one for UI and another for rendering and updading the UI. I am limiting my frames per second to 30 fps and have employed frame-skipping ...
1
vote
2answers
101 views

Questions About Game Loops

I've been reading up how to lay out a game loop that'll work optimally in both great and not so great conditions but I think I've confused a few techniques together... so I have some questions... ...
3
votes
1answer
161 views

Should UI be part of the game-loop?

I can't really find a good answer to this anywhere, I have never worked on games in a proffessional environment and I am wondering; Do these games render their UI in the main game-loop? That is, do ...
0
votes
1answer
85 views

How to use multiplication operation in game render delta time?

We are using delta time like this: private static final float SPEED = 200f; // Moving pixels in one second @Override public void render(float delta) { myObject.vx += SPEED * delta; ...
1
vote
0answers
119 views

Accessing variables from non-neighbouring classes specifically in game development (Android) [closed]

Edit Using direct access while breaking the law of demeter looks like this: res.sprite.drawQuad(res.sprite.xScreen,res.sprite.yScreen, mMVPMatrix); Using proxy methods / getters / setter looks ...
1
vote
1answer
190 views

Simple Tanks game - Client-Server communication approach doubts [closed]

I want to create simple a multiplayer 2D game with tanks ( cooperative ) in C# with .NET. I also want to keep it simple, because it is only a semester project, and unfortunately i don't have time to ...
1
vote
2answers
122 views

Movement in gameloop

I wonder what the best way is to move the player. Is it best to always check for movement like I do in the first example of is it better to only access the movement function via the input function ...
5
votes
2answers
846 views

Why is my gameloop slightly faster than 60 per second?

Here is my gameloop (taken from http://www.koonsolo.com/news/dewitters-gameloop/) which is supposed to limit the game (logic) updates to 60 per seconds and render as fast as the device allows: long ...
5
votes
1answer
250 views

Game Logic Update Order

Is there a commonly-accepted general approach to the order of processing logic updates? My current 2D platformer has objects that implement different concerns, including the following: Notifiable - ...
0
votes
1answer
93 views

Unity 2D: Change one instanced prefab then make all the others on the scene like it

I want to get this thing working: I have a prefab with coins, some obstacles and enemies, and i want it to be instantiated each time the player got to the right or left on the stage, to make the stage ...
1
vote
3answers
115 views

render/draw or input first?

When creating the main game loop, what order should things generally happen? IE, should i be getting input, doing logic and then rendering, or something else? does this even matter? when i was coding ...
0
votes
0answers
43 views

Directx 9 Obj Model

There's is a error with my obj load/render that I can't solve I'm a newbie in directx 9, I'm trying to do this in the best way The model is not displayed properly, do not know if this correct model ...
1
vote
1answer
106 views

How do I implement a fixed delta time step with a SDL_Delay(15ms) precision

So I am using SDL2.0 for making a Game Engine. Where I am having a problem is using SDL_Delay(). SDL_Delay's minimum delay time is 15ms, I've tried everything, and my FPS is Stuck at 64 because of ...
4
votes
2answers
946 views

HTML5 game fps render lag

I am currently creating a flappyBird-like HTML5 game using Proccessing.js You can see current work here: http://files.tips4design.com/flappySlothRelease/ The problem is that even though the FPS is ...
4
votes
3answers
6k views

Calculating Delta time , what is wrong?

For 2 days now i am trying to calculate the correct delta time for my game , I am starting to getting crazy since i tried all the solutions that i found on the 5 first google pages... What is wrong? I ...
0
votes
1answer
56 views

What type of loop code on game engines? [duplicate]

Recently I worked on a game on Spritekit Engine. My question is not about spritekit, but generaly about game engines. When I write a loop code and run it (eg while i< 100000) my CPU usage goes to ...
2
votes
1answer
70 views

What is the relationship between FPS and a game loop?

What is the relationship between FPS - Frames Per Second and a game loop? I'm confused how my book is using theses terms.
0
votes
1answer
75 views

What is the better way to speed up gameplay as the level rises?

I started with game programming couple of weeks back. For the starters I tried to develop ZigZag (link takes you to 2 min gameplay). I am done with the logic of gameplay by now. It runs well and ...
0
votes
0answers
52 views

Game loop not functioning correctly

I'm working on a game loop in C++ using OpenGL and GLFW and it works like expected (I think), except when I'm focused in the window the FPS drops to 1fps (or 1000ms per frame) but when I'm not focused ...
0
votes
1answer
86 views

Basic Monster Movement

I'm new to game development. Specifically server side. Currently I am trying to implement movement of monsters. From point A to point B. I have used an a* pathfinding library to calculate the path to ...
-1
votes
1answer
49 views

Java game loop delta not working

Hello I have game loop where I can change framerate. But when I change framerate to other, delta time not working fine. For example when framerate is lower everything is faster. Here is game loop: ...
0
votes
0answers
38 views

Game Loop Thread for different activities

First of all, sorry for my mistakes of language. I'm a noob of game programming in Android but I'm trying to make one using canvas and bitmaps. My game have two screens, the Title Menu and the Game ...
0
votes
0answers
138 views

Scrolling background loop however produces little gaps

I have myself a parallaxing background, i'm using SFML to render my background, I have myself 3 sf::Sprites, each sprite has the width of 576, I create myself 3 sprites with x positions 0, 576 and ...
0
votes
1answer
207 views

Capping framerate independently of logic updates in single-threaded Android Gameloop

My game is currently using the below game loop (this is an OpenGL ES 2.0 game, therefore the loop-work takes place on the rendering thread in the provided onDrawFrame method). Currently my loop ...
0
votes
4answers
160 views

Designing a multi-level game

I want to know to code structure of a game that has different levels to choose from on the main screen. More precisely, I want to know how does the main loop hands off the rendering to another loop ...
5
votes
4answers
340 views

How can I implement a real-time game loop in a text-based game?

I am trying to make a short text game with c++ to help me learn the language. I have made a version that basically displays texts, waits for an input, once the input is received it displays text, and ...
0
votes
0answers
147 views

Implementing a game loop with interpolation

I am trying to implement the Game Loop interpolated found in this website http://www.gameprogblog.com/generic-game-loop/. Here is my implementation: long frameRate = 50000000; int maxUpdates = 3; ...
0
votes
0answers
152 views

Cocos2d pause game freezes the screen

I am trying to create pause screen for my game. The game is developed upon continuous scrolling background (top to bottom) with obstacles which are moving independently (left to right). Below is the ...
0
votes
2answers
128 views

Do I really need a render() method in the game loop if the view subscribes to the models?

For a game that I'm working on, we've followed the MVC paradigm. However, in classic MVC, the view subscribes to the model and when the model updates it informs the view. We've implemented this as an ...
1
vote
1answer
58 views

Checking whether moving object has reached target position

So I have a fast-moving object in my game, let's say a bullet. At each iteration of the main loop I update the object's position based on the delta time value dt and draw it at the new position. I ...