This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Opened 6 years ago

Last modified 3 years ago

#5092 closed defect

ClumpPlacer seems to use incorrect formula to determine if placement failed for a given failFraction allowed. — at Version 1

Reported by: Inari Owned by:
Priority: Should Have Milestone: Alpha 26
Component: Maps Keywords:
Cc: Patch:

Description (last modified by Inari)

To check if placement has failed, ClumpPlacer allows to pass a failFraction to allow partial placement to still count as success. (ps/trunk/binaries/data/mods/public/maps/random/rmgen/placer/centered/ClumpPlacer.js#L103)

The formula to check if placement has failed seems a bit off though. It keeps track of a failed variable, increasing that by 1 each time a point fails to put.

In a quick test for an area with size 1200 there seem to be roughly 13500~15500 points that it attempts to put. It varies a bit because of the randomness involved in the placement.

So it can't just check that failed variable against the size multiplied by failFraction. It should instead keep track of how many points it tried to put and multiply that count by failFraction to check against failed.

ChainPlacer seems to do this already (ps/trunk/binaries/data/mods/public/maps/random/rmgen/placer/centered/ChainPlacer.js#L110).

This is also why #4810 seemed to be an issue, originally it passed a failFraction of 1, allowing for placement to proceed in any case. But that seems to not have worked as intended.

Change History (1)

comment:1 by Inari, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.