To continue, here are my tests
/home/felix/snap/0ad/657/.config/0ad/mods/public/FelixBot/
├── mod.json
└── simulation/
└── ai/
└── felixbot.js
mod.json (minimal valid example):
{ "name": "FelixBot", "title": "Felix-bot", "version": "1.0", "description": "Custom AI bot for 0 AD by Félix", "author": "Félix", "requires": [] }
snap run 0ad -- -mod=public -mod=FelixBot
TIMER| InitVfs: 332.118 us
FILES| Main log written to '/home/felix/snap/0ad/657/.config/0ad/logs/mainlog.html'
FILES| Interesting log written to '/home/felix/snap/0ad/657/.config/0ad/logs/interestinglog.html'
TIMER| CONFIG_Init: 2.54065 ms
Sound: AlcInit success, using OpenAL Soft
FILES| Hardware details written to '/home/felix/snap/0ad/657/.config/0ad/logs/system_info.txt'
TIMER| write_sys_info: 16.674 ms
FILES| UserReport written to '/home/felix/snap/0ad/657/.config/0ad/logs/userreport_hwdetect.txt'
TIMER| RunHardwareDetection: 6.27691 ms
TIMER| InitRenderer: 48.9268 ms
TIMER| ps_console: 2.4843 ms
TIMER| ps_lang_hotkeys: 1.28745 ms
TIMER| pregame/mainmenu.xml: 73.157 us
TIMER| common/modern/setup.xml: 114.106 us
TIMER| common/modern/styles.xml: 125.51 us
TIMER| common/modern/sprites.xml: 860.851 us
TIMER| modmod/styles.xml: 32.384 us
TIMER| modmod/modmod.xml: 10.4945 ms
TIMER| common/modern/setup.xml: 101.322 us
TIMER| common/modern/styles.xml: 133.014 us
TIMER| common/modern/sprites.xml: 880.314 us
TIMER| modmod/styles.xml: 30.226 us
TIMER| incompatible_mods/incompatible_mods.xml: 843.469 us
TIMER| shutdown Renderer: 351.773 us
TIMER| shutdown SDL: 8.589 ms
TIMER| shutdown UserReporter: 4.32417 ms
TIMER| shutdown ConfigDB: 76.396 us
TIMER| resource modules: 231.48 ms
TIMER TOTALS (7 clients)
Hey!
I’m diving into making my own AI bot and want to start by copying the Petra bot, then renaming it so I can experiment with it. The catch? I’m running 0 AD via Snap on Linux, so paths are a bit tricky.
I’ve tried putting my mod in ~/snap/0ad/657/.config/0ad/mods/public/, but the game doesn’t detect it.
Anyone here worked with local mods on Snap? How do you launch the game with a custom mod using -mod or other tricks so it actually loads?
Also, any tips for safely copying Petra’s bot to start tinkering would be awesome.
Really appreciate any help—I just want to play with bot AI!
From what I understand, one big benefit of using Lua would be the native integration with C/C++ bindings, meaning there is no need to serialize/deserialize values (it can be just a reference). The serialization/deserialization of data is a big bottleneck for the Javascript bindings
I did nothing special, except use SpawnEntityonDeath, so it must've been subtly broke at that time. At the time I showed off the feature, nobody said, hey wait a minute that shouldn't work! Lol