• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Unsolved] Creating a Bully-AI system

Status
Not open for further replies.
Level 1
Joined
Nov 28, 2016
Messages
1
I have been working on a certain project for some time now. The primary problem is AI.

Background---
ever played kodo tag in wc3? ever wonder why it was never ported over to sc2? well, it's because the AI works differently, and the 'bugs' exploited in that game, in order to create the experience we remember as kodo tag... those bugs don't exist in starcraft. I'm trying to make a working system that re-creates kodo tag, in its original form.

The Goal---
I want to have 3 unit groups:
  1. computer controlled units
  2. player controlled units (does not include structures)
  3. player's primary unit (subset of group 2)
units from group 1 are spawned using triggers.

when a unit from group 1 spawns (lets call this the 'attacker'), I need it to select a unit from group 2 (the 'target')move to that unit, and attack it. If the attacker encounters other units from group 2, before it reaches its target, it is allowed to temporarily acquire/chase/attack those units, but should return to attacking its original target shortly after.

If the attacker cannot reach its target , due to having its path blocked by structures, it will walk around those structures, rather than attacking them. If there is no way to walk around, the attacker will attack any structures which block its way, until a path is cleared--then it will return to pursuing its target.


Problems---
so far, I can :
  • spawn attackers (triggers)
  • assign targets to attackers (triggers: when unit is spawned, or becomes idle, issue order)
  • have attackers ignore structures, but still acquire other units along their path (this is currently working, but is not 100%; data editor, variation of the 'harmless' buff, which i place on structures)
So far I can NOT :
  • cause the kodos to attack structures which block their path.
Past Attempts:
I have tried several fixes, all of which have been trigger based.
  1. the origional 'issue order' trigger{[issue order(attack) targeting point(position of unit) ]} is for most purposes very effective. The problem was that if the target is on a ledge, and all ramps to that ledge are blocked, the attackers simply move as close as they can to the target (congregating at the ledge) and do not seek out ramps leading onto the ledge.
  2. using the 'AI pathing cost' function in triggers to check when pathing to a particular unit is impossible (function returns -1 if no path is found). this can work...but causes 2 problems.
    1. when a single player boxes their units in with structures, all attackers begin attacking indiscriminately. (I have found a fix for this)
    2. this seems to cause many attackers to 'go idle'. they will stand in place, and fidget, but little else. inclusion of a 'when unit becomes idle' trigger does not seem to help in any way. (I have such a trigger, so that when a target is killed, a new target is chosen--it works very well, but when it includes 'AI pathing cost' it begins to fail. This 'when unit becomes idle' trigger also goes off when the attacker loses sight of a target, becomes rooted or stunned, etc.)[very serious problem]
  3. There have been other attempts made, including data-based attempts which would acquire new targets for attackers, etc, but only the two above have been highly profitable.

I have looked over the AI editor, and it seems to be based primarily on timed events and attack waves. unless each attacker forms its own attack wave, I do not know how this could be made very useful. even then I am very uncertain of it.
------------------------------

If you have experience in AI based, Trigger based, or data based unit control, I would greatly appreciate any input you can offer.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
What does any of this have to do with bullies? You should not need bullies at all for such a map.

A bully is a unit that is explicitly positioned to "bully" players who come near, like a bully waiting at a corner to steal pocket money from kids. Bullies will return to their pre-placed positions if lead too far away and the AI can be made to replace bullies that are lost, possibly limited to a certain number of times. Most commonly seen in coop and campaign where base defence units are often specified as bullies.

Why not enable AI for the player and order the chaser units to suicide? A unit ordered to suicide will hunt down every enemy on the map with near map hack like ability and complete disregard for own life. Seen in many campaign missions when base bullies are dismissed for various reasons.

AI can only be enabled for players which are explicitly set to a computer controller. It cannot be enabled for open slots, empty slots or players which were once humans.

If further intelligence is required then one can add the chaser to an Attack Wave. AI will keep all units in an attack waves together. I believe attack waves also add more intelligence with regard to target acquisition and dealing with obstructions.

All SC2 AI is done with standard triggers. GUI offers access to most AI functionality as well (a few tactical AI filters are missing wrappers last I checked but these can be added manually). Even tactical AI is in the form of trigger functions linked to by a reference in data. For tactical AI and any AI targeting functions to work the player must be a computer and AI system must have been started for them. Target search filters, commonly used by tactical AI functions, are general purpose and so will work in every situation even if not involving a computer player at all.
 
Status
Not open for further replies.
Top