game-development

How do I keep my world data in synch in a multi-threaded game engine?

So I'm trying to create a simple multi-threaded game engine for the game I want to write. So far, everything has worked without any problems, I even know what steps I have to take to finish it. There is only one thing I don't know (well, technically, I know a solution for it, but I'm hoping there is something more elegant and faster): B...

How do I test for collision of two moving 2d oriented bounding boxes?

The OBBs have a position(x,y), a velocity(x,y) and an orientation(Matrix). Given periodic updates, the OBBs must collide with each other, returning the fraction of the move that was deemed successful. I have looked at the Polygon test on the GPWiki - http://gpwiki.org/index.php/Polygon_Collision - but it does not account for moving obj...

Best way to organize entities in a game?

Let's say I'm creating an OpenGL game in C++ that will have many objects created (enemies, player characters, items, etc.). I'm wondering the best way to organize these since they will be created and destroyed real-time based on time, player position/actions etc. Here's what I've thought of so far: I can have a global array to store po...

Representing the board in a boardgame

I'm trying to write a nice representation of a boardgame's board and the movement of players around it. The board is a grid of tiles, players can move up, down, left or right. Several sets of contiguous tiles are grouped together into named regions. There are walls which block movement between some tiles. That's basically it. I thin...

XNA how to store and draw a 2d map?

Hello, I have a problem and I am not sure how to approach the solution. I need to create a 2D map editor for my XNA app., with a certain number of tiles. Say a map will be 50x100 tiles. I am not sure what data structure to use for the map, tiles and how to store it on the hard-drive for later loading. What I am thinking now is this. I ...

Efficiency/speed for trigonometric functions

In a game I'm making, I've got two points, pt1 and pt2, and I want to work out the angle between them. I've already worked out the distance, in an earlier calculation. The obvious way would be to arctan the horizontal distance over the vertical distance (tan(theta) = opp/adj). I'm wondering though, as I've already calculated the distanc...

How do I obtain the latency between server and client in C#

I'm working on a C# Server application for a game engine I'm writing in ActionScript 3. I'm using an authoritative server model as to prevent cheating and ensure fair game. So far, everything works well: When the client begins moving, it tells the server and starts rendering locally; the server, then, tells everyone else that client X ...

How do I cap my framerate at 60 fps in Java?

I am writting a simple game, and I want to cap my framerate at 60 fps without making the loop eat my cpu. How would I do this? ...

Online Puzzles and games for learning boolean algebra

I'm looking for some online game, where it tests our ability in boolean algebra. My cousin is young and has just learnt using logic gates. Is there any thing interesting available out there for him to practice online? ...

RTS Vehicle grid movement

Hello, I don't know how to implement good 2D grid movement. It is easy to implement movement for units like soldiers, but I don't know how to turn vehicle in elegant way. The movement should be like in C&C Red Alert (not 3, because it's 3D, I want just 2D). EDIT: I don't ask any code, neither links to pathfinding algorithms, because the...

Where do I put my custom Levels folder in XNA game?

I am quite lost with where and how to store the *.txt level files in my game. What I want in my game is the availability of a few "prebaked" levels that come installed with the game but also the ability for users to create their OWN levels. So what I did is created a new directory inside visual studio in the "Content" called levels, an...

How to write a simple .txt content processor in XNA?

I don't really understand how Content importer/processor works in XNA. I need to read a text file (Content/levels/level1.txt) of the form: x x x x x x where x's are just integers, into an int[,] array. Any tips on writting a SIMPLE .txt importer??? By searching google/msdn I only found .x/.fbx file importer examples. And they seem t...

Keeping address in C++ hacking game code?

I have this code that edits addresses in a game to get unlimited ammo and what not, and I found out that the addresses are different for every computer, sometimes every time you restart the game, so how would I manage making this work still even though they change. ...

looking to hire a XNA developer, where should I look?

I am developing a game in which the logic is written but the visuals are not. Although the graphics are drawn, I need a way to get this graphics onto the screen to be manipulated, as well as a menu system. No one in my small three man dev team has experience with XNA and thus I am worried we will not make our intended deadline. Is the...

Getting position of PhysX wheel

I'm using the NxWheelShape to simulate wheels on my car. When I render the wheel model, I use shape->getGlobalPose() to get a 4x4 matrix and render the wheel there. However this gives me the position of the shape, not where the casted ray hits other geomnetry, so even if the car behaves properly, the wheels are stationary (don't even rot...

Loading game objects from their definition

I want to load game objects from definition files (XMLs) and then just create them in game with prepared properties (like weapon, textures, max. speed, range of sight etc.). I thought of IClonable interface but it seems very weird. Also I need to differentiate between Units (soldiers, vehicles maybe aircrafts) and Buildings. ...

Bulls & Cows C# Implementation (Mastermind Variation)

Bulls & Cows is a game for two players in which each one has a secret number with 4 non-repeating digits, and each one tries to guess the other number. For instance, let´s say my secret number is 1576. If my opponent says the number 1234, i would answer: 1F, because the digit 1 is in my secret number and in the same position. If my opp...

How could simply calling Pitch() and Yaw() cause the camera to eventually Roll()?

I'm coding a basic OpenGL game and I've got some code that handles the mouse in terms of moving the camera. I'm using the following method: int windowWidth = 640; int windowHeight = 480; int oldMouseX = -1; int oldMouseY = -1; void mousePassiveHandler(int x, int y) { int snapThreshold = 50; if (oldMouseX != -1 && oldMouseY !...

Efficient way to synchronise entityManagers in mainly asynchronous Seam app?

I'm having some fun writing a strategy/fantasy game with Seam. Unlike a typical Seam application there is a lot of asynchronous activity; scheduled methods update player data, both offline and online, and using Icefaces' Ajax push the players views are updated with relevant information, like available gold, stone, chat messages etc. My...

cocos2d: LabelAtlas text alignment?

Is there a way in cocos2d 0.7.1 to specify the text alignment in a LabelAtlas? I'm using a LabelAtlas for a score (displayed in the upper right corner) but when the score goes above 10, the second digit is cut off. I can implement code to detect that and move the LabelAtlas, but is there a way to have cocos2d do it for me? Thanks. ...