game-development

How to sort an object std::vector by its float value

I have a C++ std::vector denoted as: std::vector<GameObject*> vectorToSort; Each object in vectorToSort contains a float parameter which is returned by calling "DistanceFromCamera()": vectorToSort.at(position)->DistanceFromCamera(); I wish to sort the vector by this float parameter however std::sort does not appear to be able to do...

Tetris and pretty graphics

Say you're building a Tetris game. As any proper programmer, you have your view logic on one side, and your business logic on the other side; probably a full-on MVC going on. When the model sends its update(), the view redraws itself, as expected. But then... if you wanted to add, say, an animation to vanish a line, how would you imple...

Drawing Isometric game worlds

What is the correct way to draw isometric tiles in a 2D game? I've read references (such as this one) that suggest the tiles be rendered in a way that will zig-zag each column in the 2D array representation of the map. I imagine that they should be drawn more in a diamond fashion, where what gets drawn to the screen relates more closely...

How to learn game development?

I've been a web programmer for a while and I can also program in Java. I have an idea for a small, multiplayer RPG game that I want to work on. It will be played through a java applet in the user's web browser. I have written the design document and specifications of the gameplay. What I'd like to know now is how I can develop the game?...

How to subdivide a 2d game world for better collision detection

I'm developing a game which features a sizeable square 2d playing area. The gaming area is tileless with bounded sides (no wrapping around). I am trying to figure out how I can best divide up this world to increase the performance of collision detection. Rather than checking each entity for collision with all other entities I want to onl...

Obfuscation or hiding of server to client state updates

I'm not actually writing this software myself, but it occurred to me that I have no idea how to solve the problem. As the best way to explain the problem, I'll describe a specific scenario from a hypothetical multi-player first-person shooter game... Player A is hiding in some bushes facing west Player B is sneaking up on player A from...

What framework should I use for a game in Silverlight and on the client?

I made a couple simple games in Silverlight. I'm considering making a much deeper game for Windows. It would have a feature limited version available in Silverlight for use in the browser. What would you recommend I use for the client application (not in a browser or Silverlight)? If any additional information is required, I'll try...

Best Game network programming articles and books

What are good resources for the latest in Game network programming. I'm looking for something that's not the traditional business software network programming, talking about RPC and clients making calls to the server. I'm looking for techniques and articles on the latest in Game simulation network programming. I'm looking for techniques...

Should games rely on frame rate only?

Hello, I would like your suggestion about this problem... To make it simple, I'll consider only the x axis. Image an object in position 10, and its width also 10 units, which is moving forward 100 units per second, and due to low frame, on each update it should move 80 units. After the first update is called, its position is now 90 an...

How to slow down or stop key presses in XNA

Hi, I've begun writing a game using XNA Framework and have hit some simple problem I do not know how to solve correctly. I'm displaying a menu using Texture2D and using the keyboard (or gamepad) I change the menu item that is selected. My problem is that the current function used to toggle between menu items is way too fast. I might cl...

Using Silverlight 2 for short audio caching

I'm attempting to use a large number of short sound samples in a game I'm creating in Silverlight 2. The samples are less than 2 seconds long. I would prefer to load all the audio samples onto the canvas during the initualization. I have been adding the media element to the canvas and a generic list to manage it. So far, it appears to...

Can you use a Card Layout on Game Panels?

I set up a Card Layout at main Game Panel, in order to bring up some additional menus at certain times during the game. When I run the build, the panels just flash back and forth between each other continually. Is this because both of them are continually refreshing? and is the card layout feasible in the main Game Panel, Is there a ...

Need for predictable random generator

I'm a web-game developer and I got a problem with random numbers. Let's say that a player has 20% chance to get a critical hit with his sword. That means, 1 out of 5 hits should be critical. The problem is I got very bad real life results -- sometimes players get 3 crits in 5 hits, sometimes none in 15 hits. Battles are rather short (3-1...

Nice way to do this in modern OO C-like language?

I have Tiles which represent the tiles in a game's 2-dimensional world. The tiles can have walls on any number of their 4 sides. I have something like this at the moment: interface Tile { boolean isWallAtTop(); boolean isWallAtRight(); boolean isWallAtLeft(); boolean isWallAtBottom(); } Somewhere else I also have 16 ...

Ideas for designing a Secure, "Low Cost" method for confirming client-side game results

This is more a system design question/challenge, than a coding question. Basically, I'm thinking of throwing together a Bejeweled-esque game on Facebook using just HTML, CSS, and javascript. This is mostly out of a desire to learn all the little caveats of FBJS via a non-trivial project. So here's the deal. When developing for Facebo...

Iphone Game Development

What are people using mostly to build iPhone games with? I'm learning iPhone programming. Currently I'm watching all the stanford vidcast, doing the assigments and going through the beginning iphone development apress book. I want to get into building games and want to know if developers are buidling everything with opengl es or are they...

Moving sprites between tiles in an Isometric world

I'm looking for information on how to move (and animate) 2D sprites across an isometric game world, but have their movement animated smoothly as the travel from tile to tile, as opposed to having them jump from the confines of one tile, to the confines of the next. An example of this would be in the Transport Tycoon Game, where the trai...

IPhone mp3 playback problem

Hello everyone. I'm writing a game for iphone, and without background music it runs smoothly at 30 fps. But if I add music (using AudioQueues or AVAudioPlayer, both give similar effect), framerate periodically drops to 10 (about once per second), and then returns to 30. Music is mp3@128kps, 44kHz. It degrades performance not constantly, ...

Recommended reading for Game Development

I'm familiar with some of the recommended programming books, such as Code Complete and The Pragmatic Programmer, but I was wondering if there were books with similar reputation that are focused on Game Development. ...

Must-Write programs for self-taught enthusiasts (game programming)

I finally found a reasonable thing to do during my short summer vacation. I got a job as a programmer on a start-up company (who shall remain anonymous), and I will be starting around the first of June. Now, the company will soon have a senior programmer that I will at some point have to impress. The company will be using Unity as their...