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] move pathStart from first pos near storage to best #432

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

Conversation

sparr
Copy link
Contributor

@sparr sparr commented Sep 23, 2017

pathStart was previously placed at the first available (in direction order) location adjacent to the storage. let's switch that to the location with the most adjacent open spaces to avoid some traffic jams.

Copy link
Contributor

@samogot samogot left a comment

Choose a reason for hiding this comment

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

I'm not sure this will help for traffic jams, as all open spaces will anyway be filled with extensions.
From the other hand, this will cause rebuilding of layout core for most active rooms, and may potentially affect possibility of choosing good storage filler position, which really needs a lot of free space around

@sparr
Copy link
Contributor Author

sparr commented Sep 23, 2017

@samogot the traffic jam this aims to address is the one where pathstart is stuck in a corner so every path comes from there, leading to a lot of overlapping/intersecting paths that don't need to be.

Here's a layout with pathstart north of storage which leads to every path overlapping at the spot northwest of storage. This patch moves that pathstart to southwest of storage.

https://i.imgur.com/n9lAhYd.png

Causing rebuild of existing layouts is not great. Maybe this patch should also introduce some way to version room layouts, remember how to make old versions, and not rebuild existing rooms unless it's intentional?

I'm going to make a later PR about moving storage further from walls, so that would address the storagefiller concern separately.

@samogot
Copy link
Contributor

samogot commented Sep 23, 2017

I'd never choose such room)) It's obvious that source near to controller will cause problems and needs some special handling.

@sparr
Copy link
Contributor Author

sparr commented Sep 23, 2017

It's obvious that source near to controller will cause problems and needs some special handling.

You mean it's obvious that source near to controller will save CPU and reduce creep count and be more efficient, and require special handling like #435 ? :)

@TooAngel
Copy link
Owner

Regarding the room layout versioning.

version: 19,

There is already a versioning in place, but as soon as the room layout is renewed the new version will be used, force a rebuild by increasing the version

@sparr
Copy link
Contributor Author

sparr commented Sep 23, 2017

I'm thinking of versioning each room, and not updating rooms by default, unless a config option is set to update all rooms, or a single room has its version manually bumped.

@TooAngel
Copy link
Owner

The current logic is:
When the layout is generated the current version is stored.
If the room version and the config version differs, the layout is redone.
If we make sure the room layout is only built the first time the room is used (I'm currently not so sure this is the case).

I think this should be similar to your idea?

@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 move pathStart from first pos near storage to best WIP move pathStart from first pos near storage to best Sep 29, 2017
@sparr sparr changed the title WIP move pathStart from first pos near storage to best [WIP] move pathStart from first pos near storage to best 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.

3 participants