Sneaky Ion storms

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
Sloth
Content Scripter
Posts: 685
Joined: Sat Mar 17, 2007 12:28 am

Sneaky Ion storms

#1 Post by Sloth »

This is Turn 5.
turn5.png
turn5.png (59.21 KiB) Viewed 1070 times
This is Turn 6. Spot the difference?
turn6.png
turn6.png (30.51 KiB) Viewed 1070 times
Correct! That's a sneaky Ion Storm brewing up just under the B of Bato Beta!

I ran this game to test the changes by Vezzra and didn't realize until turn 12 that an Ion Storm was already there for 6 turns.

I think they should start larger and a little bit more oustide to be noticed.
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.

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

Re: Sneaky Ion storms

#2 Post by Vezzra »

Sneaky storms are cool! :D

Anyway, feel free to tinker with the numbers. The starting sizes can be modified in turn_events.py, lines 15&18, and the rest is in fields.txt. Have fun ;)

User avatar
Sloth
Content Scripter
Posts: 685
Joined: Sat Mar 17, 2007 12:28 am

Re: Sneaky Ion storms

#3 Post by Sloth »

I tinkered around with the numbers and made changes that mostly affect smaller galaxies (width < 1000). I've created a PR: https://github.com/freeorion/freeorion/pull/238

Note: My testing galaxy was irregular and had 100 stars which resulted in a width of about 1000.

- Reduced the spawn rate on small and normal sized maps to 0.03.
0.03 was the spawn rate before your changes and for smaller galaxies 0.05 is just too much. I haven't changed the max value of "0.00015 * fo.get_universe_width" but it probably should be changed. Doesn't it need a very very large galaxy to kick in (like 10000+ systems)?

- The fields will start a little larger and added randomization to starting size.
They were hard to notice at size 5.

- Increased the minimum distance of spawn location and galaxy center on smaller maps (width < 1000).

Code: Select all

dist_from_center = radius + uniform(min(radius * 0.02, 50.0), min(radius * 0.05, 100.0))
radius * 0.02 equals 1 when the width is 1000. So fields would end up very close (1 to 2.5 uu) to the border (and possibly systems). I've added a minimum distance to border of 10.

- Decreased the max growth and shrink amount of Ion Storms.

Code: Select all

effects = SetSize value = Value + min(max(Value * RandomNumber(0.05, 0.1), 1.0), 5.0)
Since the max size of Ion Storms is 50 the min function never did anything so i've replaced 5.0 with 3.0. Molecular Clouds were ok with 5.0 because they can grow larger.
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.

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

Re: Sneaky Ion storms

#4 Post by Vezzra »

Sloth wrote:I haven't changed the max value of "0.00015 * fo.get_universe_width" but it probably should be changed. Doesn't it need a very very large galaxy to kick in (like 10000+ systems)?
Um, no? As you said, an irregular map with 100 systems has a width about 1000, in which case 0.00015 * 1000 would yield 0.15...?
- The fields will start a little larger and added randomization to starting size.
They were hard to notice at size 5.
That was kind of the point ;) My idea was to let them appear as if they gradually brew up in empty space, so I can spawn them close to the map edges without it looking too ackward.
[/code]radius * 0.02 equals 1 when the width is 1000.
I think you lost a "0" here. Width = 1000 means radius = 500, 0.02 * 500 = 10.
I've added a minimum distance to border of 10.
That's fine though, even if it probably never kicks in.
Since the max size of Ion Storms is 50 the min function never did anything so i've replaced 5.0 with 3.0. Molecular Clouds were ok with 5.0 because they can grow larger.
Yeah, right of course. Obviously I wasn't paying attention ;)

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Sneaky Ion storms

#5 Post by MatGB »

Perception, I'm on turn 120ish of my first game with the changes, not added Sloth's most recent yet.

I'm seeing a lot of Ion Storms. Now, I like that there are more than I'm used to, not sure that there should be this many more. On the other hand, it might just be random chance.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Sloth
Content Scripter
Posts: 685
Joined: Sat Mar 17, 2007 12:28 am

Re: Sneaky Ion storms

#6 Post by Sloth »

Vezzra wrote:
Sloth wrote:I haven't changed the max value of "0.00015 * fo.get_universe_width" but it probably should be changed. Doesn't it need a very very large galaxy to kick in (like 10000+ systems)?
Um, no? As you said, an irregular map with 100 systems has a width about 1000, in which case 0.00015 * 1000 would yield 0.15...?
Oops, you are correct. Math failure the first.

In my testing with irregular width 2000 starts at about 300 systems which sounds reasonable.
Vezzra wrote:
- The fields will start a little larger and added randomization to starting size.
They were hard to notice at size 5.
That was kind of the point ;) My idea was to let them appear as if they gradually brew up in empty space, so I can spawn them close to the map edges without it looking too ackward.
Fair enough. But then the distance has to be increased (as my pictures show).
Vezzra wrote:
[/code]radius * 0.02 equals 1 when the width is 1000.
I think you lost a "0" here. Width = 1000 means radius = 500, 0.02 * 500 = 10.
You are correct. Math failure the second. Then it looks like radius + 10 is still not enough.
MatGB wrote:I'm seeing a lot of Ion Storms.
That was also my impression and that's why i changed the spawn rate back to 0.03.

