Diversity in AI species

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Message
Author
User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Diversity in AI species

#1 Post by drkosy »

At first: This is not a bug report, just something I like to report and maybe discussed :)

I always play with 6 AI competitors and in the last game wasn't much diversity. I played scylor, 2x AI hat scylor, 2x AI hat trith and the last two hat cray and abbadoni. With 3 times scylor in the game it was a bit boring...

Maybe there could be a rule to check with race the previous AI took and exclude that for the next AI. That would give the game some more diversity in species.
I don't know how much effort this means to be implemented. If it's not to much it could make the game a bit more interesting.

That is far away from top priority, but as I experienced that recently I like to report that.
Want some fresh experience? Try Kosymod

defaultuser
Juggernaut
Posts: 854
Joined: Wed Aug 26, 2015 6:15 pm

Re: Diversity in AI species

#2 Post by defaultuser »

Not really in response to the questions, but what does "hat" mean in the post?

wobbly
Cosmic Dragon
Posts: 1879
Joined: Thu Oct 10, 2013 6:48 pm

Re: Diversity in AI species

#3 Post by wobbly »

Presumably "had" instead of "hat"

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Diversity in AI species

#4 Post by Oberlus »

The species selection algorithm could be easily fixed for this:

https://github.com/freeorion/freeorion/ ... res.py#L40

Remove the "* 2" in that line.
That would not ensure that any of the AIs doesn't get the same species as the human player, but it's a start.
Removing from "pool" the species of the human player would fix that, in single player games, but I don't know how to do that (no python skills myself).

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Diversity in AI species

#5 Post by drkosy »

Remove the "* 2" in that line.
Thanks for that hint. For me it'll do but while reading the comment, I noticed that for max number of AI players that *2 is important.
Want some fresh experience? Try Kosymod

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Diversity in AI species

#6 Post by Oberlus »

drkosy wrote: Mon May 10, 2021 3:37 pm I noticed that for max number of AI players that *2 is important.
Not really. When all available species have been used, pool is refilled with the whole set of available playable species. The only change you should see from removing the "* 2" is that you will no longer see repeated species played by AIs when number of AIs is not greater than total number of playable species.

User avatar
drkosy
Space Dragon
Posts: 367
Joined: Sat Jul 11, 2020 9:41 am

Re: Diversity in AI species

#7 Post by drkosy »

Than I wonder why it's actually there. I already removed it in my modified files. I'll save them in a different folder so I can switch between original files (for MP game) and changed files :)
Want some fresh experience? Try Kosymod

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Diversity in AI species

#8 Post by Oberlus »

AFAIK, changes in universe generation folders are irrelevant for MP games.

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: Diversity in AI species

#9 Post by LienRag »

Loosely related to that : I noticed that the Seed for a galaxy is apparently a seedpod rather than a real seed.

What I mean is that when I choose a seed and make changes to the Galaxy settings (like more AI players and/or more systems), the Galaxy changes (which is to be expected).
But the player Species (at random) doesn't change, seed 0 is always Abaddoni in my experience. Galaxy age is always the same for a same seed, and so on.

This is a problem for playing random games that are actually random (without using a random seed, which is a problem for replayability in test games), and AFAIK there is no justification for such a behavior.

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Diversity in AI species

#10 Post by Oberlus »

LienRag wrote: Mon May 10, 2021 6:09 pm Loosely related to that : I noticed that the Seed for a galaxy is apparently a seedpod rather than a real seed.

What I mean is that when I choose a seed and make changes to the Galaxy settings (like more AI players and/or more systems), the Galaxy changes (which is to be expected).
But the player Species (at random) doesn't change, seed 0 is always Abaddoni in my experience. Galaxy age is always the same for a same seed, and so on.
Changes in galaxy settings affect the processes of universe generation that happen after them but not before them. Species selection is one of the early things in universe generation and so you get same species with same seed regardless of what you set for (e.g.) monsters.
LienRag wrote: Mon May 10, 2021 6:09 pm This is a problem for playing random games that are actually random (without using a random seed, which is a problem for replayability in test games), and AFAIK there is no justification for such a behavior.
I don't see the problem. If you want really random, you must use random seed. Reusing the same seed from a previous game is hardly random.
Can you elaborate?

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: Diversity in AI species

#11 Post by LienRag »

Oberlus wrote: Mon May 10, 2021 6:51 pm I don't see the problem. If you want really random, you must use random seed. Reusing the same seed from a previous game is hardly random.
Can you elaborate?
To play a test game for a new FOCS file, I play a Galaxy with many random settings (I used to make it all random, but after a while found that Low natives, monsters and specials are more interesting).

When I notice that one of the FOCS code doesn't work as expected, I correct it on the fly (or when I forgot to add the relevant stringtable in the en.txt, or when I notice that it's not very clear) and then I have to close FO and restart it. Using the same seed gives me the same Galaxy, which makes it more interesting that restarting a fully new game.

defaultuser
Juggernaut
Posts: 854
Joined: Wed Aug 26, 2015 6:15 pm

Re: Diversity in AI species

#12 Post by defaultuser »

wobbly wrote: Mon May 10, 2021 7:29 am Presumably "had" instead of "hat"
Oh. Yes, that would make sense.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Diversity in AI species

#13 Post by Geoff the Medio »

defaultuser wrote: Tue May 11, 2021 5:25 am
wobbly wrote: Mon May 10, 2021 7:29 amPresumably "had" instead of "hat"
Oh. Yes, that would make sense.
"hat" is the third person singular conguation of the verb "haben" in german, which are equivalent to "has" and "have" in english, respectively. "he/she/it has" <-> "er/sie/es hat". Both spoken and typed english by german native speakers can easily make this substitution by accident, since they sound and mean and are typed similarly, the latter being affected by muscle memory after / when typing "ha".
Oberlus wrote:Changes in galaxy settings affect the processes of universe generation that happen after them but not before them. Species selection is one of the early things in universe generation and so you get same species with same seed regardless of what you set for (e.g.) monsters.
Changing this would be a bit involved or potentially bug prone. You could change the species some time later in the galaxy generation, but that might interact strangely with some of the code that relies on knowing what species have been selected before it runs.

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Diversity in AI species

#14 Post by Oberlus »

Geoff the Medio wrote: Tue May 11, 2021 8:48 am
Oberlus wrote:Changes in galaxy settings affect the processes of universe generation that happen after them but not before them. Species selection is one of the early things in universe generation and so you get same species with same seed regardless of what you set for (e.g.) monsters.
Changing this would be a bit involved or potentially bug prone. You could change the species some time later in the galaxy generation, but that might interact strangely with some of the code that relies on knowing what species have been selected before it runs.
I would never recommend trying to change that. I still fail to see the point of what LienRag was commenting.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Diversity in AI species

#15 Post by Geoff the Medio »

Oberlus wrote: Tue May 11, 2021 10:07 amI still fail to see the point of what LienRag was commenting.
As far as I understood, the goal is to randomly vary one aspect of universe generation (which species are present) without changing anything else. This seems like a reasonable request for testing purposes, regardless of whether it's practically doable.

Post Reply