Monster Mix

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
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Monster Mix

#16 Post by Vezzra »

I did some more testing on monsters distribution, I added some more statistic logging, ran several games where I set AIs to 0, monsters frequency to high and systems to 500, jus to see what results that would give me, and some other settings.

Some results where at least somewhat reasonable, but very often I got streaky results. One extreme example has been where Juggernauts got placed 5 times out of a total of 6 tries to place them, although the effective chance for placement has been 33%. Other results were 9 placements out of 16 tries with the same 33% effective chance, deviations on that scale have been very common.

On the other hand, the placement restrictions for Kraken, Snowflakes and Juggernauts are somewhat more restrictive than those for other space monsters. The new, more even empire homeworld distribution algorithm may play an important role, as more evenly distributed empire homeworlds most likely have substantially reduced the potential locations for space monsters that can only spawn several jumps away from those homeworlds.

Considering all that and the fact that the monsters distribution algorithm as it is probably is prone to produce odd results, I won't try to fix anything for 0.4.4. Too complicated at this stage, I say we leave it as it is now and try to fix it for the next release.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Monster Mix

#17 Post by Dilvish »

Vezzra wrote:Some results where at least somewhat reasonable, but very often I got streaky results. One extreme example has been where Juggernauts got placed 5 times out of a total of 6 tries to place them, although the effective chance for placement has been 33%.
The odds of that are actually a full 1 out of 60, so not actually tremendously surprising, even if you did make far fewer than 60 samples.
Other results were 9 placements out of 16 tries with the same 33% effective chance, deviations on that scale have been very common.
similarly, the odds of getting 9+ out of 16 when there is a 33% success chance is actually a full 1 out of 20. So these deviations are not surprising. You can check such things with the binomial calculator at http://stattrek.com/online-calculator/binomial.aspx
On the other hand, the placement restrictions for Kraken, Snowflakes and Juggernauts are somewhat more restrictive than those for other space monsters. The new, more even empire homeworld distribution algorithm may play an important role, as more evenly distributed empire homeworlds most likely have substantially reduced the potential locations for space monsters that can only spawn several jumps away from those homeworlds.
You're probably right about that. It's not that they're totally done away with, in my recent game with 200 systems and 7 AIs (albeit a Cluster layout which probably has more systems meeting the jump distances than other shapes would) there were over 10% of the systems meeting the requirements for Snowflakes and Krakens, and more than 5% meeting the reqs for Juggernauts. If I had been playing Medium or High monsters then I surely would have had some of each.

Code: Select all

2014-08-20 21:16:31,833 DEBUG Server : Tracked Monster and Nest Summary (base monster freq:  3.3%)
2014-08-20 21:16:31,833 DEBUG Server : Monster            | # placed | # valid sys locs | # valid nest planet locs
2014-08-20 21:16:31,833 DEBUG Server : SM_KRAKEN_1        |      0   |         24       |   27
2014-08-20 21:16:31,833 DEBUG Server : SM_SNOWFLAKE_1     |      0   |         24       |   25
2014-08-20 21:16:31,833 DEBUG Server : SM_JUGGERNAUT_1    |      0   |         13       |   15
Considering all that and the fact that the monsters distribution algorithm as it is probably is prone to produce odd results, I won't try to fix anything for 0.4.4. Too complicated at this stage, I say we leave it as it is now and try to fix it for the next release.
That sounds fine, though I think your above point about the new empire homeworld spacing was a valid one, and a small adjustment could very well be good now, such as shifting the Snowflake, Kraken and Juggernaut spawnrates from 1.0, 0.5, 1.0 to 1.2, 0.6, 1.2 or perhaps even to 1.4, 0.7, 1.4
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Monster Mix

#18 Post by Vezzra »

Dilvish wrote:So these deviations are not surprising.
The problem is not that these deviations occur, which is to be expected, but the rate at that these deviations occur. I get almost as much or even more very odd results than "normal"/"expected" ones. The occasional odd result is fine and even desired, but if it becomes the rule, something is off IMO.
a small adjustment could very well be good now, such as shifting the Snowflake, Kraken and Juggernaut spawnrates from 1.0, 0.5, 1.0 to 1.2, 0.6, 1.2 or perhaps even to 1.4, 0.7, 1.4
Yep, that sounds reasonable. I'd go for the latter suggestion (1.4, 0.7, 1.4), probably raising Kraken a bit more. Apparently those got a lower spawnrate because they tend to have more potential spawn locations, but with only half the spawnrate of Juggernauts/Snowflakes they occur substantially less frequently than these. Maybe 1.4, 1.0, 1.4?

And probably lower the spawnrate for floaters/dyson forests a bit? Currently you get plenty of these, and only very few Snowflakes/Kraken/Juggernauts. Resulting in universes with rather dull distribution of space monsters - far too floater/dyson forest heavy.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Monster Mix

#19 Post by Dilvish »

