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

0.Interstates #71822

Draft
wants to merge 66 commits into
base: master
Choose a base branch
from

Conversation

Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Feb 18, 2024

Summary

Features "Adds highways"

Purpose of change

The recent additions of forestosity, urbanity and ocean mean that players are more likely to want to travel further now to explore the differing geography

Closes #7534

Describe the solution

Adds region setting controlled highways that spawn in multiple overmap wide straight grids across the very centre of overmaps

Screenshots in Testing section

Merger:

One of the commits is a nice function by @anothersimulacrum so make sure it's not squashed to remove them, just thought I'd add this bc I doubt you'd see in the pile of messy commits '^^

Players:

  • The current maps are 2 OMTs wide and appear every 5 overmaps north/south and 7 east/west with these distances being easily customisable.

  • Highways bridge over lakes and rivers but don't cross oceans.

  • Regular roads cross under/over the highway

  • Currently there's one common special that connects regular roads to highways.

  • Highways are currently disabled in region overhaul mods and the Railroads mod until I add tailored maps and support in follow-up PRs.

Devs:

  • First an offset for the grids is calculated based on the world seed.

  • Next for each overmap it decides whether highway should spawn based on ocean positions and the region setting defined x and y separations modified by the offset. Placement over oceans is disallowed but forces on the overmap before* (see additional content) ocean, so if you set the ocean to be on all sides there would be a square highway around the edge of your island for example.

  • Then highways reserve land before city and special placement and then place appropriate OMTs after this in order to achieve overpasses over cities and so regular roads cross the highway rather than intersect it.

  • Intersection specials are placed when appropriate

  • The road connection special and rest area specials are placed over the reserved highway as part of conventional special placement with very high priority.

  • The region setting defined maps are then placed in width*1 segment specials based on the underlying terrain after city and conventional special placement.

  • This placement places segments based on any of the width tiles containing something of interest and decides the whole segment based on that, ie if one tile is over water the whole segment will be bridge.

  • Finally some OMTs are overwritten with symbolic ones that don't alter the physical map but change the symbol used on the map as well as the flags and name used.

  • The maps can be changed in both appearance and width entirely with JSON (changing width requires changing all the maps though, making width neutral segments would be doable with conditional nests but wouldn't help with intersections/road connections)

  • City streets either place fully crossing under the highway or stop short depending if there's an open OMT on the other side.

  • In order to place overpasses well I've added a new member to each overmap that keeps track of what OMTs belong to cities and fills gaps after finising placement of all cities. Look at this commit if you want to laugh at my awful first implementation of this.

Future scope:

  • I appreciate these highways aren't remotely accurate to life but this is just an initial implementation, in the future I'd like to have highways form interconnected but non continuous networks with deliberate city links and spawning randomly offset from the centre of overmaps, in my head none of these individually require significant change to achieve. If you however have concerns about how this specific implementation might cause problems in the future please raise them below.

  • If we add semi-set city/faction base spawns it should be very easy to guarentee/prevent highways near those similar to how ocean forces/prevents placement.

Describe alternatives you've considered

Not planning:

  • Making the fallback specials conditional nests of the base maps instead but that seemed like it would be very messy

  • I were going to use looks_like to make the highways look like roads but bc roads are linear while highways are just regular maps it defaults to a 0 connected tile road which looks really dumb

  • At first I had all highways at z1 with sloped ground under them and had roads tunnel under them rather than bridge over but decided that looked kinda silly. Having them sometimes spawn like this might be nice however. This change has made the need to handle intersections where the road is already raised though.

  • Placing the OMTs after special placement is unideal as it means specials that should widely ignore placement restrictions like craters and nether monster corpses can't spawn over them. There are various ways to work around this but I'd prefer to keep everything together for now so it's easier to understand (the same reason for example why I'm reserving the water tiles rather than immediately placing the correct OMTs so everything is grouped appropriately)

  • Alot of the special intersections etc OMTs could be replaced with nests but it'd be considerably harder to read, I already have reservations on my use of null tiles dispersed inbetween.

  • City placement could favour starting close to highways when present.

  • Realistically highways would have areas that are close to unnavigable due to pileups which could be mimicked while still remaining navigable by spawning lots of vehicles then applying snaking nests utilising "remove_vehicles" to make a clear path. Currently we lack any way I'm aware of to do this in a scope that makes sense though.

