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)

3
votes
2answers
1k 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 ...
2
votes
2answers
80 views

Could someone help me understand this game loop logic?

I'm learning Java game development and trying to dissect this game loop: // Game loop final int TICKS_PER_SECOND = 60; final int SKIP_TICKS = 1000 / TICKS_PER_SECOND; final int ...
0
votes
0answers
39 views

AAA Loop/Event driven design [on hold]

I have a few questions: Are there any event driven AAA games out there? When companies develop larger games. They usually use a loop based system (?). Aside from the team that's responsible for ...
0
votes
2answers
501 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
1answer
49 views

Implementing a modal dialog from scratch with C++

Right now I'm implementing my modal dialogs in windows with a separate message loop after popping up the dialog. This straightforward an approach won't work with other systems that don't have message ...
0
votes
3answers
199 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. ...
15
votes
3answers
5k views

Finite state machine in C++

So, I've read a lot about using FSMs to do game state management, things like what an FSM is, and using a stack or set of states for building one. I've gone through all that. But I'm stuck at writing ...
4
votes
1answer
132 views

How can I show slow motion?

In my very, very simple 2D game I'm working on, I'd like there to be moments of slo-mo. What is the best method of showing the player that the game is currently in slow-motion? As in, what is the ...
0
votes
1answer
347 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
259 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
186 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
2answers
945 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. ...
9
votes
4answers
3k views

Is a separate thread for game loop compulsory for simple games?

I am new to game development. In order to learn I am recreating this game on android platform. You can observe the game-play video at the above link. It is a simple game. I have read a lot of ...
0
votes
1answer
144 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 ...
2
votes
1answer
245 views

Varying framerate (FPS) [closed]

In my game-loop, I am using fixed time step for physics and interpolation for rendering as suggested on Gaffer on Games | Fix Your Timestep! However, when the framerate is varying between 30-60fps ...
0
votes
1answer
179 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 ...
1
vote
1answer
113 views

Laggy empty project at 60FPS

@Override public void create() { batch = new SpriteBatch(); img = new Texture("badlogic.jpg"); } @Override public void render() { Gdx.gl.glClearColor(0, 0, 0, 1); ...
20
votes
2answers
8k views

What is the standard C# / Windows Forms game loop?

When writing a game in C# that uses plain-old Windows Forms and some graphics API wrapper like SlimDX or OpenTK, how should the main game loop be structured? A canonical Windows Forms application has ...
1
vote
2answers
63 views

Should input be per-frame or per-update?

I'm implementing a GUI system to look around a 2D tile-based world. At the moment, I'm updating it every time the mouse moves (which happens to be per frame, since that's when it polls for events). ...
1
vote
1answer
41 views

Playing with hashmap in drawing

I'm developing a game in Java for Android, using LibGDX. In my render(), between the batch.begin() and batch.end() I'm running through all the game objects and draw them. Every game object is stored ...
5
votes
4answers
3k views

Game loop on windows

I have seen different "basic" game loops both from books like "Introduction to 3D game programming with DX11" or online tutorial ( Rastertek ) and if we take off all the fancy stuff to control ...
1
vote
1answer
26 views

Client and server loops don't match up

I'm trying to build a small networked game using WebGL and NodeJS. I have a basic client and server setup and I'm at the point where I'm trying to implement dead reckoning to simulate what happens on ...
3
votes
1answer
75 views

Does libgdx implement the game loop for you?

Initially, I assumed that the developer has to implement the game loop because libgdx is a library - not an engine. But then I found out that Graphics has getDeltaTime() and getRawDeltaTime() so I ...
1
vote
0answers
75 views

How Many Particles at a Time? [closed]

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
58 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 ...
2
votes
1answer
84 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
2answers
118 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
812 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 ...
3
votes
1answer
109 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
66 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
110 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
194 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
97 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
122 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
290 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
130 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
859 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
256 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
129 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
139 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
53 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
189 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
1k 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
60 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
74 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
83 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 ...