Additions to enable an AI team mate

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
DunRaider
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Oct 07, 2020 7:45 am
Contact:

Additions to enable an AI team mate

Post by DunRaider »

I'm developing a mod which will make it possible for users to add an AI team mate (e.g. ChatGPT, Claude, open source model) to a multiplayer game through RCON (Factorio version 1.1.110). The idea is not to provide an AI which can use all the advanced features in the game, instead it will have limited capabilities but would in theory be able to get to launching a rocket.

I want the AI to adhere to the rules of the game like a player. This is almost possible but the character (LuaEntity) lacks a crucial function which is the can_place_entity. I have tried to use LuaSurface.can_place_entity and make some approximations of build reach, but it isn't working as I would like. Furthermore, the LuaSurface.can_place_entity doesn't seem to do any check on e.g. whether there are resources on the tiles when drills are placed.

I see two possible solutions to this:
  • Add can_place_entity to LuaEntity. I assume LuaEntity already have the required variables, e.g. build_distance and character_build_distance_bonus which is inherited from LuaControl.
  • Add LuaEntity to LuaSurface.can_place_entity so it take position, build_distance, and character_build_distance_bonus of the character into account.
It seems like build_distance isn't populated when a player isn't connected to the character, but I assume that would be an easy fix (e.g. hardcode it to 10 when it is a character).
StrangePan
Factorio Staff
Factorio Staff
Posts: 236
Joined: Fri Dec 07, 2018 3:41 pm
Contact:

Re: Additions to enable an AI team mate

Post by StrangePan »

Before I look into the feasibility of this request, I should inform you that development on Factorio 1.110 is stopped, and all future fixes, features, and modding API requests will be applied to Factorio 2.0.+. Thus, any mods seeking to use this feature will also need to be updated to run on Factorio 2.0.+
DunRaider
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Oct 07, 2020 7:45 am
Contact:

Re: Additions to enable an AI team mate

Post by DunRaider »

Hi StrangePan,

Sorry for the late response. It seems like I will have to upgrade to the newest version. I would appreciate it if you would have a look at it.
Post Reply

Return to “Modding interface requests”