SMUnlimited / AMAI

Advanced Melee Artificial Intelligence Mod For Warcraft 3
Other
211 stars 34 forks source link

fix https://github.com/SMUnlimited/AMAI/issues/389 #397

Closed jzy-chitong56 closed 1 month ago

jzy-chitong56 commented 1 month ago

Attention, actively expanding now is not limited by time

ai_time - exp_time_count > exp_first_time
ai_time - exp_time_count > exp_second_time

fix https://github.com/SMUnlimited/AMAI/issues/316 https://github.com/SMUnlimited/AMAI/issues/389

When this repair is completed, I plan to submit it as a significant change https://github.com/SMUnlimited/AMAI/issues/323


I did not submit the chaotic expansion

If possible, please evaluate this feature first , Thank you.

_if mines < 1 or gold_left < 2500 or exp_prepared then
  call Trace("ExpansionBuilder: Putting mine on build list")
  call CreateDebugTagLoc("Current Expansion", 10, GetUnitX(current_expansion), GetUnitY(current_expansion), 1.00, 0.80)
  if mines < 1 or gold_left < 2500 then
    call BuildExpa(TownCount(racial_expansion) + 1, racial_expansion, expa_emergency_prio + i)
  elseif rebuild or upkeepboost then
    call BuildExpa(TownCount(racial_expansion) + 1, racial_expansion, expa_rebuild_prio + i)
  else
    call BuildExpa(TownCount(racial_expansion) + 1, racial_expansion, expa_prio + i)
  endif
  return_
elseif active_expansion and mines < 4 and GetRandomInt(0, 100 - i) < 42 and GetGold() > 1000 and GetWood() > 700 and not_taken_expansion == null then
  if chaos_expansion != null and chaos_expansion != current_expansion and GetResourceAmount(chaos_expansion) >= GetUnitGoldCost(old_id[racial_expansion]) and GetLocationCreepStrength(GetUnitX(chaos_expansion), GetUnitY(chaos_expansion), expansion_radius) <= 0 and not CheckExpansionTaken(chaos_expansion) then
    set u = GetExpansionPeon()
    if u != null and UnitAlive(u) and u != expansion_peon and not chaos_expansion_run then
      set chaos_expansion_run = true
      call TQAddUnit2Job(2 * sleep_multiplier, BUILD_EXPANSION, 0, u, chaos_expansion)
      call IssueTargetOrderById(u, old_id[racial_expansion], chaos_expansion)
      call CreateDebugTag("chaos expansion", 10, u, 3.00, 1.50)
      call Trace("ExpansionBuilder: chaos expansion")
      set u = null
      return
    endif
    set u = null
  else
    set chaos_expansion = expansion_list[GetRandomInt(0, expansion_list_length - 1)]
    set chaos_expansion_run = false
  endif
endif
call Trace("ExpansionBuilder: Not ready to build mine")
SMUnlimited commented 1 month ago

Gone different route: https://github.com/SMUnlimited/AMAI/commit/3b57607ba55e87adc92a8dad9aaddb7f3f016ae5

Could consider the 4th expansion but needs to be rare

jzy-chitong56 commented 1 month ago

UD does not have special abilities, which is unfair to UD,It's better to add the function of expanding and building towers during construction, as athletes often do now, at least for UD to do so

The original intention of active expansion was to expand more actively on maps with a large number of gold mines, but after modification, it seems that it is no longer active

I'm not sure if special expansion can be used for the fourth expansion

jzy-chitong56 commented 1 month ago

some expansion capabilities require very strict conditions So special expansion should not affect normal expansion and must be use when have a expansion

SMUnlimited commented 1 month ago

Applied a different take for chaos expansion to combine with profile aggressiveness but restricted to not just expand to any random expansion https://github.com/SMUnlimited/AMAI/commit/722f2af591c3250429e19b5d7f33143c6efd7d80