Support | News | Classic | F.A.Q. | Discord | Discussions | Wiki | Roadmap

Can i mod in other AIs? If i can mod in other AIs; How do i mod in my own AIs, how can i program those AIs, and also where to place the AI mods?

    There are some AI settings you can tweak in Data/Ships/ai.txt. You should be able to add new sections to that file for different AIs, but you can't change the underlying algorithm.

    Technically, it is possible to create whole new AIs scripted in Python, but that requires pretty deep knowledge of the game's source code, and I don't have time to document that right now.

      I didn't have enough time in Python source code, but i used to code is some other game that had main feature around coding. The X = Y part of the AI might be confusing at first, but it is pretty intuitive. Is there any way to have the AI to check where is the lowest DPS angle of a ship, or having it to circle around the ship in a fixed rate of turning(AttackAngleFixedRotate maybe?)? Is the coded AI must be on a certain order, or there are some flexible points(Placing the PatrolRadius on the front instead of the back, for example)?

        Currently there's no way to do those things without writing a Python AI script.

        PatrolRadius is how far the AI ship will wander from its spawn point.

          Are the attack angles a variable that can be added or subtracted?

            H4zardZ1 Not sure what you mean? The attack angle is chosen at random and changes every few seconds according to AttackAngleChangeChance.

              Is the AttackAngle is stored with a number(0, 90, etc) and is able to be added, subtracted, multiplied or divided, like other variables?

              Circling is essentially adding/subtracting AttackAngle variable, and if you don't store it in a variable yet, it's less laggy yet decreases one aspect of the game that can be modded.

              Other important things about AI modding: DPS zone/s and/or(but i recommend the latter) DPS arc/s of a ship. Can't find any damage-related variables(DamageZones, etc.).

              The attack angle is indeed stored as a simple number. But it's purely random (changing every few seconds) and can't be adjusted without writing a Python AI or modifying the game's source code itself.

              The AI (for both player ships and enemy ships) picks a side and distance to attack from by totaling up the AIFirepowerRating of every weapon pointing that direction.

              The AI is obviously very simple right now. It will be improved with time; it just hasn't been a very high priority right now.

              7 months later

              Where can the default AI script be found, and how would one add additional AI scripts?

                pineapple There are some settings you can tweak in Data\Ships\ai.txt, but the actual code for the AI is currently hardcoded into the game. 🙁

                You can add additional kinds of AIs by creating additional sections in the ai.txt file.

                It is also theoretically possible to add Python AI scripts by setting Type = Script; and Script = "my_python_script.py";, but I don't currently have any documentation or examples for writing such scripts. If you're feeling incredibly adventurous, you might be able to decompile the source code and figure things out from there. 😉 I've made a note to myself to switch the main AI script to a Python script, so that it's easier to mod and can be an example for more scripts.

                  5 days later

                  I doubt many would touch AI but nice to hear of the possibilities.

                    Write a Reply...