Slow progress
Oh well.. spent the evening after work on the phone with/chatting online to my gf, rather than working on my entry. Still, thought I ought to do something, so I did a bit of code tidying (more object encapsulation, fewer globals) and finished the menu system I started yesterday. Note that this just means menus render, and you can switch between/select items; the only item that is currently functional is "quit".
Never done a graphical menu before, so this is all a learning experience; my previous games (well, the finished ones) have always used GUI libraries of some sort, e.g. wxWidgets or Delphi forms, and used buttons, text boxes etc. directly.
I've had plenty of ideas in the past regarding what main loops should look like, how a graphical menu system could work, text rendering in OpenGL and so on and so forth, but most of them have either stayed ideas, or been implemented entirely separately in little "proof of concept" apps that never get turned into finished games. Basically, this week is serving as motivation for me to finally finish something, rather than spend ages perfecting one small part of a system, only to get bored before integrating it back into any kind of whole.
The only thing I'm really unsure I'll be able to get working well in the remaining time is collision detection, which will unfortunately be fairly essential. I hate collision detection with 2D rectangles, never mind fast moving 3D objects. It's just something I've never put in the necessary time to get the hang of, because it really doesn't interest me from a technical standpoint. If you died because your bullets passed straight through the thing you were trying to shoot out of the way, or you didn't die after flying straight into something, it'd be a bit of a disaster.
Any good references on how you do collision detection when objects are potentially fast enough to pass through each other between frames?
Oh, and a screenshot of the menu is here, if you're interested.
Edit: Fixed screenshot link
Add comment
Ug, collision detection is a pain. Many solutions to problems, and lots of math too :) The two standard solutions for fast moving objects are:
- Divided time steps - you take the new position and the old position and continually divide and check for collision several times between frames. This way you can have a better chance of seeing if it hit anything. Usually you do some sort of calculation for how many times to divide based on how fast its moving and some threshold.
- Extrapolation - You take the object mesh at the old position, the object mesh at the new position and create a NEW mesh that surrounds both meshes. Kind of hard to describe in words. Just imagine a 2d square. At position A it's to the left of a wall, at position B it's to the right. Instead of checking either of those squares for collision, you create a rectangle who's left two points are the left two points of position A; and whose right two points are the right two points of position B. This will catch ANYTHING in the path of movement.
Good luck. Relying on collision detection for a short time period contest is a noble effort. I learned my lesson about this at the last contest... That's why this time I decided to rely on AI and pathfinding instead LOL!