• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help for an AI sample of map? (similar to moba's)

Status
Not open for further replies.
Level 5
Joined
Mar 26, 2020
Messages
66
i know, pardon my audacity...but im not the type to create/learn from scratch without someone's material references

(i copied this sample map of this guy a a year ago [oct] and it detects the AI's but the AI doesn't seems to work) oh also i revamp my own way after using this as reference~
1618813302994.png

im kinda new despite a year of usage on this modding tool
 

Attachments

  • AI.w3x
    105.6 KB · Views: 17

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
The AI only works for slots that are set to computer controller. The map you provided defaults to having most of them set to user (host can decide) controller. If you go to Scenario -> Player Properties... and set all except player 1 (red) slots to computer controller and test the map then the AI can be seen to work.

You may also need to modify the circle of power to provide 5 food so that more of the hero types can be hired, possibly a bug with the test map.
 
Level 5
Joined
Mar 26, 2020
Messages
66
The AI only works for slots that are set to computer controller. The map you provided defaults to having most of them set to user (host can decide) controller. If you go to Scenario -> Player Properties... and set all except player 1 (red) slots to computer controller and test the map then the AI can be seen to work.

You may also need to modify the circle of power to provide 5 food so that more of the hero types can be hired, possibly a bug with the test map.
oh wow, how come i didnt think of that THANKS, tho few AI's are working (its suppose to be 4 AI ally & 5 AI enemy but in-game 2 AI ally & 3 AI enemy) with pathfinding prob coz i set the map with teleporting area

it maybe sound rude but care to check my 1 year project ive been working on? (its similar to DotA thats why prolly the 2 AI got counted for hero registry and end up no AI hero)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
oh wow, how come i didnt think of that THANKS, tho few AI's are working (its suppose to be 4 AI ally & 5 AI enemy but in-game 2 AI ally & 3 AI enemy) with pathfinding prob coz i set the map with teleporting area
In the map you provided above part of the issue may be a lack of available food or patch based changes.
it maybe sound rude but care to check my 1 year project ive been working on? (its similar to DotA thats why prolly the 2 AI got counted for hero registry and end up no AI hero)
Check if for what? Be aware that simply copying and pasting the AI from the map above is unlikely to work, it may need to have references update to be appropriate for your map.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
You will need to expand the AI Move trigger to accommodate for the area teleporting, possibly with logic that if they are in the home base it orders them to the exit rather than to the opposing side of the field. Either that or you can try using waypoints instead of triggers to handle the teleporting as the path finder does take into account and use waypoints to move around the map.
 
Level 5
Joined
Mar 26, 2020
Messages
66
You will need to expand the AI Move trigger to accommodate for the area teleporting, possibly with logic that if they are in the home base it orders them to the exit rather than to the opposing side of the field. Either that or you can try using waypoints instead of triggers to handle the teleporting as the path finder does take into account and use waypoints to move around the map.
Thanks good sir, i forgot waypoint gates is a thing so i used the trigger lol
 
Level 5
Joined
Mar 26, 2020
Messages
66
Pathfind ✔
now i need help for the Ai registry

1618823456099.png


i want the Red, Orange & Green not counted so that the other AI will so work (much better if the same as the Dota where scourge and sentinel won't show as 'computer normal' in lobby or scoreboard)
so far, i've tested 2-3 runs and the AI counts are either:

1 side - 2-3 AI ally (it should be 4 since blue is the default host)
2 side - 3-4 AI enemy (it should be 5 and prolly the other computer as the color i mentioned got counted and ends up with 3-4 AI enemy)

anyone?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Ad an exclusion to the player loop so that it skips iterations that are the passive computers. You could add both such players to a player group and then use the boolean function (for boolean comparison) to check if the picked player is in that player group. If they are not (equal to false) then they are possible valid targets for the AI, otherwise do nothing.
 
Level 5
Joined
Mar 26, 2020
Messages
66
Ad an exclusion to the player loop so that it skips iterations that are the passive computers. You could add both such players to a player group and then use the boolean function (for boolean comparison) to check if the picked player is in that player group. If they are not (equal to false) then they are possible valid targets for the AI, otherwise do nothing.
can you make me a sample of that?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Alter the range the loops run from.
  • AI Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Your Trigger System --------
      • -------- --------
      • Set VariableSet HeroIndex[1] = Young Mercenary
      • Set VariableSet HeroIndex[2] = Caring Princess
      • Set VariableSet HeroIndex[3] = Sprightly Cleric
      • Set VariableSet HeroIndex[4] = Black Knight
      • Set VariableSet HeroIndex[5] = Paragon Knight
      • Set VariableSet HeroIndex[6] = Fateful Princess
      • Set VariableSet HeroIndex[7] = Priestess of Dawn
      • For each (Integer B) from 1 to 15, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HeroIndex[(Integer B)] Equal to No unit-type
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Unit Group - Add all units of (Units of type HeroIndex[(Integer B)]) to HeroGroup
      • Set VariableSet SystemPoints[1] = (Center of HeroSelectArea <gen>)
      • Set VariableSet SystemPoints[2] = (Center of EmblaHeroField <gen>)
      • Set VariableSet SystemPoints[3] = (Center of AskrHeroField <gen>)
      • Set VariableSet SystemPoints[4] = (Center of HeroSelectArea <gen>)
      • -------- --------
      • Set VariableSet AICount = 0
      • Set VariableSet AttackRange = 450
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to Computer
            • Then - Actions
              • Set VariableSet AICount = (AICount + 1)
              • Set VariableSet BoolAi[(Integer A)] = True
              • Set VariableSet ItemAIint[(Integer A)] = 0
            • Else - Actions
      • For each (Integer B) from 7 to 11, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer B))) controller) Equal to Computer
            • Then - Actions
              • Set VariableSet AICount = (AICount + 1)
              • Set VariableSet BoolAi[(Integer B)] = True
              • Set VariableSet ItemAIint[(Integer A)] = 0
            • Else - Actions
      • Wait 15.00 seconds
      • -------- AI Spawn Checking --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AICount Greater than or equal to 1
        • Then - Actions
          • Game - Display to (All players) for 7.00 seconds the text: AI Mode Detected
          • Trigger - Turn on AI Summon <gen>
        • Else - Actions
Instead of from 1 to 5 and 7 to 11 you can do 2 to 5 and 8 to 11. This is similar to what I described above except by altering the range that is processed rather than excluding specific players from being processed.

Such loops also need to be changed in the AI Summon trigger. An example of poor programming practice since this could easily be overlooked and so cause bugs. Personally I would have used player groups to track the sides so that there would be a single trigger that determines the AI groups.
 
Status
Not open for further replies.
Top