So to sum up what needs to be changed:
Size down again
Safety distance up

I let the next volunteer do the tinkering...
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.

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

Re: Sneaky Ion storms

#7 Post by Vezzra »

MatGB wrote:I'm seeing a lot of Ion Storms. Now, I like that there are more than I'm used to, not sure that there should be this many more.
The relevant line in turn_event.py would be:

Code: Select all

if random() < max(0.00015 * fo.get_universe_width(), 0.03):
The value you need to change to fine tune things is the 0.00015 constant. If you tweak that number be sure to run tests with very small to very large maps to see how that affects different map sizes.
On the other hand, it might just be random chance.
That might be the case. During my testing I very often observed "streaks" - long time no field, then several in a row. Or map areas with only a very few or no fields while others were covered by several fields.

User avatar
Sloth
Content Scripter
Posts: 685
Joined: Sat Mar 17, 2007 12:28 am

Re: Sneaky Ion storms

#8 Post by Sloth »

I encountered a sneaky molecular cloud (Irregular 101 systems):
turn 3.png
turn 3.png (19.95 KiB) Viewed 977 times
This is turn 3 (can't check turn 1 or 2), but even if it spawned turn 1 it must have been very close to Weizsacker already.

So i would suggest raising min distance to border to 50 (and reducing size to 5 again).

Code: Select all

dist_from_center = radius + uniform(50.0, min(max(radius * 0.05, 50), 100.0))
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.

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

Re: Sneaky Ion storms

#9 Post by Geoff the Medio »

The requirement should be a min distance from a system, not (just) from the galaxy centre.

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

Re: Sneaky Ion storms

#10 Post by Vezzra »

Sloth wrote:So i would suggest raising min distance to border to 50 (and reducing size to 5 again).
Geoff the Medio wrote:The requirement should be a min distance from a system, not (just) from the galaxy centre.
Ok, what I've done now is reducing starting size back to 5 again, and implemented Geoffs suggestion to not spawn near systems. Fields spawn at least at a distance of 50 from systems now. That should hopefully be good enough for 0.4.5 (further tweaking can continue of course ;)).

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

Re: Sneaky Ion storms

#11 Post by Vezzra »

Sloth wrote:So to sum up what needs to be changed:
Size down again
Safety distance up
Ok, should be addressed by the changes mentioned above. No more spawning directly adjacent to a system.

User avatar
Sloth
Content Scripter
Posts: 685
Joined: Sat Mar 17, 2007 12:28 am

Re: Sneaky Ion storms

#12 Post by Sloth »

The spawn rate of fields is still too high for small maps. More fields spawn on screen than old ones vanish.

Leading to situations like this (101 stars, turn 200):
Attachments
fields.png
fields.png (371.17 KiB) Viewed 907 times
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.

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

Re: Sneaky Ion storms

#13 Post by Dilvish »

Sloth wrote:Leading to situations like this (101 stars, turn 200):
Um... did you pick the right screenshot? :wink:
I'll agree on the very general point you raise, the number of Fields does still seem a bit too high. But that screenshot looks pretty much fine to me. Maybe the teensiest bit heavy on the Molecular Clouds.
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: Sneaky Ion storms

#14 Post by Vezzra »

Sloth wrote:The spawn rate of fields is still too high for small maps.
Well, as I said before, feel free to experiment with the numbers. The one you need to tweak in this case would be the "0.0003" constant on this line (you've already experimented with that piece of code):

Code: Select all

if random() < max(0.0003 * radius, 0.03):
Try setting it to e.g. 0.0002.
More fields spawn on screen than old ones vanish.
That can't really happen... with that map size at turn 200, things must have consolidated. The age a field can reach is more or less fixed, if they don't dissipate quickly enough, they would accumulate at the map center, which doesn't seem to be the case according to your screenshot.
Leading to situations like this (101 stars, turn 200):
Hm, like Dilvish said, that particular example does actually look quite normal. Anyway, another thing to keep in mind is that the RNG tends to produce streaks. Meaning, it's possible to get none or at least obviously too few fields for quite a lot of turns, and then suddenly a whole lot of them. If however you notice too much fields on average over 200-300 turns, then it's probably necessary to tone down things a bit.

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

Re: Sneaky Ion storms

#15 Post by Geoff the Medio »

Vezzra wrote:
Sloth wrote:The spawn rate of fields is still too high for small maps.
Well, as I said before, feel free to experiment with the numbers. The one you need to tweak in this case would be the "0.0003" constant on this line (you've already experimented with that piece of code):

Code: Select all

if random() < max(0.0003 * radius, 0.03):
Try setting it to e.g. 0.0002.
If the problem is too many spawns on small maps, shouldn't you lower the 0.03?

Post Reply