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

Intercity road placement improvements #53

Open
mayant15 opened this issue Aug 25, 2019 · 1 comment
Open

Intercity road placement improvements #53

mayant15 opened this issue Aug 25, 2019 · 1 comment

Comments

@mayant15
Copy link
Contributor

There are two major issues with road placement at this point.

Building-Road Interactions

Currently, it is possible that a building will be spawned right on top of a road. There are two reasons for this. The first is that settlements seem to be expanding beyond the limits set in settlementMaxRadius. This means that the roads which should have been outside the city limits would eventually come inside.

The second problem is that the check for obstructions while placing buildings doesn't work for roads. The check is in SettlementEntityManager here and the main cause would most probably be in the isNotIntersecting function from ParcelList here.

Save Road Heights to RoadSegments

Each RoadSegment should have a height stored at which the segment will be laid down. This height should depend on the surface height in the world. Currently this height is a constant value set here. This leads to trouble with roads on mountains as roads create a chasm as they go through a mountain. Try looking at the flatten function in Construction to see if it helps to find surface heights.

@skaldarnar
Copy link
Contributor

Notes from #25:

This involves adding dynamic road creation with generators found within the static cities module. The main task is to transform the facet based road creation, which creates roads at world generation, into one which places roads during playtime.
A similar technique used for the transformation of facet based building creation can be applied here.
Suggested steps are as followed:

  1. Create rules for what cities should be connected. A good approach can also be found in the StaticCities module here

  2. Create a road object containing all the road segments akin to the StaticCities road creation.

  3. Create a rasterizer which does the same stuff as the original but uses the BufferRasterTarget for actual block placement

It probably makes the most sense to save the road object to the corresponding city entity to which it connects. This will allow to check for overlap when placing new buildings/stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants