Advertisement

RTS Tower AI

Started by June 03, 2013 12:50 PM
0 comments, last by Ashaman73 11 years, 5 months ago

Hey,

A few months ago we discussed on this forum the way I intended to calibrate game levels (i.e. balance between enemies and defender towers) and it was a great help.

I tried to find article in the forum for Tower targeting AI did not find any so, I decided to open a thread for tower AI target prioritisation and let you guys know my take on it which myth help you or give you ideas on your AI development.

I’m currently in the final stage of my RTS Tower game development and I have tested the towers AI under different scenarios.

- Single target in range of single tower. (just shoot the sucker dry.png )

- Single target in range of multiple towers.

- Multiple targets in range of single tower.

- Multiple targets in range of multiple towers.

- Multiple targets of various threat level in range of single tower.

- Multiple targets of various threat level in range of multiple towers.

Here is the approach I came up with for my game.

For all target(s) in range of a tower

Check if target is already targeted by other tower(s) prevent overkill.

Check for target nearest to range limit for maximum damage.

Check for threat level of target which elevates potential for selection.

Check tower power compared to remaining life of target lower target potential for selection.

Hope it help biggrin.png

G

For all target(s) in range of a tower



Check if target is already targeted by other tower(s) prevent overkill.

Check for target nearest to range limit for maximum damage.

Check for threat level of target which elevates potential for selection.

Check tower power compared to remaining life of target lower target potential for selection.

At top of this I often use a weighted rating system to always choose the hightest rated object. Taking your example I would choose the following normalized rating values:


1. Check if target is already targeted by other tower(s) prevent overkill.
=> v1 = 1.0 / (1.0 + #targetByOtherTowers)

2. Check for target nearest to range limit for maximum damage.
=> v2 = max(0.0, 1.0 - distance/maxDistance )

3. Check for threat level of target which elevates potential for selection.
=> v3 = normalized thread level (0...1)

4. Check tower power compared to remaining life of target lower target potential for selection.
=> v4 = ...

Then choose a normalized weight (sums up to 1.0), e.g. w = {0.25,0.25,0.25,0.25} and calculate the rating value by using the dot-product:

rating = dot(v,w) = v1*w1+...+v4*w4

Using different w-vectors will help you to switch the behavior in a fast and easy way.

This topic is closed to new replies.

Advertisement