gameloop

Game Loop and GDI over .NET CF

Hi i want to write a game with a main game form and lot of other normal forms. What is the best way to manage update-paint cycle in that case? Should the game form paint loop only should be overriden? or should i do an application.do events() in the main method? Please guide me regarding this. i am new to windows forms world ...

iPhone Gameloop render update from a separate thread

Hi, I'm new to iPhone development. I have a game loop setup as follows. (void)CreateGameTick:(NSTimeInterval) in_time { [NSThread detachNewThreadSelector:@selector(GameTick) toTarget:self withObject:nil]; } My basic game tick/render looks like this (void)GameTick { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; C...

Time-efficient Gameloop in J2ME

I've done a series of questions about J2ME Game developing, and in a recent one, Neil Coffey commented As a side issue-- do you REALLY want to do 100 ticks/second in a J2ME game? As I think sb has mentioned, you should really also sleep to the next desired wake-up point, not a fixed duration each time. For some reason, th...

Allegro 5 game: game loop that runs at constant speed?

What is the best way to code a game loop in Allegro 5 that always runs at the same speed, and that properly separates drawing logic from update logic? Should I use threads or not? Should I make use of the new Allegro event system? ...

Is there a better way to make console games than with Console.Clear() ?

I'm messing around with game loops and going to create some games as practice. Currently I have a steady game loop up where the game is updated as fast as possible and the rendering is updated x times a second (25 currently) The rendinging method is basically a draw + Console.Clear() and at very high updates the display becomes very ji...

Game loop and time tracking

Maybe I'm just an idiot, but I've been trying to implement a game loop all day and it's just not clicking. I've read literally every article I could find on Google, but the problem is that they all use different timing mechanisms, which makes them difficult to apply to my particular situation (some use milliseconds, other use ticks, etc)...

Game loop performance and component approach

I have an idea of organising a game loop. I have some doubts about performance. May be there are better ways of doing things. Consider you have an array of game components. They all are called to do some stuff at every game loop iteration. For example: GameData data; // shared app.registerComponent("AI", ComponentAI(data) ); app.regist...

Lua, game state and game loop

Call main.lua script at each game loop iteration - is it good or bad design? How does it affect on the performance (relatively)? Maintain game state from a. C++ host-program or b. from Lua scripts or c. from both and synchronise them? (Previous question on the topic: http://stackoverflow.com/questions/2674462/lua-and-c-separation-of-d...

DirectX: Game loop order, draw first and then handle input?

I was just reading through the DirectX documentation and encountered something interesting in the page for IDirect3DDevice9::BeginScene : To enable maximal parallelism between the CPU and the graphics accelerator, it is advantageous to call IDirect3DDevice9::EndScene as far ahead of calling present as possible. I've been ac...

Help with game development. Render loop?

Hello, I'm working on a simple game, this is my first game project. Most of the samples I find have a Render Loop where all the game logic is made too and I just don't like this. Let's say I have a ball with X=0, and a wall in X=10 and in a slow machine, the first loop places the ball in X=7 and in a second loop, it places the ball in X...

Pausing a Thread - Activity pause timeout for HistoryRecord

I'm trying to write a game engine in Android, but I don't have much familiarity with threads. My thread has an attribute, mSurfaceHolder, which holds the surface that I'll be drawing to. The run() method for my thread looks like this: public void run() { // We're running now setState(STATE_RUNNING); // Keep looping while t...

How do I get a consistent speed on new as well as old iPhones?

I'm in the process of creating a 2D game in OpenGL ES for the iPhone. I'm calling my game loop using NSTimer at an interval of 0.002 (60 fps) with repeats set to 'NO' (I'm running the NSTimer again from within the function as recommended): -(void)gameLoop:(id)sender { double currTime=(double)CACurrentMediaTime(); m_FPS_framesTh...

Is this a good implementation of a FPS independant game loop?

I currently have something close to the following implementation of a FPS independent game loop for physics based games. It works very well on just about every computer I have tested it on, keeping the game speed consistent when frame rate drops. However I am going to be porting to embedded devices which will likely struggle harder wit...