So, after Ophiuchus' answer, I believe that I found the code responsible for Field creation ?
Code: Select all
if random() < max(0.00015 * radius, 0.03):
field_type = choice(field_types)
size = 5.0
x = y = radius
dist_from_center = uniform(0.35, 1.0) * radius
angle = random() * 2.0 * pi
x = radius + (dist_from_center * sin(angle))
y = radius + (dist_from_center * cos(angle))
print("...creating new", field_type, "field, at distance", dist_from_center, "from center")
if fo.create_field(field_type, x, y, size) == fo.invalid_object():
print("Turn events: couldn't create new field", file=sys.stderr)
(with
radius = fo.get_universe_width() / 2.0 before in the Python file)
The Field creation happens with fo.create_field, which is called only in a test.
IIRC in Python, calling it in a test actually calls it (I mean, testing if fo.create_field () == something means that fo.create_field is executed, and then its result tested against the "something" condition) ?
Is the fo.create_field function also Python or C++ ?
So a field is indeed created once at a time, but not once a turn, once each time the random number generator gets under 3% or under universe_width*0,00015. Which means that to reach once a turn universe_width must be over 6000 (what's the unit for universe_width by the way ?).
Why does it initialize x and y with the "radius" value and then never uses it before re-initializing them with a more sensible value ?
Is there a problem in the RNG ? Because the code should not bring multiple fields at the same starting location, while in game that is what seems to happen...