Jump to content

  • Log In with Google      Sign In   
  • Create Account


RTS Tower AI


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 GiroKa   GDNet+   -  Reputation: 395

Like
0Likes
Like

Posted 03 June 2013 - 06:50 AM

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, 12 June 2013 - 07:41 AM.


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6859

Like
0Likes
Like

Posted 05 June 2013 - 05:08 AM

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, 05 June 2013 - 05:10 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS