Jump to content
  • Advertisement
Sign in to follow this  
GiroKa

RTS Tower AI

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Edited by GiroKa

Share this post


Link to post
Share on other sites
Advertisement

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.

Edited by Ashaman73

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!