Port the old procedural block prevention code #26
Labels
No labels
bug
improvement
needs testing
new feature
pondering
priority
high
priority
low
priority
normal
priority
shelved
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nexustix/godot-nexustix-utilities#26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When solid features that block movement around the level are placed there is a chance of making a level unbeatable. An approach that has been viable in older iterations was to locally check if placing a solid features would cause a disconnect between two areas. Following heuristic has proven functional
First the surrounding tiles of a target (X) are fetched, unwrapped, and put into an array:
Second it will be counted how many distinct sections this array has (looping at the ends of the array), by looping over it and increasing a counter whenever the polarity (solidness) of a cell flips:
If There are more than 2 polarity changes (sections) then placing a solid feature at the target has a chance to make the level unplayable.
Port the old procedural gen block prevention codeto Port the old procedural block prevention code