Unit enters range callback

Unit enters range callback

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
SnS CEO
Posts: 10
Joined: 20 Apr 2010, 05:14

Unit enters range callback

Post by SnS CEO »

Hi, I was wondering if the AI interface (specifically the Java interface), had a callback for when an enemy unit enters a given units range (either reclaim or attack). I know this event happens internally (for instance, when an enemy enters the range of a LLT, it fires on the enemy), but it would be cool to program an AI where builders automatically reclaim nearby enemies. Specifically, this would make sense for nano towers, since you would want them to reclaim nearby enemies. Any idea how to achieve this behavior?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Unit enters range callback

Post by aegis »

there's an widget for that, maybe see how it does it (was it smart nanos?)
SnS CEO
Posts: 10
Joined: 20 Apr 2010, 05:14

Re: Unit enters range callback

Post by SnS CEO »

In case anyone else wants to know: the widget "Smart Nanos" does this and can be found here: http://www.springfiles.com/show_file.php?id=1011
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Unit enters range callback

Post by slogic »

In each Update() call it scans units in a range. It does not use any specific event (if would exist).
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Unit enters range callback

Post by hoijui »

In the Spring Engine and Skirmish AI world:
Callback: AI ----requests-something-from----> Engine
Event: Engine ----sends-to----> AI
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Unit enters range callback

Post by AF »

There were events for enemy unit entered radar and entered LOS in the legacy AI interface, there should be events in the other APIs too
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Unit enters range callback

Post by slogic »

But there are no events for unit entered attack or reclaim range.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Unit enters range callback

Post by AF »

If an enemy unit is not in LOS then the information should not be available anyway, thus the events would be pointless, as it would require a set of calculations be done. The whole point of the events is to avoid these calculations, but if they're done anyway then that defeats the point
Post Reply

Return to “AI”