Andy Korth
Ship Collisions
Scott and I have spent much brainpower on the matter of deciding what elements of our universe collide with what. Our primary question is: Should ships collide with other ships? There are both gameplay and technical considerations here.
First, we’ll start with some background. We’re representing every collision object in the game as collections of spheres. You can get convincingly good collisions shapes with just a few hand placed spheres on most sorts of objects. Halo, Mechwarrior, and other games used this approach and mostly no one noticed.
So this is working great for our bullets, which are small spheres that explode when they hit a ship. These are fast swept collisions, so bullets never pass through objects. The bullet explosion and smoke more than hides any inaccuracy.
Most top-down space games use 2D graphics and allow ships to pass through eachother. It’s probably best to break down the pros and cons of each approach:
Ship to ship collisions:
Pros
- No clipping! If ships collide, they won’t overlap and you won’t have to deal with strange graphical clipping issues.
- No flying inside huge stuff. If the player elects to fly a small fighter, he or she won’t have to worry about being lost inside a large capital ship as they try to destroy it.
Cons
- Possibly difficult strafing and attacking gameplay? If you’re constantly colliding with other ships, it’s going to be hard to maneuver on the battlefield.. Maybe. It’s hard to tell what the end result will be.
- Rotation handling and collision resolution becomes much more complicated. This is probably the biggest disadvantage. Imagine a player-created ship that is much longer than it is wide. If it moves along side another ship and rotates, what happens? Ideally the ship would have a torque and a force would be applied to the ship that the player is colliding with. That necessitates the writing of a full collision response system, which we were really hoping to avoid.
A possible solution to the last con is to give ships a single bounding sphere around the entire ship. Use this sphere when colliding against other ships or asteroids. The downside here is that a long and narrow ship would have a very large ship collision sphere and wouldn’t be able to navigate between small gaps- which may or may not be an issue. Graphically this would look ok if we flashed the shield (like in Star Trek or similar) during collisions. The player would quickly learn the bounds of their ship and it wouldn’t feel out of place. Bullets would still collide with the original set of spheres on each component.
Ships pass through other ships:
Pros
- It’s easy to implement!
- No accidentally flying into stuff!
Cons
- Graphical clipping may occur. Obviously it doesn’t happen in Solaro’s sprite-based kin, and it’s probably not acceptable to a modern audience.
- Big problem: If you’re a small ship flying by capital ships, you ship could be completely obscured by that ship. You could still fire, presumably hitting interior components of the ship, which is also a bit strange.
So, brainstorming on solutions would be greatly appreciated. Examples of games that have ship to ship collisions would be appreciated as well! Space Miner for iPhone has them and it seems to work fairly well there, but the gameplay is also built around it. Ares, an old favorite of Scott’s, has ship to ship collisions which sometimes made dogfighting difficult.