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.
-2
votes
1answer
34 views
how to restart in java japplet?
how to restart a game? problem with my code is that when it restarts it double the enemy. so there are 10 enemies and lets say player dies than user restart and now there are 20 enemies and so on.....
...
0
votes
2answers
158 views
Why are my game ticks longer than expected? [closed]
I was working on my game, adding stuff to it, when I noticed my ticks were in the low 50's when I had set it to do a constant 60. This is my run method.
public void run() {
init();
long ...
1
vote
1answer
66 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
215 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
435 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
76 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
55 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
110 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
197 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
182 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
83 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
153 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 ...
1
vote
1answer
219 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
114 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
110 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
90 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
108 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
141 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
513 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
246 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
334 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
252 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
181 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
62 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
146 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
190 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
227 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
556 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
165 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
562 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 ...