Barotrauma

Barotrauma

Barotrauma Workshop
You can build your own submarines and monsters with in-game editors and share your creations with other players. Imagine and experiment.
shoolgate 1 25 Feb, 2024 @ 1:59pm
why no one build AI MOD?
< >
Showing 1-7 of 7 comments
Buggy Boy 10 27 Feb, 2024 @ 10:38am 
Maybe because the AI code is really difficult to follow and understand for someone who is not in the dev team and familiar with it already, and to modify would no doubt require Lua and potentially introduce instabilities and inconsistencies.

Not quite the same as changing a few sprites, adding new items, or even new mission types. It's much more involved and complex from what I've seen, and I think most people wouldn't bother using such a mod considering how much effort would be required just to install it.
Stravinsky 22 Apr, 2024 @ 12:29pm 
is it possible tho ? Can we code our own AI bot based on what is already made or it is hard coded ?
Buggy Boy 10 24 Apr, 2024 @ 2:04pm 
Originally posted by Stravinsky:
is it possible tho ? Can we code our own AI bot based on what is already made or it is hard coded ?

With LUA it's probably theoretically possible to change just about anything in the game, but the AI routines are in the core files so not easily moddable. I really wish they'd made the AI routines more open for modding, like the sprites and other things.
Ghost314 24 Apr, 2024 @ 6:15pm 
From what I understand the source code of the game is on github so it should be possible to mod anything with enough time effort and skill right? I also was hoping to tinker with bot AI. I feel like the SP experience could be much better if bots were just a little bit smarter.
Buggy Boy 10 25 Apr, 2024 @ 6:29am 
Originally posted by Ghost314:
From what I understand the source code of the game is on github so it should be possible to mod anything with enough time effort and skill right? I also was hoping to tinker with bot AI. I feel like the SP experience could be much better if bots were just a little bit smarter.

I've also looked into improving the bot AI, I found the routines difficult to follow (except for the very basic stuff), and I'm no coding genius so had to leave it. There's scant or no documentation on the AI too so you're pretty much on your own with it. As the AI routines are in the core game files it would mean that your version would not match the vanilla so everyone playing would need to have your same version (maybe possible via LUA, but I've never modded with that so don't know how it works).
Ghost314 25 Apr, 2024 @ 2:46pm 
Right, I got my dev environment setup yesterday and started looking at the AI code. I had forgotten about the lua mod, but my intuition tells me its usefulness might depend on whether you're trying to add new behaviours or alter existing ones.

In either case, it looks like the lua mod is also open source, so in theory any needed AI support that's missing could be added. I might try going that route for ease of mod distribution.

Edit: Just skimmed through the docs for the lua mod and they have the ability to replace functions in the game code with your lua defined function which should allow us to modify anything we need. The 'lua examples' section even has some scripts that mess with AI and orders so it's looking quite promising.
Last edited by Ghost314; 25 Apr, 2024 @ 3:04pm
Buggy Boy 10 26 Apr, 2024 @ 5:12am 
Originally posted by Ghost314:
The 'lua examples' section even has some scripts that mess with AI and orders so it's looking quite promising.

Brilliant! I'll have to keep an eye out to see what you can do.
< >
Showing 1-7 of 7 comments
Per page: 1530 50