Jump to content


Photo

Preventing stalemates between ai


4 replies to this topic

#1 Moreartillery

Moreartillery
  • Members
  • 246 posts
  • Projects:Cinematic Battles

Posted 18 July 2021 - 11:30 AM

After watching ai get permanently stuck trying to force a dozen units across a bridge at once, I thought about what we could add to buildbasestrategy.ai to solve this. What I came up with was

function buildbasestrategy:stalemate
         
            if (no strategic point has been captured in the last 15 minutes) then
            only build squads in y for 10 minutes
           
            y= (list of squads, only artillery and aircraft)

end

If ai gets stuck in a chock point then all ai will only build artillery and aircraft until the stalemate is broken.

 

I don't know enough lua to make this work, I hope a more experienced programmer is around still.


Developer of the Cinematic Battles mod.

https://www.moddb.co...nematic-battles


#2 Gambit

Gambit

    title available

  • Members
  • 6,718 posts
  • Location:Athens, Greece

Posted 18 July 2021 - 07:37 PM

A bit complex but doable, the thing is that it needs time and effort, and even more time to test properly...

The idea is to use a clever stalemate timer, and the (no strategic point has been captured in the last 15 minutes) condition is far from ideal.

 

Also, what happens if the stalemate is because of pathing? Or if no aircraft are available for the race?

 

Plus, it will require to update ALL races, to include the lists of flyers and artillery units - SCaR cannot do that for the AI, even if I implement it in Unification, it needs AI updating :thumbsdownsmiley:


-In search of Papasmurf...

#3 Moreartillery

Moreartillery
  • Members
  • 246 posts
  • Projects:Cinematic Battles

Posted 20 July 2021 - 11:24 AM

The idea is to use a clever stalemate timer, and the (no strategic point has been captured in the last 15 minutes) condition is far from ideal.

So what condition would you use?
 

 

Also, what happens if the stalemate is because of pathing? Or if no aircraft are available for the race?

 

Plus, it will require to update ALL races, to include the lists of flyers and artillery units - SCaR cannot do that for the AI, even if I implement it in Unification, it needs AI updating :thumbsdownsmiley:

The artillery and aircraft can kill the stuck units without becoming stuck themselves.

 

If its a function in buildbasestrategy.ai then you don't have to update every race. You'd only have to add it to a single race to test it.


Developer of the Cinematic Battles mod.

https://www.moddb.co...nematic-battles


#4 Gambit

Gambit

    title available

  • Members
  • 6,718 posts
  • Location:Athens, Greece

Posted 20 July 2021 - 03:43 PM

So what condition would you use?

I would check every (say) one minute for the average position of the non-builder units.

1] If in combat, and the average position does not "progress", I would follow the change is strategy you suggested (artillery/aircraft).

2] If not in combat, we are talking about a pathing stalemate (probably because of a map bottleneck or non-adequate pathing design). In this case, I would order an alternative route.

 

 

If its a function in buildbasestrategy.ai then you don't have to update every race. You'd only have to add it to a single race to test it.

To test it, yes.

Because if it is OK and operational, I would indeed add it to the core buildbasestrategy.

To create the code though, is strenuous. I would need 3 days or more.

 

...And this will not be enough.

I would ALSO need one more function to discern artillery (aircraft is easy, from the unitstats of each race, simply searching for UnitStatsAI.UC_AirMed class squads).

And this should be done for every race.

This is minor of course.

 

 

To be honest, there are TONS of things I want to add to the AI.

For example alternative strategies, race-specific strategies (for example Tyranids or Daemons do not play as the other races - and for both I have already made many additions).

But in the end, prioritization always leaves AI... Last. :ermm:


-In search of Papasmurf...

#5 fuggles

fuggles

    title available

  • Members
  • 4,849 posts

Posted 03 August 2021 - 09:54 AM

Could you check if they have not moved, order them back to hq and then despawn some chaff? Check me out on revora.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users