Vezzra wrote:
Dilvish wrote:So these deviations are not surprising.
The problem is not that these deviations occur, which is to be expected, but the rate at that these deviations occur. I get almost as much or even more very odd results than "normal"/"expected" ones. The occasional odd result is fine and even desired, but if it becomes the rule, something is off IMO.
We need to review the results of a series of these experiments to really get a good picture. I'll do that now and post my results in a few minutes.
I'd go for the latter suggestion (1.4, 0.7, 1.4), probably raising Kraken a bit more. Apparently those got a lower spawnrate because they tend to have more potential spawn locations, but with only half the spawnrate of Juggernauts/Snowflakes they occur substantially less frequently than these. Maybe 1.4, 1.0, 1.4?
Sure, Maybe 1.4, 1.0, 1.4 sounds fine to me.
And probably lower the spawnrate for floaters/dyson forests a bit? Currently you get plenty of these, and only very few Snowflakes/Kraken/Juggernauts. Resulting in universes with rather dull distribution of space monsters - far too floater/dyson forest heavy.
Well, I guess maybe a little, though the significant difference with floater/dyson versus the others-- the fixed element being armed and the roaming element being always unarmed-- makes them in my mind much easier to handle and therefore reasonable to sprinkle on a bit more thickly than the others. But sure, make whatever downward adjustment to floaters/dysons you deem suitable, I'm sure it will be fine.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Monster Mix

#20 Post by Vezzra »

Dilvish wrote:We need to review the results of a series of these experiments to really get a good picture. I'll do that now and post my results in a few minutes.
Well, we're not in a hurry here, because we can't do anything about it anyway for 0.4.4. Unless you're curious and want to find out right now - go ahead ;)

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Monster Mix

#21 Post by Vezzra »

I settled for just raising Kraken, Snowflake and Juggernaut spawnrates to 0.8 / 1.2 / 1.2. Raising them more (1.0 / 1.4 / 1.4) and lowering Dyson Forest and Floater even a bit seems to throw the current balance off too much, that would require far more thorough tweaking than is reasonable for RC builds.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Monster Mix

#22 Post by Dilvish »

Ok so I gathered a bunch of data and made some charts. On the gathering data part-- I've been planning to implement some new command line options to help with testing the AI, and so started with one to help here
**edit to correct option spelling to quick-auto-quit**:

Code: Select all

--quick-auto-quit
Starts a new quick-start game, bypassing the main menu, and immediately quits, for testing galaxy creation and turn zero Effects.
If you first start up with a blank galaxy seed (not zero, but an empty string) then FO uses the clock for the seed, so you can do a repeated bunch of quickstarts and still get different seeds & results. In the attached patch is a script I used to do that for 300 runs and extract this monster data from the server log each time. I forget right now just how big the galaxy was, but I vaguely recall using the same settings as you. Also attached are the raw results from that (for 302 runs, 2 manual and 300 via script).

This data was mostly focused on how many monsters get placed over how many attempts. Since for any given monster different galaxies have a different number of placement attempts, the results can't just all be directly thrown together, but since a binomial like this approaches a gaussian with enough samples (and most galaxies probably had enough for this to be a reasonable approximation), I scaled each galaxy sample to a zscore which then can be compared across galaxies.

Below is the bar charts showing the results, which for the Krakens seem to be pretty close to the Gaussian curve that would be expected. For the Snowflakes and Juggernauts the distribution seems centered a little on the low side; maybe I'll try it again sometime with a much larger sampling (I think I could do a couple thousand overnight). This was just looking at how many placement attempts were successful, with some additional logging something similar could be done to assess the distribution of how many placement attempts are made.
monster_dist..png
monster_dist..png (43.73 KiB) Viewed 863 times
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

Last edited by Dilvish on Wed Sep 03, 2014 12:32 am, edited 1 time in total.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: Monster Mix

#23 Post by Geoff the Medio »

Dilvish wrote:

Code: Select all

--quick-auto-start
Starts a new quick-start game, bypassing the main menu, and immediately quits, for testing galaxy creation and turn zero Effects.
There is already a -q flag for quickstarting, and an important feature of this new function is apparently the quitting immediately after starting the game, so perhaps that should be indicated in the name?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Monster Mix

#24 Post by Dilvish »

Doh! :D

My bad, I mistyped it there, as you can see in the patch, it is actually

Code: Select all

--quick-auto-quit
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

Re: Monster Mix

#25 Post by Chriss »

What about setting a dynamic min spawn value to reduce the possible spread? Like: statistically, in a galaxy of size x there should be about y monsters of this type, so place at least y/5 monsters? That would ensure that for a galaxy of sufficient size, there should be monsters of every type.
Attached patches are released under GPL 2.0 or later.

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

Re: Monster Mix

#26 Post by Geoff the Medio »

Chriss wrote:...so place at least y/5 monsters? That would ensure that for a galaxy of sufficient size, there should be monsters of every type.
More than a few of those such requirements can be difficult or impossible to guarantee along with all the other considerations that go into galaxy generation and population...

And is it really so bad if sometimes galaxies are generated differently? Not every game should have nearly-identical starting conditions...

Post Reply