Map: Poland Raid - How to enable AI-bots on it?

Information and discussion for custom maps and mods.
Post Reply
Ronald
Posts: 104
Joined: Fri Aug 30, 2019 9:05 pm

Map: Poland Raid - How to enable AI-bots on it?

Post by Ronald »

Hello Mapmakers,
I want to play the map "Poland Raid (by s1w)" in skirmish mode.
https://resource.openra.net/maps/13416/

After selecting the map, OpenRA (version 20191117) give this error:
map_poland_raid.jpg
map_poland_raid.jpg (154.53 KiB) Viewed 900 times

QUESTIONS:
1. What do i need to do to remove the AI-Bot disablement on this map?
- Do I need to edit the map .yaml files?
- Do i need to adapt the map's LUA scripts that come with it?
- Do I need to use the Map Editor to add/modify/delete something from it?
- Option 4,5,n?

Thanks for your hints, tips and tricks to get me started fixing this map.

User avatar
Sleipnir
Posts: 826
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Re: Map: Poland Raid - How to enable AI-bots on it?

Post by Sleipnir »

The internal AI logic is not able to work with the destroyable bridges in this map, so it is disabled to avoid worse-than-usual gameplay and performance problems that would otherwise occur.

Ronald
Posts: 104
Joined: Fri Aug 30, 2019 9:05 pm

Re: Map: Poland Raid - How to enable AI-bots on it?

Post by Ronald »

Sleipnir wrote:
Tue Jan 07, 2020 12:24 am
The internal AI logic is not able to work with the destroyable bridges in this map, so it is disabled to avoid worse-than-usual gameplay and performance problems that would otherwise occur.
Thanks Sleipnir, this makes (now) perfect sense to me. and . it immediately explains some other "worse-than-usual game-s p e e d" phenomena, which I have already experienced playing on other maps against (a number of) AI-bots.

It is totally logical that - when the AI-bot units are searching / pathfinding for (other / human) enemy units - and their path gets "broken" - a game can come grinding to a halt (almost a kind of deadlock situation) due to the fact that it continues to keep searching and does not find anything.

Ronald
Posts: 104
Joined: Fri Aug 30, 2019 9:05 pm

Re: Map: Poland Raid - How to enable AI-bots on it?

Post by Ronald »

IDEA-1: for perhaps future OpenRa game_engine versions:
Maximize / Limit the amount of pathfinding cpu-cycles per AI-bot units (via a setting or a time-out)
This feature can help to keep the game more fluid, in case of an infrastructure collapse (broken bridges), map "choke point"
Something like (in pseudo code):

Set all unit-timeouts to (e.g. 10 sec)
Start all unit_timers
For n =1 to number-of-units
{
- Initiate / spawn unit thread
- Start unit-pathfinding algoritme
{
-- Set unit_state to "searching"
=== If enemy is found within timeout window
{
=== Set unit_state to "moving"
=== Move towards enemy unit
=== Set unit_state to "attacking"
=== Attack enemy unit
=== Set unit_state to "idle"
}

{
=== If NO enemy was found within timeout window
{
----- Set unit_state to "idle"
----- Set retry_timer to (e.g. 5 sec)
----- Set unit_state to "waiting"
----- When retry-timer expires {
-----> Enter unit pathfinding algoritme again
}
}
}

This way units who are not able to find a path to an enemy unit / base:
- will not blindly continue to search for enemy (and become able to slow the game down-to-a-halt).
- will temporarily be "parked" in a waiting / timeout queue (preserving cpu-cycles for that moment)
- will start their search again, after their idle-timer has expired.

So that all OpenRA maps (with or without destroyable bridges) can be played by AI-bots

Ronald
Posts: 104
Joined: Fri Aug 30, 2019 9:05 pm

Re: Map: Poland Raid - How to enable AI-bots on it?

Post by Ronald »

IDEA-2
Equip every bridge (destroyable map infrastructre element) with its own state-variable as in:
- Bridge1_State=0 "broken"
- Bridge1_State=1 "whole"

Allow unit pathfinding algorithm to read those bridge_state variables (e.g. at the moment of their creation)

Embed this bridge_state reading into the unit pathfinding algorithm as in:
- If all bridges are whole continue to do pathfinding as usual

- If 1 or more bridges are broken:
-- See if there is a findable path to the enemy
---- If yes
----- Do pathfinding via the remaining routes over the intact bridges

---- If not:
---- Stop their pathfinding attempts
---- Put all movable ground units to idle_state

---- For all idle groundunit_units:
------- Continue to check bridge_state_variables
------ Until 1 or more bridges become whole again
---- Then continue to do pathfinding as usual


This implementation allows and extra dimension to Skirmish gameplay:
- Human players can use the destroy-a-bility of the bridges for their strategical advantage
- AI-Bot players now to have an external trigger to - for example
--> build an engineer, send it to the broken bridge to repair it again, thereby counter-acting the human player's attempt to reshape the battlefield to their own advantage.

--> destroy a bridge themselves for their own AI-bot strategical defensive advantage.

Post Reply