http://bigdicegames.com/BZone/bzone.html
I did some work last night, laying the foundations of making the tanks know better than to drive through stuff. I created an object registry singleton object, which will hold tanks and obstacles, and will be useful for querying to see if the new location is actually obstructed.
I'll also want the AI to be smart about being able to drive around obstacles and tanks. I'm planning to do a simple ray-circle intersection and steer tangent to any intersecting circles. Should be good enough for sparse environments.
I realized that there's a lot of work there to do, so I switched gears to what was then low-hanging fruit: making the AI tanks react to the player. With the object registry, tanks can ask what other things are nearby, and if any of them are player tanks. (I still like the idea of a buddy tank, so player-allied tanks are a thing I'm thinking of, even if the player isn't actually in control of the tank).
I added two behaviors - pursuit and engage. At a certain radius (50 feet, currently), the tanks will detect the player tank. (Bad radar in the enemy tanks, I guess.) They'll turn toward the player and then drive until they get to the engagement range. If they're still turned toward the player, and they haven't shot in the last 3 seconds, they'll shoot.
Simple enough, but enough to be challenging. You can't race in to a bunch of tanks now without repercussion; evading one shot is possible, evading several is hard.
With win and lose conditions, I consider this a complete game. There's quite a lot left to do:
- sounds - sound effects make a big difference.
- collision - tanks should collide with each other, tanks should collide with static objects. Projectiles should collide with static objects.
- pathfinding - enemy tanks should be able to drive around static objects.
- HUD - the "heads up display", containing a radar map of nearby enemies and a display of tank damage
- positional damage - maybe it isn't one shot, one kill, maybe you can take a few hits to a side before dying.
- game modes - win/loss, title screen, mission overview
- buddy tank - stay on target!
- better model lighting - at some point, I'll calculate the normals at each vertex and use that for coloring. The tanks will probably look better.
No comments:
Post a Comment