# Bullet and hitting moving target - best practice?

This topic is 661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 !

##### Share on other sites

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.

##### Share on other sites

Thanks. It is indeed game design.

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

##### Share on other sites

moving to GD forum

##### Share on other sites

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.

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633669
• Total Posts
3013255
×