Advertisement

Bullet and hitting moving target - best practice?

Started by February 18, 2017 05:23 AM
3 comments, last by frob 7 years, 9 months ago

I am creating a game that player place tower to defend a horde of enemies (refuse to use the Tower-Defend keyword, because it really is not).

When thinking about the bullet, there are several approach and I wonder which one is the most suitable

Generally, we know that (static) tower fire a bullet to hit a (moving) target.

A) Aim dumbly + actual bullet physics - Tower aim at the target position at time t=0 and fire the bullet.

Depending on the flight time of the bullet, and the speed of the target, the bullet could miss the moving target. By the time it reach that position, the target has moved

B) Aim with lead + actual bullet physics - Same as A, but the AI try to 'guess' the future location of the target

If like simple TD genre, the target mostly move in linear fashion, so this could works. What if the target movement is more advance (accelerating, jumping around).

C) Homing bullet ! - Bullet that somehow "home" on the target, hence not moving in straight line

This might look really silly

D) Mark of death - Once the bullet fly for some distance or reach close enough to the target. The target dies regardless of whether the bullet touch it or not

This might also look silly.

I think of course if we set the bullet speed to be very very high, all above is irrelevant. What are the best practice out there?

Appreciate your feedback !

This is not programming anymore, it's game design.

The best practice here is "do what fits best in your game". If you have a medieval game, a homing bullet breaks the medieval setting. If you have a year 22K game, anything else than bullets that can turn around corners breaks the setting.

In a tower defense game, I can see all your ideas as feasible. Just consider the idea of upgrading the towers by improving bullet smartness. In reality, option D is solved by having the bullet send out lots of smaller bullets in all directions, ie exploding shells.

Advertisement

Thanks. It is indeed game design.

I think I will stick back to B for my game prototype.

moving to GD forum

-- Tom Sloper -- sloperama.com

These are fairly common in games, actually. Using Mario Kart and Plants Vs Zombies as two references:

Straight Fire. MK's green shell. PvZ's Pea Shooter, and most plants. Fire and they shoot straight.

Correcting Aim. MK's red shell. PvZ's Cattail. Fire and they try to pick out your target, curving a little.

Remote Targeting. MK's blue shell and Bullet. PvZ Homing Thistle and Cob Cannon. They seek and destroy so you don't have to.

This topic is closed to new replies.

Advertisement