[BNW] [SDK] TCP Client to Python

Discussion in 'Civ5 - SDK / LUA' started by frutiemax, Aug 1, 2020.

Tags:
  1. frutiemax

    frutiemax Warlord

    Joined:
    Jan 19, 2015
    Messages:
    112
    So I'm working on a project I had in mind for a while.
    https://github.com/frutiemax/CvGameCoreSource/tree/CustomAI

    I'm working on a way to override the Civ5 AI in python via TCP. Python has so many good AI libraries (Tensorflow, pytorch) and mathematical ones (numpy) that makes development of AI much appropriate. I don't aim for a total machine learning thing as this would be unpracticable due to the complexity of the Civ5 environment but machine learning on many small tasks can lead to good results I believe.

    Right now, the python script is the server while Civilization 5 is the client. When Civ5 can connect to the python script, it uses the new behavior for the AI (right now it does nothing). The city states and barbarians are unaffected as I don't want to change their behavior.

    I have some questions for you modders:
    • How do you make it so that all players are AI at the start of the game? Can I assign all players to not human in the code?
    • When the game has finished, is there a way to start an another game with a different map and settings automatically via code? This would be useful for collecting data on the AI behaviors.
    Thanks.
     
    balparmak likes this.

Share This Page