ekolis / FrEee

An open source clone of the classic 4X game Space Empires IV.
http://edkolis.com/freee
49 stars 13 forks source link

AI Config file/tags #50

Open thegreatpl opened 4 years ago

thegreatpl commented 4 years ago

Each AI should have something like a config file, where certain values can be defined to help the game choose whether this is the right AI for a given Empire. This might include the current ministers file to cut down on the various files needed. The other idea to place here is tags for the AI.

A tag would depend on what the empire could be grouped under, with [RANDOM] being used to determine whether or not the empire should be used for the random empire generation, and [MINOR] being used to denote minor empire AIs (to stop the minor empires running all over the galaxy). Others would be used to group AI's into types.

So all agressive empires would be grouped under something like [AGRESSIVE], and selecting this on the Empire creation screen will choose a random AI tagged as such when the game starts.

An AI can have more than one tag, may have none, and can always be chosen in the Empire screen and in an Empire file (actually, might want to restrict the Empire screen to another tag so some AIs will be unique to some predesigned Empires?). This would allow some AIs to be disabled (such as the current python example ai), and only be chosen by predesigned empires, rather than being selected for use by the RandomAI.

Edit: Another field in the config file should be requirements; if the AI is designed to be used only with a Empire with Crystal tech, then it should only be available to be selected by an Empire which has it added.

ekolis commented 4 years ago

So let me get this straight - each AI would have a selection of zero or more tags, and when you set up a game, you can say "I want an AI opponent with such and such tags" and the game picks one at random matching your criteria? And the empire files for AI races - would they contain references to these tags as well? So if I pick the Krill to play against, I'd get an aggressive AI controlling them, but if I pick the Eee, I'd get an expansionist AI?

ekolis commented 4 years ago

I suppose you would also be able to use the tags when setting up your ministers? But it would not make sense to switch minister scripts mid-game because a minister script would be saving off data in its own custom format?

thegreatpl commented 4 years ago

Ministers are unique to the AI anyway, loaded from the .ministers file currently in each AI. Actually, we probably want a screen where we can see what ministers an AI can provide on the empire set up screen. Vanguard, for example, has lost the section Colony Management, and instead gained Facility Management (with new options Facility Upgrading and Facility Replacement) and Expansion. My idea of including them in the .json config was to reduce the number of non-code files an AI needs.

ekolis commented 4 years ago

See what ministers an AI provides? Presumably on that screen we could also toggle them?

thegreatpl commented 4 years ago

I meant on the empire creation screen. On the toggle screen, you can already see all the ministers the AI has and choose whether to activate them.

ekolis commented 4 years ago

Oh, that would be useful, I suppose.