Multiple specials on one planet #7311

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.
Post Reply
Message
Author
User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Multiple specials on one planet #7311

#1 Post by MatGB »

Vezzra, is the new specials placement python script meant to give three specials on a planet? It was mostly always just one, when Dilvish fixed the probability thing that stopped ruins &c appearing regularly it went up to occasionally two, but three in one place?

(16 AIs, been a bit, um, frantic...)
Attachments
multi-specials-settings.png
multi-specials-settings.png (31.64 KiB) Viewed 534 times
multi-specials.png
multi-specials.png (98.5 KiB) Viewed 534 times
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
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Multiple specials on one planet #7311

#2 Post by Vezzra »

MatGB wrote:Vezzra, is the new specials placement python script meant to give three specials on a planet? It was mostly always just one, when Dilvish fixed the probability thing that stopped ruins &c appearing regularly it went up to occasionally two, but three in one place?
The Python implementation should be functionally identical to the original C++ implementation. Two specials should occur very rarely, but still, three specials are extremely unlikely but not impossible. After a special has been added to a universe object, there is a 8% chance that another try is made to add one. So you see, out of 100 planets which got one special, there are an average of 8 planets with two, and out of 100 planets with two specials (meaning we need ~1200-1300 planets with one special), there is an average of 8 planets with three specials and so on. That means theoretically there could even be more than three specials on a planet, but the unlikeliness for that increases exponentially with each additional special.

If you feel like experimenting, create a 5000 systems map with high planets and high specials... :D

However, if that behaviour is not desired, that is, there shouldn't be ever more than two specials on a planet, that could be done very easily.

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

Re: Multiple specials on one planet #7311

#3 Post by MatGB »

OK, 300 systems, low planets, 232 planets including belts and giants
medium specials 86 single specials placed (including derelicts to systems), 3 planets with 2, 1 with 3.

Given I don't recall ever seeing 3 on one planet before, take it the maths on that rarity is just, finally, giving me a random one, the number with 2 on looks roughly right. That makes sense.

I'm not sure on the balance of having three plus specials, given how rare it'd be it might be worth taking it out entirely, partially as three on one place makes that a nice place to grab, partially as there's a higher chance of insanely powerful sentinel/sentry combinations that we probably want to avoid.

Ok, thx for answer, I'll keep an eye on the numbers more but it looks about right.
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Multiple specials on one planet #7311

#4 Post by Dilvish »

Vezzra wrote:The Python implementation should be functionally identical to the original C++ implementation.
Er, I might not have really tried to keep this 100% identical -- I had some recollection of having occasionally earlier seen multiple specials, liked the idea, and so had enabled it when I fixed a distribution problem in the python specials code, but I think the chance of multiplicity was no longer in the c++ implementation at that time (and I couldn't absolutely guarantee it ever was in the c++).
Two specials should occur very rarely, but still, three specials are extremely unlikely but not impossible. After a special has been added to a universe object, there is a 8% chance that another try is made to add one. So you see, out of 100 planets which got one special, there are an average of 8 planets with two, and out of 100 planets with two specials (meaning we need ~1200-1300 planets with one special), there is an average of 8 planets with three specials and so on. That means theoretically there could even be more than three specials on a planet, but the unlikeliness for that increases exponentially with each additional special.
(emphasis added.) Unless I'm misremembering, those tries are dependent on spawn rate and therefor often fail; I believe the odds of 2 or 3 specials are even significantly lower than what you cite.
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: Multiple specials on one planet #7311

#5 Post by Vezzra »

Dilvish wrote:Er, I might not have really tried to keep this 100% identical -- I had some recollection of having occasionally earlier seen multiple specials, liked the idea, and so had enabled it when I fixed a distribution problem in the python specials code
You did? I must have missed that completely - are you sure you're not confusing that with something else? Because I can't recall that there has been a problem with the specials distribution since I've ported that to Python (which isn't that long ago anyway - maybe three weeks?), and that you did anything to fix it.
but I think the chance of multiplicity was no longer in the c++ implementation at that time (and I couldn't absolutely guarantee it ever was in the c++).
Well, as I just said, I moved specials distribution to Python only maybe three weeks ago, the 8% chance of multiplicity definitely was there in the C++ code, and I replicated that behaviour in Python.

Could it be that you fixed some issues with specials distribution not in Python, but in the C++ code before the migration? Then of course it could be that is was you who introduced that 8% chance in the C++ code :D
Unless I'm misremembering, those tries are dependent on spawn rate and therefor often fail; I believe the odds of 2 or 3 specials are even significantly lower than what you cite.
Yes, of course you're right. Correct is, that out of 100 planets who got one special for 8 of them the algorithm tries to add another special, which means another special is only added if the spawn rate test succeeds.

And out of 100 planets who actually got two specials, for 8 of them the algorithm tries to add a third one, etc.

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

Re: Multiple specials on one planet #7311

#6 Post by Dilvish »

Vezzra wrote:Could it be that you fixed some issues with specials distribution not in Python, but in the C++ code before the migration? Then of course it could be that is was you who introduced that 8% chance in the C++ code :D
Ah, yes, I guess that was it -- you had started the migration to python, and due to a somewhat quirky interaction between the specials code and your python code, the C++ code was no longer giving a reasonable distribution. So I associated the rewrite with the python migration but really it was in the C++.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply