How create Bot using Python

I want to use OpenRA to create a bot with Python scripting (Researching Artificial Intelligence in Games). What I have accomplished: - I can run the engine on my Ubuntu using ./OpenRA-Red-Alert-x86_64.AppImage Create a game, play, etc... What I haven't been able to do: - Find in the documentation how to integrate with the API using Python - Import this Python script into the engine.

Discussion about the game and its default mods.
Post Reply
gerssonmg
Posts: 2
Joined: Sun Mar 10, 2024 4:24 pm

How create Bot using Python

Post by gerssonmg »

I want to use OpenRA to create a bot with Python scripting (Researching Artificial Intelligence in Games).

What I have accomplished:
- I can run the engine on my Ubuntu using ./OpenRA-Red-Alert-x86_64.AppImage
Create a game, play, etc...

What I haven't been able to do:
- Find in the documentation how to integrate with the API using Python
- Import this Python script into the engine.

abcdefg30
Posts: 644
Joined: Mon Aug 18, 2014 6:00 pm

Re: How create Bot using Python

Post by abcdefg30 »

OpenRA does not expose an API for Python. We only have a Lua API for scripting missions: https://docs.openra.net/en/release/lua/

gerssonmg
Posts: 2
Joined: Sun Mar 10, 2024 4:24 pm

Re: How create Bot using Python

Post by gerssonmg »

Incredible. Thanks for the feedback.

I read the documentation on, but still don't understand, how to use my custom script in a single player party.

My objective:
Create a SinglePlayer game, where I play against my Lua script

I ventured into several links, but I still need help.
Some of what I read. I read others too
https://github.com/OpenRA/OpenRA/wiki/Map-scripting
https://github.com/search?q=repo%3AOpen ... &type=Code
https://docs.openra.net/en/release/lua/

User avatar
Punsho
Posts: 145
Joined: Wed Jul 18, 2018 2:56 pm
Location: Lithuania

Re: How create Bot using Python

Post by Punsho »

gerssonmg wrote:
Mon Mar 11, 2024 12:49 pm
I read the documentation on, but still don't understand, how to use my custom script in a single player party.

My objective:
Create a SinglePlayer game, where I play against my Lua script
The AI is currently written in C# and works in modules. In yaml, the modules are defined and tweaked, see ai.yaml.

Our lua integration is currently insufficient to fully support bots; too few variables and functions are exposed. The lua integration was made for mission scripting and even then it's functionality is a bit lacking. F.e. some missions for d2k are still yet to be made as the lua controlled bots need to be able to build a base. To see the source code behind the integration see C# files that end with *Properties.cs

Post Reply