Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] new tower placement algorithm, fixes bugs and improves #451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sparr
Copy link
Contributor

@sparr sparr commented Sep 28, 2017

This PR introduces a new helper function, Room.getMemoryPathSidewalk(). This produces a path-like list that contains every position on one side of a memorized path. This function is then used to fix the tower/filler/link placement code to avoid the previous problems where there would be gaps between those positions. I also included improvements like using both sides of the road and packing the positions closer together on diagonal roads.

Example of new layout:

Fixes #445

@@ -152,6 +152,93 @@ Room.prototype.getMemoryPath = function(name) {
};

/**
* Returns a pseudo-path including every tile adjacent to one side of the given path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function should be placed in _routing or somewhere else, but not in _memory file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm conflicted. It's theoretically a routing function, but the only place it's currently called is in_memory. I decided to put it here until/unless it gets used somewhere else. I could easily be convinced otherwise.

@sparr sparr changed the title new tower placement algorithm, fixes bugs and improves WIP new tower placement algorithm, fixes bugs and improves Sep 29, 2017
@sparr
Copy link
Contributor Author

sparr commented Sep 29, 2017

Marking this WIP. Will get combined into a single new-base-layout patch to avoid rebuilding existing bases.

@sparr sparr changed the title WIP new tower placement algorithm, fixes bugs and improves [WIP] new tower placement algorithm, fixes bugs and improves Sep 29, 2017
@ghost ghost added the WIP label Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tower link placement mistakes
2 participants