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.
1
vote
1answer
52 views
Gamemaker Loop Question
How often do loops repeat in game maker? Is it every step, or as fast as it can handle? I need it to loop every step, is it possible to do that? I'm talking about in code, I have a do until loop. Just ...
5
votes
2answers
177 views
Java 2D game programming: Different approaches to make a game loop
I am new to Java game programming, but the more I read the more I'm confused, because I've seen several different approaches to make a game loop:
1. The standard approach, that uses the Timer class ...
7
votes
4answers
404 views
Simultaneous game states
I think I understand the basic idea behind a Finite State Machine-based game loop. But I'm trying to write a little game in which the same object can simultaneously be in multiple, independent states. ...
-3
votes
0answers
74 views
Android game loop in separate thread [duplicate]
I am about to port a game that was initially written for iOs and I am having some doubts how certain things should be done.
I have been looking many of the examples of the game loops for android, and ...
-1
votes
1answer
52 views
simple win32 window wont show [closed]
The program compiles and runs successfully but does not show a window, it simply ends immediately.
#include <Windows.h>
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, ...
3
votes
2answers
105 views
Behavior Tree Iteration Rate
How is a Behavior Tree iterated in a game? For example, let's assume you have an extremely large Behavior Tree with about a hundred Actions/Conditions. If we were to run one action or condition ...
1
vote
3answers
193 views
Whats an elegant implementation for 2D collision detection in a block based game?
to make things clear, i do not want to know HOW to implement collision detection mathematically. What i am looking for is an elegant way to check for collisions without having to manage seperate lists ...
3
votes
1answer
174 views
The most efficient and accurate game loop?
Obviously for a game to work you need a game loop... Normally, my game loop would consist of something like this:
while(running){
update();
render();
Thread.sleep(10);
}
This seemed to ...
-6
votes
1answer
77 views
Generic Class Name for RTS [closed]
Hopefully this will be a nice easy question :-
I am building an RTS as a way of learning OOP techniques.
Currently the code has the following classes
Class MustInherit GameUnit
Class MustInherit ...
6
votes
1answer
146 views
Behavior Trees :: Actions That Take Longer Than One Tick
From what I understand on Behavior Trees, each Behavior should be a short goal oriented Action that could be done in a few iterations.
So for example, below is an image of a Behavior Tree:
Now let ...
-6
votes
0answers
42 views
Implementing gravity and aerial movement for jumping [duplicate]
What algorithm is generally used for gravity and making the player jump correctly (like moving while jumping, certain jump height ect)? I'm using AABBs to physically represent objects.
1
vote
1answer
209 views
CPU usage, game loop and sleep()
I've read about this topic on numerous discussion sites, but I can't seem to find a clear definitive (up-to-date) answer, and hopefully this will me some more insight:
I've read the excellent game ...
-1
votes
1answer
110 views
Server fixed timestep not running at 30Hz but way way too fast [closed]
I'm trying to make my game's server thread run at a fixed 30Hz but can't figure out how. Basically, before I just had a stupid while(1) { //do everything as fast as you can} which means that for my ...
3
votes
1answer
105 views
Weird stuttering with fixed-timestep, variable-framerate game loop
I've been trying to set up fixed-timestep loop for my game, using the technique from here. I have no need for the interpolation step as I intend to run the logic at or above vsync speed.
Here is a ...
-1
votes
1answer
82 views
Drawing multiple sprites with clear screen for every frame
I googled with best of my skills, but I cannot find any relevant answer to my problem. I'm making a game with an isometric view. I need to draw multiple sprites on the screen and before switching to ...
2
votes
1answer
99 views
Selecting the entities needed for rendering [duplicate]
Currently I'm sorting and looping every entity on my level but I really don't need to. Only a small subset would be on screen.
If I could extract a list of entities from my main list that are on ...
2
votes
2answers
132 views
Lockstep Game Loop
I have an XNA game using a basic lockstep update loop.
The client sends all commands to the server,
and updates only if it has received the next turn's commands from the server.
When does a turn end? ...
10
votes
3answers
506 views
EXTREMELY Confused Over “Constant Game Speed Maximum FPS” Game Loop
I recently read this article on Game Loops: http://www.koonsolo.com/news/dewitters-gameloop/
And the recommended last implementation is confusing me deeply. I don't understand how it works, and it ...
3
votes
3answers
244 views
How precise should timers in update loops be?
What is the suggestion of "enough precision" in a timer for a fixed game update loop?
Currently I'm testing with this code, but it sometimes misses 1-2 updates @ 50hz. While at 30hz it seems to work ...
0
votes
1answer
306 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 ...
3
votes
2answers
247 views
How do I calculate consistent frame timings at 60fps?
I'm writing an HTML canvas game that uses requestAnimationFrame and therefore runs at 60fps, although this is more of a question about failing arithmetic than about JavaScript.
If I measure the time ...
2
votes
1answer
174 views
Online card games: game loop or event based?
The only games I've made have been the game loop variety. I'm just starting to think about building an online poker game where people could meet up in a lobby, etc. Cards seem event based... is the ...
0
votes
0answers
59 views
Using boost function to wrap execution of a boost signals2 signal
I am considering using the boost library to design a simple yet effective callback event notification framework for my game application. The idea is that objects that can raise events would have a ...
1
vote
2answers
139 views
Multiple pipelined game loops
I am considering using the following game engine design pattern, but I am unsure if it's a good idea or not:
Each major task (drawing, physics, logic, networking, disk I/O) will have its own ...
1
vote
1answer
172 views
XNA - moving the 3rd person camera
I'm having following problem:
Can't set my camera to follow object from behind and rotate when I use left/right arrow. I've tried different tutorial and examples but it still doesn't work for me. ...
1
vote
1answer
224 views
SDL2 focus lost = massive gain in FPS
Whenever I lose focus from my game window, I go from ~60FPS to 6000+, then when the window gains focus again, I go back to around 60 frames per second. And yes, this happens every time I run my game, ...
12
votes
2answers
541 views
Design of a turn-based game where actions have side-effects
I am writing a computer version of the game Dominion. It is a turn-based card game where action cards, treasure cards, and victory point cards are accumulated into a player's personal deck. I have the ...
5
votes
2answers
162 views
Simultaneous events in a realtime system, where processing order causes different outcomes
I am working on a realtime dungeon crawler, focusing on a relatively complex and flexible skill system. Somewhat similar to MMORPGs with many compound spells, area effects, buffs/debuffs, ect. I am ...
11
votes
3answers
558 views
Game loop, how to check for conditions once, do something, then not do it again
For example, I have a Game class and it keeps an int that tracks the player's lives. I have a conditional
if ( mLives < 1 ) {
// Do some work.
}
However this condition keeps firing and the ...
0
votes
0answers
75 views
How to monitor the object position while it moves from one place to another?
In my game two objects rotate in opposite directions and at one particular
place, the two objects meet. In that place I want to track the x and y degrees.
If this is possible please share your ideas.
...
0
votes
0answers
168 views
Am I doing this node.js game loop wrong?
I have 2 arrays of JSON objects, actions and game objects.
At any time a user can make a request from the client which can add an action to the actions array.
I have a setInterval(function(){ }, ...
4
votes
2answers
367 views
Server side game loop
Many java games use thread.sleep() to controll fps. Since the server does not display graphics, should the server game loop keep running just calculating delta time? Like this example:
long ...
3
votes
2answers
289 views
Should I redraw every pixel?
For my first game I implemented a tetris clone in javascript. My "canvas" and an HTML <table> with every <td> representing a single block. Instead of having a gameloop redraw every single ...
2
votes
0answers
376 views
HTML5/JS - Choppy Game Loop
I have been experimenting with HTML5/JS, trying to create a simple game when I hit a wall. My choice of game loop is too choppy to be actually of any use in a game.
I'm trying for a fixed time step ...
0
votes
0answers
132 views
Implementation of Race Game Tree [closed]
I build a racing game right in OpenGL using Glut, and I'm a bit lost in all the details. First of all, any suggestions as a road map would be more than great.
So far what I thought is this:
Tree ...
3
votes
2answers
368 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 ...
1
vote
3answers
119 views
Triggering State Changes with Health Counter
I'm developing a game where the player changes states as their health decreases. Below 50, it should trigger animation1. Below 30, it should trigger animation2.
The problem is, I only want to trigger ...
1
vote
1answer
99 views
Help to organize game cycle in Java
I'm pretty new here (as though to a game development).
So here's my question.
I'm trying to organize a really simple game cycle in my public static main() as follows:
Scanner sc = new ...
2
votes
2answers
299 views
How to slow down a sprite that updates every frame?
I am going through a Allegro 5 tutorial which has a game loop.
There is also a variable "active" which determines if a key is being held down. Thus if the left key is being held down active is on and ...
0
votes
2answers
420 views
Networking Client Server Packet logic (How they communicate)
I want to know what is the logic behind server client communication through packets for a real time game.
for example the server sends x packets then the client receives x packets and processes them.. ...
-1
votes
1answer
161 views
2D Game Help In XNA
I'm making a game in XNA called The Adventure Of The Very Hairy Princess Fairy. The game is a "Sidescroller/Platformer" like mario but there is a problem. How do I attach a weapon to the player ...
0
votes
1answer
198 views
How to make this game loop deterministic
I am using the following game loop for my pacman clone:
long prevTime = System.currentTimeMillis();
while (running) {
long curTime = System.currentTimeMillis();
float ...
0
votes
1answer
124 views
Passing elapsed time to the update function from the game loop
I want to pass the time elapsed to the update() method as this would make easy to implement the animations and time related concepts.
Here's my game-loop.
public void gameLoop(){
boolean running ...
1
vote
1answer
394 views
javascript game loop and game update design
There is a main game loop in my program, which calls game update every frame. However, to make better animation and better control, there is a need to implement a function like updateEveryNFrames(n, ...
-5
votes
1answer
158 views
Making A C++ Game [closed]
I'm gonna make a game and I think C++ would be perfect for it.
I think I'm gonna use SDL and OpenGL but I need help with making the code manageable.
These were my ideas:
1. Making A DLL File With ...
2
votes
2answers
515 views
Turn-based Strategy Loop
I'm working on a strategy game. It's turn-based and card-based (think Dominion-style), done in a client, with eventual AI in the works. I've already implemented almost all of the game logic (methods ...
1
vote
1answer
187 views
random spike in delta time
The title pretty much sums it up. I'm using delta time to move my objects and every few seconds the delta time will spike and all the objects will jump forward. Should I just Interpolate the delta ...
0
votes
0answers
115 views
Kinect losing tracked players with Beta2 SDK
I'm creating a game using the Beta2 SDK for Kinect. The issue i am having is that in the middle of gameplay if another person enters the Kinects FOV it stops tracking the player and will not track ...
1
vote
2answers
201 views
what is the best way to use loops to detect events while the main loop is running?
I am making an "game" that has pathfinding using pygame. I am using Astar algo.
I have a main loop which draws the whole map. In the loop I check for events. If user press "enter" or "space", random ...
4
votes
3answers
356 views
Best practices on separating Update and Draw on game loop
I've been working on my first HTML5 prototype and I found a good model that uses the regular Update and Draw loop we see in game dev. My question is, where does one end and the other begins?
The ...