• 🏆 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!

[General] computer AI issuing move orders & other unknown orders

Status
Not open for further replies.
Level 12
Joined
Nov 3, 2013
Messages
989
I've got some trouble with Computer AI issuing orders to computer owned units (even though I've used AI - Ignore Unit Guard Position or native RemoveGuardPosition takes unit hUnit returns nothing in jass).

Order Ids
public constant integer instant2=851987 //?
public constant integer move=851986
public constant integer stop=851972

Build the list of all orderids with constant integers
constant integer UNKNOWN73 = 851974

I obviously know what move & stop does, so I guess what this is mostly about is that I want to know what are public constant integer instant2=851987 //? and constant integer UNKNOWN73 = 851974, and how are they used?


I've noticed that the "851987" order seems to be issued whenever a unit returns to their guard position (so basically, first the unit is issued a move order to the guard position after chasing some unit or w/e, then—when it returns—it is given this "851987" order and is free to do what it wants again.)


But I haven't been able to figure out anything of what the final order—order "851974"—does, and I can't find any mention of what it does anywhere, except this: "// For example order id 851974. An endless going, undocumented order serving no obvious purpose." Wander



Anyway, so in the meantime I've sort of 'fixed' it by issuing stop order (or re-issuing previous order from before the computer AI issued any move order), but the units still turn around and/or start moving a bit before stopping (I also had to put in a 0.00 long wait before issuing stop order as well, as it did nothing otherwise.)

I want to know if there's some way to stop the computer AI from issuing move orders (so I don't have to save the previous unit orders, targets, etc.) and also, I'm just curious if anyone knows what those two undocumented orders are.
 
Level 15
Joined
Aug 14, 2007
Messages
936
I believe the main issue here is still order "851974" since it was an idle order from what you have described. Alternatively, you can stop using the standard AI and code your own AI as that will give you way more control over what you want the army to do.
Other than that, the other order
"851987" seems to require the army to actually touch down on the guard position, any trigger issue order would have overwrite that command, so no worries there.

I strongly recommend you to not use any AI script and just follow the standard warcraft AI. If you are currently working on a melee map, I think build order is still a problem via trigger editor, but I think you can get around it by splitting them into different tier stages and code everything from scratch. Meanwhile if anyone has any idea how the AI work please help us.


Edit: @DracoL1ch Hope blizzard fix that :[
 
Level 12
Joined
Jun 15, 2016
Messages
472
With units of which players does it happen? Do you actually have some AI script active for those players? And lastly, did you run RemoveGuardPosition remove guard position on each unit or use the action that removes all guard positions of player units at the start of the map?
 
Level 12
Joined
Nov 3, 2013
Messages
989
Can't do anything about it, slots above 11 (or whoever is neutrals in newest patches) will have default retarded rules you cannot touch yet
Oh, btw. While mapmaking I'm mostly using 1.27 version since JNGP doesn't work with the later versions. I mostly only use current version if I'm going to play on Bnet, but I generally don't use the world editor...

I've tested the map once or twice on LAN on 1.3 since I had to check for desync & my brother didn't have any older version on the PC, so the same problem still persists on current version as far as I can tell.

With units of which players does it happen? Do you actually have some AI script active for those players?
Anyway, the players are Dark Green & Brown, from the original 12 colors. so Player 11 & 12 from GUI or 10 and 11 in jass.

I actually got to know just the other day when I saw a post by drsupergood that apparently Ai - Guard oOsition doesn't work on Neutral Hostile, so I've specifically used regular player slots with computer AI players instead of using neutral ones.


And no, I'm not using any custom AI script or anything.

This is what I tested with afterwards:
  • kodos enter the game
    • Events
      • Time - enemies_start expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • AI - Ignore Kodo Stubborn (Lv2) 0029 <gen>'s guard position
      • Unit - Create 1 Kodo Beast (Lv3) for Player 11 (Dark Green) at (Center of capture zone rescue <gen>) facing Default building facing degrees
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • AI - Ignore (Picked unit)'s guard position
          • Unit - Order (Picked unit) to Attack (Random unit from unitGroup_runners)
      • Unit - Create 1 Kodo Beast (Lv1) for Player 12 (Brown) at (Center of capture zone rescue <gen>) facing Default building facing degrees
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • AI - Ignore (Picked unit)'s guard position
          • Unit - Order (Picked unit) to Attack (Random unit from unitGroup_runners)
So there's one pre-placed unit, and 2 newly spawned ones (one for player dark green & the other for player brown), and they've all got the same issue.

JASS:
function Trig_Untitled_Trigger_008_Copy_Func001C takes nothing returns boolean
    if ( ( GetTriggerPlayer() == Player(10) ) ) then
        return true
    endif
    if ( ( GetTriggerPlayer() == Player(11) ) ) then
        return true
    endif
    return false
endfunction

function Trig_Untitled_Trigger_008_Copy_Conditions takes nothing returns boolean
    if ( not Trig_Untitled_Trigger_008_Copy_Func001C() ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_008_Copy_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit u2 = GetOrderTargetUnit()
    local integer i = GetIssuedOrderId()
    local string s = OrderId2String(i)
    if ( u2 == null ) then
        if ( s == null ) then
            call DisplayTimedTextToForce( GetPlayersAll(), 7.00, GetUnitName(u) + " was issued the \"" + I2S(i) + "\" order." )
        else
            call DisplayTimedTextToForce( GetPlayersAll(), 7.00, GetUnitName(u) + " was issued the \"" + s + "\" order." )
        endif
        if (GetIssuedOrderId() == 851986) then              //851986 == Move order
            call TriggerSleepAction(0.00)
            call IssueImmediateOrderById(u, 851972)
            //call IssueTargetOrderById(u, attack, targetUnit)
            //call IssuePointOrderById(u, 851986, x, y)
            /*call DisableTrigger( GetTriggeringTrigger() )
            call IssuePointOrderByIdLoc(u, 851986, GetRectCenter(GetPlayableMapRect()))
            call EnableTrigger( GetTriggeringTrigger() )*/
        endif
    else
        if ( s == "" ) then
            call DisplayTimedTextToForce( GetPlayersAll(), 7.00, GetUnitName(u) + " was issued the \"" + I2S(i) + "\" order, targeting " + GetUnitName(u2) + "." )
        else
            call DisplayTimedTextToForce( GetPlayersAll(), 7.00, GetUnitName(u) + " was issued the \"" + s + "\" order, targeting " + GetUnitName(u2) + "." )
        endif
    endif
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_008_Copy takes nothing returns nothing
    set gg_trg_Untitled_Trigger_008_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_008_Copy, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_008_Copy, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_008_Copy, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_008_Copy, Condition( function Trig_Untitled_Trigger_008_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_008_Copy, function Trig_Untitled_Trigger_008_Copy_Actions )
endfunction
Besides these two triggers there shouldn't be any other relevant one, but if necessary I could make a new test map with only these two I suppose. Thing is that the 'real' map is pretty much just a test map itself already and I already made/modified these two triggers specifically just for checking what's up with the units.

_________________________________________________________________________________

p.s. Oh right, I gave the units max acquisition range (99999999) so even without giving them any orders they'll just pick some unit somewhere to attack. So I literally did nothing besides Ignore Guard Position. Of course later I added so they'll be issued a stop order every time they're issued a move order, but you can still see them turn around and/or walk a bit, and ofc I display the orders as text messages, so now it shows move & stop order.
 
Last edited:
Status
Not open for further replies.
Top