Most Popular

1500 questions
86
votes
3 answers

How do I create 2D water with dynamic waves?

New Super Mario Bros has really cool 2D water that I'd like to learn how to create. Here's a video showing it. An illustrative part: Things hitting the water create waves. There are also constant "background" waves. You can get a good look at the…
Berry
  • 1,269
  • 2
  • 11
  • 15
86
votes
5 answers

What is the point of update independent rendering in a game loop?

There are dozens of articles, books and discussions out there on game loops. However, I pretty often come across something like this: while(running) { processInput(); while(isTimeForUpdate) { update(); } render(); } What…
Sam
  • 833
  • 1
  • 7
  • 6
84
votes
3 answers

Should I worry about Youtube Let's Plays when I'm creating a story-heavy game?

A few years ago, I watched a full playthrough of the first three Phoenix Wright games on Youtube. I enjoyed the story and characters a lot, hence why I pretty much binge-watched what is a series of very story-heavy games. I know it sounds stupid,…
user97936
84
votes
15 answers

How are bullets simulated in video games?

I have been playing games like MW2 recently and, as a programmer, I tend to ask myself how do they make the game so immersive. For example, how to they simulate bullet speed. When an NPC fires a bullet from his gun, does the bullet really travel…
mahen23
  • 823
  • 1
  • 7
  • 6
83
votes
6 answers

What is the future of XNA in Windows 8 or how will managed games be developed in Windows 8?

I know this is a potential dupe of this question, but the last answer there was 18 months ago and a lot has happened since. There seems to be some uncertainty about XNA in Windows 8. Specifically, Windows 8 by default uses the Metro interface, which…
Ken
  • 6,116
  • 3
  • 35
  • 51
82
votes
17 answers

C++ low-level optimization tips

Assuming you already have the best-choice algorithm, what low-level solutions can you offer for squeezing the last few drops of sweet sweet frame rate out of C++ code? It goes without saying that these tips only apply to that critical code section…
tenpn
  • 5,524
  • 3
  • 32
  • 45
82
votes
10 answers

What are the challenges and benefits of writing games with a functional language?

While I know that functional languages aren't the most commonly used for game writing, there are a lot of benefits associate with them that seem like they would be interesting in any programming context. Especially the ease of parallelization I…
McMuttons
  • 161
  • 1
  • 3
  • 6
82
votes
6 answers

How does a collision engine work?

How exactly does a collision engine work? This is an extremely broad question. What code keeps things bouncing against each other, what code makes the player walk into a wall instead of walk through the wall? How does the code constantly refresh the…
JXPheonix
  • 923
  • 2
  • 7
  • 7
82
votes
9 answers

How does one prevent homing missiles from orbiting their targets?

I am developing a 2D space game with no friction, and I am finding it very easy to make a homing missile orbit its target. I am curious about anti-orbiting strategies. A simple example is a homing missile that simply accelerates directly toward its…
John McDonald
  • 6,746
  • 2
  • 31
  • 45
81
votes
5 answers

Implementing a 2D destructible landscape (like Worms)

What steps would be involved in constructing a destructible 2D landscape, like in Worms? Ideally, What are some ways that this process could be made efficient as possible?
William Casarin
  • 921
  • 1
  • 7
  • 6
80
votes
13 answers

How do you handle aspect ratio differences with Unity 2D?

I've gotten a lot of answers to this question, but they are all generic and generally not very useful. None of the tutorials talk about aspect ratio and dealing with mobile devices and there are a zillion ways to do it, all seem to have gotcha's…
Michael
  • 901
  • 1
  • 7
  • 4
80
votes
5 answers

How does Dwarf Fortress keep track of so many entities without losing performance?

In Dwarf Fortress you can have hundreds of Dwarves, animals, goblins, etc in game at any one time, each with their own complex AI and pathfinding routines. My question is how does this not produce noticeable slowdown? Does each Dwarf run in its own…
Rory Harvey
  • 1,422
  • 2
  • 14
  • 16
80
votes
11 answers

Is UDP still better than TCP for data-heavy realtime games?

I know that UDP is usually recommended for real-time multiplayer games with high data usage. Most articles are serval years old, and since ~80% of all data transmitted on the internet is TCP, a lot of optimization must have been done for TCP. This…
KaareZ
  • 1,943
  • 1
  • 19
  • 30
80
votes
30 answers

How can I discourage camping while still supporting a "sniper" style of play?

I am trying to add features into a third person shooter that suit a sniper style of play, in addition to the current rush/deathmatch style it was designed for. The current gameplay is similar in style to Gears of War and Battlefield, perhaps similar…
FrontEnd
  • 1,697
  • 1
  • 18
  • 23
79
votes
5 answers

Procedural... house with rooms generator

I've been looking at some algorithms and articles about procedurally generating a dungeon. The problem is, I'm trying to generate a house with rooms, and they don't seem to fit my requirements. For one, dungeons have corridors, where houses have…
pek
  • 2,787
  • 1
  • 25
  • 31