Unsure:

  • Making highways spawn in not full grids based on like a binary noise graph generated from the seed is probably quite doable but seemed unnecessary for an initial implementation. Ensuring good interconnectivety and maintaining general direction might be more challenging and it somewhat defeats the purpose of them if they go in circles or start and end one overmap over etc.

  • The highways can fit an extra lane on flat sections but I like them being separated when raised for the aesthetics at which point they can't fit 3 without increasing the OMT width

  • Nesting the region settings into grid_seperation, reserved_terrain, intersections, symbolic_terrain and segments for example

  • @GuardianDll wants me to make the specials even larger, the clover leaf for example is roughly 330x330 tiles in game whereas they're closer to 500mx500m irl but I wanted to keep them as small as possible while looking sensible so they don't get too in the way of other mapgen and are more likely to be able to be placed

  • Halving/doubling the frequencies based on direction of urbanity increase/decrease but halving them somewhat defeats the purpose of them being to explore the new geography changes easier and doubling them seems a bit severe, a log increase after baseline ubanity could work but it provides less control with the region setting, I guess you could add a way to turn it off.

  • ORTHOGANAL_STRICT flag to prevent road turns under highway altogether.

  • I were manually placing the road connections but our special placement is just about robust enough to spawn them reliably on it's own, infrastructure for being able to set a minimum distance between them in future would be nice though. The only major difference is the number of occurrences can't be tied to the presence and amount of highway in an overmap so minimum occurrences has to be 0 bc otherwise it will moan about failing mandatory placements on overmaps without highway and an excess may spawn when there are less than 4 half highways in an overmap.

Follow-up PRs:

  • CI

  • More map variety in general.

  • I have plenty of ideas for the map under the overpass based on looking at irl NE ones I just didn't want to bog this PR down with more unnecessary maps.

  • Support for ravines and railroad in order to enable highways in Aftershock Exoplanet and the Railroads mods respectively.

  • Maps for region overhaul mods in order to enable highways in them.

  • Varying the offset per row/column of highway so it isn't perfectly central in each overmap should be easily doable.

  • Adding more terrain/furniture to differentiate more between regular roads and highways (ie overhead signs, lights under overpass etc).

  • I have an in-progress PR working on improving stream intersections for vanilla and will likely allow them to pass "under" highways in that.

  • Adding start locations, achievs etc.

  • The new city tracking will allow a much more accurate city_distance rather than a heavily approximated one based on the city size and the centre point which would allow adding an extra road connection special entry that tries to place close to cities.

Testing

Screenshots

image

Basic Map

#########################################################################################

image

Road Bridge

#########################################################################################
image

image

Overpass w/ pic of map to show how the city forms around the highway

#########################################################################################
image

image

image

PRPicClover

Clover Leaf w/ size on map for scale

#########################################################################################
image

image

PRPicTrumpet

Trumpet Intersection

#########################################################################################
image

Bend

#########################################################################################
image

image

PRPicDiamond

Diamond Intersection

#########################################################################################
image

Rest Area Parking

Current bugs:

  • Symbolic ramps are placed on overmap boundaries and at the edge of fallback intersections where there's no actual ramp
  • Occasionally non-city roads pay the extortionate cost of pathing non-straight through the highway, might be able to just "delete" non perpendicular roads in finalize_highways() to get around this

Additional context

Still to do:

  • Upload a exe release to my repo so peeps can test easier

  • Upload aseprite file

  • OMT symbols for all the specials >_< (Apologies in advance to overmap spriters)

  • @I-am-Erk is there a better way to tell when the oceans will occur than just using the region setting values? The current way works reliably but is overly conservative and stops several overmaps early in some cases, if there's a more accurate but still reliable method that'd be great. Depending how lakes work I wouldn't mind using the same avoidance technique for lakes in a follow-up PR bc obviously them crossing large lakes or even having intersections on lakes is dubious at best.

  • The region settings should be entirely optional if the external option is set to false

  • Ensure ramps always appear where expected

  • Mess with polish_river() to get the best result I can manage without major changes

  • Basic vehicle/zed/item spawns (not that much effort bc I already did lane based placement for vehicles in the JSON road PR)

  • special_field_highway more OMTs adjacent to specials where it looks silly if a building spawns

  • Improve symbolic OMTs on overmap edges?

  • Make some of the lambda functions private regular functions for readability?

  • Rename stuff that's changed use (ie place_highways) and reorganise stuff (also typo fix seperation -> separation), remove now unused code (road connection hardcoded placement, HIGHWAY_SPECIAL flag)

  • Check city road code still works after tweaks to specials and flags

  • Check documentation matches final functionality and naming

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods: MA Massachussetts mod. Cata in one state Game: Defense Mode Special game mode, only accessible via main menu Mods: Innawood 🌲 Anything to do with Innawood mod Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods: Desert Region Anything relating to the Desert Region mod <Enhancement / Feature> New features, or enhancements on existing labels Feb 18, 2024
@Procyonae Procyonae changed the title ~~0.Highways~~ 0.Interstates 0.Interstates Feb 18, 2024
@IdleSol
Copy link

