game-development

Software to track several memory errors in old project?

Hello, I am programming a game since 2 years ago. sometimes some memory errors (ie: a function returning junk instead of what it was supposed to return, or a crash that only happen on Linux, and never happen with GDB or Windows) happen seemly at random. That is, I try to fix it, and some months later the same errors return to haunt me. ...

How to have creatures keeping track of each other in a role playing game

I'm programming a role playing game for fun and to learn. I am planning on having an overall game world and in that game world I plan on having "zones" that players and monsters can move around on. Let's just say the "zones" are 20x20 grids and each "tile" on this grid is 64 pixels wide. A player or monster can occupy one 1x1 tile and mo...

OpenGL/Gtkmm game - keyboard moving

Hello, I am programming a game in "OpenGL" and using "Gtkmm" as a window manager. I want to use the keyboard to camera moving (thus, "UP-key" to move forward, "DOWN-key" to move backward, etc...) Some time ago, when I programmed in Java, I used this technique to "move": When the application received for example the "UP-key-press" signal...

Java keyPress/keyRelease issue under Linux/X11

I'm developing a small 2D game engine in Java, after playing around with my demo game in a VirtualBox VM hosting Ubuntu, I found a strange bug that would sometimes cause the game to ignore the fact that a key is pressed. So you're running to the left until you suddenly stop moving. Now under a real Ubuntu I found the cause of the proble...

Have any classic NES games been open-sourced?

I just played a game of RBI Baseball in a browser window. That in and of itself strikes me as simply amazing. When I was young, the NES was a magical box, capable of providing hours of enjoyment to young kids throughout the world. Now, decades later, I'm a programmer. And I can appreciate the programming that went into games that were ...

WPF/silverlight - Is there any simple 2D Game/Physics engine recommend?

I would start to write WPF and Silverlight 2D game, i would to find some game engine library,the only one i found on google is FarseerPhysics ( http://www.codeplex.com/FarseerPhysics) and seem quite good. But is there any other recommend for starter? And one more question is is it any alternate software of expression blend for create S...

Building an FPS in OpenGL: My gun is being clipped agains the frustum

Hi, I'm building a first person shooter using OpenGL, and I'm trying to get a gun model to float in front of the camera. I've ripped a model from Fallout 3 using a resource decompiler (converted to .obj and loaded in). However, this is what it looks like on the screen: Half the gun's triangles are clipped to what appears to be the ...

How to model game object rendering and behavior in modular way?

I'm making a Java shoot em up game for Android phones. I've got 20 odd enemies in the game that each have a few unique behaviors but certain behaviors are reused by most of them. I need to model bullets, explosions, asteroids etc. and other things that all act a bit like enemies too. My current design favors composition over inheritance ...

Collision detection in a tile based enviroment.

I am having problems with my collision detection. basically when I hit a solid tile my character's body is half way in the tile already. here is my code. The properties wY and wX are my game world positioning. Not the stage positioning. dx and dy is the velocity the character is traveling. This first snippet of code is within a game loo...

Turn Based Strategy Game techniques

I want to make a turn base strategy game. I was just curious if anyone had any sources or books that explains the concept and architect of designing a turn based strategy game or any turn based game. thanks! ...

Choosing between static libs and dynamic libs/plugins?

I have been throwing stuff together in a small test game over the past 6 months or so, and right now everything is in the one project. I would like to learn more about creating an "engine" for reusability and I am trying to figure out the best way to do this. Static Libs are obviously a tiny bit faster, as they are compiled in rather th...

2d game : fire at a moving target by predicting intersection of projectile and unit

Okay, this all takes place in a nice and simple 2D world... :) Suppose I have a static object A at position Apos, and a linearly moving object B at Bpos with bVelocity, and an ammo round with velocity Avelocity... How would I find out the angle that A has to shoot, to hit B, taking into account B's linear velocity and the speed of A's ...

Help with vectors

I'm trying to make a game where the bullets can fly in any direction. I would ike to make them vectors with a direction and magnitude to make them go the direction. I'm just not sure how to implement this? Thanks ...

What's the difference between D3DERR_OUTOFVIDEOMEMORY and E_OUTOFMEMORY

Hi, guys, I am developing a tool drawing primitves with DX9 in my XP-32. When create vertex buffer and index buffer, there could be some error of creation failed. Return code could be D3DERR_OUTOFVIDEOMEMORY or E_OUTOFMEMORY. I am not sure what the difference of them. I use VideoMemory tool in DX sample to check the memory, and it r...

PHP based game - giving each user own database

Is it possible to have a webbased PHP/mySQL game, where each user has his own database with data about his/her account. It's a singleplayer management game where each user will need to have their own database. Or atleast, that's the way I see this. Is this the right solution, and will this work in terms of server bandwidth and such. Y...

Is it okay to put game logic in a draw function?

I am making a game, and I have finally finished the gameplay aspect of it, but now it's time for me to create a menu and a high scores screen. I'm not entirely sure how to do it, the game will be in a different state (MENU_STATE, GAMEPLAY_STATE, SCORESCREEN_STATE) and in each state I want to draw different things to the screen, is it ok...

In Flash Actionscript 3.0 how do I create smooth keyboard controls for player movement?

I am a beginner in Flash Actionscript 3.0 programming. I am trying to create smooth keyboard controls for player movement in a game. I'm currently using addEventListener(KeyboardEvent.KEY_DOWN) listening for a keyboard key press and then within the handler function moving a graphic by adding a number to its .x or .y property. This cr...

Rotating a point about another point (2D)

I'm trying to make a card game where the cards fan out. Right now to display it Im using the Allegro API which has a function: al_draw_rotated_bitmap(OBJECT_TO_ROTATE,CENTER_X,CENTER_Y,X ,Y,DEGREES_TO_ROTATE_IN_RADIANS); so with this I can make my fan effect easily. The problem is then knowing which card is under the mouse. To...

I can't figure out why this fps counter is inaccurate.

I'm trying to track frames per second in my game. I don't want the fps to show as an average. I want to see how the frame rate is affected when I push keys and add models etc. So I am using a variable to store the current time and previous time, and when they differ by 1 second, then I update the fps. My problem is that it is showing ...

GetRawInputData vs GetAsyncKeyState()

Well, I'm trying to avoid using the deprecated DirectInput. But I need, at each "frame" or "iteration" of the game to snatch ALL KEY STATES so that I can act accordingly. For example, if the player is down on the VK_RIGHT key then he will move just a smidgen right on that frame. The problem with WM_INPUT messages is they can appear an...