Worm 22 starting position

Dear Entelect,

I have noticed that for most of the start map, that the world is very symmetrical, except for worm 22.
It looks like worm 22 start position should move 1 position to the left.

1 Like

Hi @kuifie

You are correct, looking at the source code for the map generation, line 74

     * Create circle with equidistant seats placed on the circle.
     * Returns the MapCell for each position
    private fun getCirclePositions(blankMap: List<List<MapCell>>,
                                   radius: Double,
                                   count: Int,
                                   tilt: Double = 0.0): List<MapCell> {
        return (0 until count)
                .map {
                    val t = 2.0 * PI * (it.toDouble() / count.toDouble()) + tilt
                    val x = radius * cos(t) + mapCenter.first
                    val y = radius * sin(t) + mapCenter.second
                    getCellAt(Point(x.roundToInt(), y.roundToInt()), blankMap)!!

It seems that the maths here for parameterizing the circle introduces some asymmetry on the worm positions. I believe the rounding to integers could be at fault here, and would require a kind of revolving reference frame to do floor / ceil depending on the orientation at that point.

1 Like

Greetings @kuifie

We have a fix in place for this issue, but it will only be available after going through review and release. We thank you for highlighting this, you can also get some more info about this on the pull-request.


@pierre.roux ,
Thank you for the quick response! Much appreciated.

1 Like