IdleSol commented Feb 18, 2024

This will be interesting to watch in the game.... I guess.

Have you raised the question of increasing the default distance between cities? Say from 4 to 5, maybe 6?

stop_when_chosen_offet++;
}
}
debugmsg( "Failed to seed highway offset with chosen value %s and expected max %s", chosen_offset,
Copy link
Member

Choose a reason for hiding this comment

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

Both parameters are integers so %d should be used here

Suggested change
debugmsg( "Failed to seed highway offset with chosen value %s and expected max %s", chosen_offset,
debugmsg( "Failed to seed highway offset with chosen value %d and expected max %d", chosen_offset,

@fairyarmadillo
Copy link
Contributor

Amazing. I was just wishing we had these!

@Procyonae
Copy link
Contributor Author

Have you raised the question of increasing the default distance between cities? Say from 4 to 5, maybe 6?

I don't see how that's particularly relevant to this PR, this makes traversal of multiple overmap distances easier not distances between cities

@IdleSol
Copy link

IdleSol commented Feb 18, 2024

I don't see how that's particularly relevant to this PR, this makes traversal of multiple overmap distances easier not distances between cities

Just in case, I'll clarify what I said about settings. Parameter: city spacing.

The logic is as follows.

  1. We get new good roads. And most importantly, they're straight. You can get the maximum speed and maintain it not for a couple of minutes, but much longer.
  2. You may disagree. But the distances between cities are too small now. Moreover, interesting locations are also close by. What's the point of traveling somewhere far away? Another city, another lab. The ocean? Look at it and forget it.
  3. Changing the "city spacing" parameter will increase the distance between cities and, as I understand it, increase the distance between points of interest.
  4. The result is that the places of interest are farther away, the speed of travel is faster. The player will spend about the same amount of time. And the world will become more real.

So, in my opinion, new roads and distances between cities are interconnected.

P.S. I hope I didn't mistranslate anywhere.

@Procyonae
Copy link
Contributor Author

Procyonae commented Feb 18, 2024

  1. We get new good roads. And most importantly, they're straight. You can get the maximum speed and maintain it not for a couple of minutes, but much longer.

There will still be vehicles on the road you won't be safely barrelling down the road at 100mph. The number of vehicles will probably be comparable to regular roads to begin with both because that's an amount that works and hopefully won't require too many line changes from the vehicle placement JSON I wrote for them so this PR saves on some bloat. I'll make sure auto drive works pre merge too.

  1. You may disagree. But the distances between cities are too small now. Moreover, interesting locations are also close by. What's the point of traveling somewhere far away? Another city, another lab. The ocean? Look at it and forget it.

Changes are pushing for more content further away from spawn with urbanosity leading to varying city sizes to explore that can contain different buildings set by city_sizes on the buildings special, oceans will likely have unique content by 0.Is release and hopefully at some point more region stuff will be pushed forward.
Erk is also suggesting adding semi set faction base and city locations which will heavily encourage long distance exploration #70056

Personally I don't think the default city distance is bad but I wouldn't be opposed to it changing either, I just don't think this PR does anything that warrants a change to it.

  1. Changing the "city spacing" parameter will increase the distance between cities and, as I understand it, increase the distance between points of interest.

Mostly correct, most specials rely on being in a range of distances away from the nearest city so increasing the distance between cities will leave more "gaps" where nothing that tried to spawn could because it was too far from a city, though things with larger minimum distances would be more likely to succeed in spawning.

@IdleSol
Copy link

IdleSol commented Feb 18, 2024

There will still be vehicles on the road you won't be safely barrelling down the road at 100mph

But it's still faster than on a normal road. It's all about braking in time.

I'm concerned about the issue of roadblocks. More specifically, robots with a grenade launcher at +1 level and a player at 0 level. Will the character be able to see the danger? Will the robot fire? And where will it shoot to. (Shoot through the roadway?)

@Procyonae
Copy link
Contributor Author

I'm concerned about the issue of roadblocks. More specifically, robots with a grenade launcher at +1 level and a player at 0 level. Will the character be able to see the danger? Will the robot fire? And where will it shoot to. (Shoot through the roadway?)

Are... are we playing the same game? There are no grenade wielding robots and there aren't any robots on the surface nowadays. Also your character doesn't level and I've no idea how this has anything to do with what I said, think deep translate got confused translating one of us.

@IdleSol
Copy link

IdleSol commented Feb 19, 2024

You're right. I should be more accurate.

robots with a grenade launcher = riot control platform (M203A)

at +1 level = I was talking about 1 level above the ground, z=1.
at 0 level = surface or z=0.

Can a roadblock appear at z=1? (debug menu / m /m / 8)

@IdleSol
Copy link

IdleSol commented Feb 19, 2024

I made a little testbed. To be honest, I'm not sure everything is accounted for.

z=0
1

z=1
2

Character (z=0) looks up (z=1)
3
4

Character, can't see the platform. Platforms do not see the character. But if you get up close and stand on the tiles marked by the target.
5

Both the character and the platform see each other. Moreover, the platform hits the character.

And if you pay attention, you can see the casing from the other platform, but you can't see the platform itself. How normal that is, I don't know. Maybe it's a bug?

UPD.
Did I understand correctly that the 3D view takes into account the character's height? And monsters have no height, so for the game it is 0? In fact, they are flat? So they can only see on neighboring squares. Should we create a new topic? (bug or issue?)

@IdleSol IdleSol mentioned this pull request Feb 20, 2024
@Procyonae
Copy link
Contributor Author

I won't be adding roadblocks to highways in this PR regardless as to whether there's issues with it currently

@kevingranade
Copy link
Member

This is hopefully mostly orthogonal to the rest, but a regular grid shape for highways isn't going to work, and highways that go straight over towns are also a problem. It's just too big a departure from actual highways.

This needs some randomization, and it needs to avoid driving through towns.

@Procyonae
Copy link
Contributor Author

This is hopefully mostly orthogonal to the rest, but a regular grid shape for highways isn't going to work, and highways that go straight over towns are also a problem. It's just too big a departure from actual highways.

This needs some randomization, and it needs to avoid driving through towns.

What's your problem with towns specifically? Most large NE cities appear to have highways running through them. I'm purposefully avoiding "avoiding" stuff bc variable multi tile wide pathing is beyond my abilities, I can make cities with a small size stop at the highway rather than cross it so it's like the highway bypasses the city if your problem is with them intersecting "towns" but the way they cross cities is one of the few cool things about this implementation so I'm pretty confused.

I were leaving randomisation for a follow up PR as stated bc I'm dumb and it'll likely introduce more bugs and make reviewing harder but I'm working on it now.

@kevingranade
Copy link
Member

Regarding randomization, a big reason I want something decent in place at the outset is anyone that plays with this merged is going to have their highways terminally broken any time we change highway layout, so the impact of "just merge this and fix it later" is very high for early adopters.

I'm not just talking about picking different x and y values for highways, unless it's impossible I really want some meandering happening, and that is likely to have some impact on how things are done overall. I understand diagonal highways would be its own special level of hell, so I know that's pretty unlikely, but it should at least be possible to have highways appear anywhere within an overmap, and occasionally change direction.

Most large NE cities appear to have highways running through them.

"Through" is different from "every time a highway encounters a built up area it plows straight through". Going over or through a town is a last resort for a highway and is only common in large cities (which we don't even have) where the size of the city itself makes this impossible.

@esotericist had a good idea (I can't remember where) of laying down the highways and then having the cities avoid them instead, which might be much simpler. It's not like our city placement is in any way sophisticated. Mega cities, when they arrive are going to be unable to do so, but that's fine since they're too big to avoid highways anyway. Plus we're likely to want to put a highway ring around or inside mega cities anyway.

@Procyonae
Copy link
Contributor Author

Regarding randomization, a big reason I want something decent in place at the outset is anyone that plays with this merged is going to have their highways terminally broken any time we change highway layout, so the impact of "just merge this and fix it later" is very high for early adopters.

That's fair, though the method I were considering for randomisation wouldn't actually have had this problem

I'm not just talking about picking different x and y values for highways, unless it's impossible I really want some meandering happening, and that is likely to have some impact on how things are done overall. I understand diagonal highways would be its own special level of hell, so I know that's pretty unlikely, but it should at least be possible to have highways appear anywhere within an overmap, and occasionally change direction.

This is currently what I were planning on a large scale (a 3x3 square is an overmap, light blue is the highway grid, grey is an example of placed highway), highways to be randomly determined but still locked to a grid so there's no need for distance calcs to keep it simple. On a local scale the individual rows and columns will each have their own x/y offset within the overmap rather than going through the centre.
Example Rando Highway-export

If that's not enough I can drop the grid entirely and precalc a load of highway on a multiple overmap scale which would probably be harder to get right, less easily maintainable and more computationally demanding but could look more realistic if tuned right.

They could potentially meander within an overmap too using bends (changing the offset for that row/column when they do) but that seems pretty extra for now.

If I thought diagonal highways would really add anything I would've added them I just don't think they're really worth it.

"Through" is different from "every time a highway encounters a built up area it plows straight through". Going over or through a town is a last resort for a highway and is only common in large cities (which we don't even have) where the size of the city itself makes this impossible.
@esotericist had a good idea (I can't remember where) of laying down the highways and then having the cities avoid them instead, which might be much simpler. It's not like our city placement is in any way sophisticated. Mega cities, when they arrive are going to be unable to do so, but that's fine since they're too big to avoid highways anyway. Plus we're likely to want to put a highway ring around or inside mega cities anyway.

So that's a no-go on making it dependant on the city size parameter or a combination of size + urbanity? Making it so cities avoid them shouldn't be particularly difficult bc they already determine placement before cities while making it so cities stop at them is trivial.
If it is a no should I comment out the relevant code or just remove it entirely?

@kevingranade
Copy link
Member

This is currently what I were planning on a large scale

What jumps out at me is the disconnected sections, unless I'm misreading it. Is that really a part of the plan or just a result of throwing an example together?

Regardless, that "once every n overmaps" thing is going to be really noticeable even if it's obfscucated with the highways meandering back and forth as they cross overmaps.

Side note, looking at real maps, one every 3-4 overmaps is incredibly close together, one every 8-10 overmaps is a more representative frequency.

Talking implementation, what is the generation process you have in mind?

After some thought (and some dead ends) I think I have an idea. Divide up the map into a square grid of points, each point has an origin with a regular period, just for the sake of example say one every three overmaps. For each point you calculate some noise function based on the x coordinate to generate an x offset and a noise function based on the y coordinate to generate a y offset. The origin plus the offsets gives you the actual coordinate of a highway intersection. Since the noise functions are selected to not change value rapidly, you get mostly horizontal or mostly vertical highways, but over long distance they can still meander within ax wide range so it doesn't look like a regular grid.

All each overnap needs to do is calculate the coordinates of the 4 nearest intersections and raster lines between them, checking if they go through the current overmap.

Another way to describe this is that you're drawing a bunch of horizontal lines and a bunch of vertical lines independently (as defined by the x and y offsets).

Some background on this kind of thing here https://www.redblobgames.com/articles/noise/introduction.html

@I-am-Erk
Copy link
Member

I-am-Erk commented Mar 4, 2024

Kevin: to be fair, the initial implementation of highways that I'd been considering was more or less a straight grid as well.

Procyonae, what you might consider is just a bit of random walk, giving the highway like a 1/20 chance each tile of deflecting one OMT off course, possibly increased to 1/10 if the highway is traveling through forest? I haven't looked at your code to see how hard this would be.

I agree that the highways should ideally be laid down before cities, and avoided by cities, for the moment. Eventually we could look at city mapgen and see how hard it would be to have highways become "sticky" and put different stuff like fast food and gas stations along the highway if it's close to a city... I don't think that would be too difficult from what I remember of city gen, but it should be a "later" thing.

Oh and I unfortunately don't have a cleverer way of detecting ocean for you, that was a problem for me as well

@kevingranade
Copy link
Member

Potentially we can get this unblocked with a default-off option to draw the highways that we remove once we have them wandering around the way we want them, that eliminates my concerns about producing saves that will break on future versions of the algorithm.
What you have already here is a huge amount of wonderful work on road layouts that I really, really want in the game

@Procyonae
Copy link
Contributor Author

I'm not abandoning this I just needed a break, I maintain motivation by jumping between things but once I'd started this I didn't do any other PRs so I burnt out, going to do a couple of smaller PRs and then I'll read that link you sent and look at implementing it

@anothersimulacrum
Copy link
Member

Merger:

One of the commits is a nice function by @anothersimulacrum so make sure it's not squashed to remove them, just thought I'd add this bc I doubt you'd see in the pile of messy commits '^^

I don't care if that commit gets squashed in with the rest.

@Procyonae
Copy link
Contributor Author

Potentially we can get this unblocked with a default-off option to draw the highways that we remove once we have them wandering around the way we want them, that eliminates my concerns about producing saves that will break on future versions of the algorithm.

It's already controlled by an external option so I could make it false for now in vanilla and add a mod that just toggles them on with all the files remaining in vanilla so nothing would need moving later with a WIP title and description making it obvious they're likely to change and "break" when updating. GuardianDLL has also been pushing me to increase the number of lanes which I'd like but I think that will become very disruptive for other mapgen while starting it as a mod would allow trialling larger highways down the road. I'd also prefer some sensical solution to lakes but I'd rather not try to deal with that in this PR.

@Procyonae
Copy link
Contributor Author

I agree that the highways should ideally be laid down before cities, and avoided by cities, for the moment.

Highways already reserve the space before city placement I just need to disable or add a city size + urbanity check to the code explicitly allowing cities to route through them so that's trivial.

@Procyonae
Copy link
Contributor Author

As an unrelated note I could also use a city size + urbanity checks alongside #72725 to allow us to have different road maps (or just ids for differently placeable extras) for "villages"/"towns"/"cities" etc which could be cool.

@Procyonae
Copy link
Contributor Author

After some thought (and some dead ends) I think I have an idea. Divide up the map into a square grid of points, each point has an origin with a regular period, just for the sake of example say one every three overmaps. For each point you calculate some noise function based on the x coordinate to generate an x offset and a noise function based on the y coordinate to generate a y offset. The origin plus the offsets gives you the actual coordinate of a highway intersection. Since the noise functions are selected to not change value rapidly, you get mostly horizontal or mostly vertical highways, but over long distance they can still meander within ax wide range so it doesn't look like a regular grid.

All each overnap needs to do is calculate the coordinates of the 4 nearest intersections and raster lines between them, checking if they go through the current overmap.

I understand this but having thought on it I think I'd prefer something a bit less orderly (and that doesn't require pathfinding). My current idea is similarly predeterming placement in a wide area to make it easier to seed but only choosing a single origin point which will have a 4-way intersection and then following each branch of that to the edge of the "superovermap" changing path if it collides with itself or an obstacle like lake/ocean and then adding extra bits of highway if large areas of the "superovermap" lack highway until it's got enough.
I'm planning on having urbanity both factor into how much it meanders+splits as well as the threshold on more highway being added.
Here's a rough idea of what it would look like except obviously more spread out than this, with the blue grid lines representing overmap boundaries, blue representing a lake and ocean, yellow being the origin and red/green being rejected bits and their rechosen paths:
image
And a very basic example of adding more splits to fill in gaps (again this would be more spread out):
image

To make it spread out I'll track how many overmaps it's travelled since a split/bend and change the rates based on that to avoid double backs etc, with the origin being treated as a split so it's unlikely to immediately fold on itself. The "fill in" bits would probably also have rates diminished based on how large an area is left over the threshold. It might also need handling to prevent parallel highways especially at the ocean edge but that could probably come later and shouldn't be too intrusive to the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Game: Defense Mode Special game mode, only accessible via main menu [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods: Desert Region Anything relating to the Desert Region mod Mods: Innawood 🌲 Anything to do with Innawood mod Mods: MA Massachussetts mod. Cata in one state Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Highways do not spawn
7 participants