Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upOvermap overhaul (step 8) #21620
Conversation
codemime
added some commits
Jul 21, 2017
codemime
force-pushed the
codemime:omap_over_n9
branch
to
d5ed8b6
Aug 13, 2017
This comment has been minimized.
This comment has been minimized.
|
In the first example, the roads on the left side of the river don't connect to the right side at all, except to dead end at specials. May be outside the scope of this PR, but they should probably always try to connect across the dividing river. |
This comment has been minimized.
This comment has been minimized.
|
They probably do connect (down there, beyond the lower edge of the screen). However, connecting dead ends that are close enough to each other is a good idea. |
This comment has been minimized.
This comment has been minimized.
Does it cover all cases? |
Coolthulhu
reviewed
Aug 15, 2017
| @@ -1229,6 +1238,11 @@ oter_id &overmap::ter(const int x, const int y, const int z) | |||
| return layer[z + OVERMAP_DEPTH].terrain[x][y]; | |||
| } | |||
|
|
|||
| oter_id &overmap::ter( const tripoint &p ) | |||
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Aug 15, 2017
Contributor
Are you using it as non-const? Would be better to scrap the non-const getters and use setters instead, to make more proper encapsulation possible.
This comment has been minimized.
This comment has been minimized.
codemime
Aug 15, 2017
Author
Member
Agreed, but I didn't invent this approach here, merely added an overloaded version of the function. I guess, references could improve performance under certain conditions, since both getting and setting the value perform the same steps which involve checking bounds and calculating indexes. However, the impact is probably unnoticeable.
This comment has been minimized.
This comment has been minimized.
Good catch! I've missed that. Will fix. |
Coolthulhu
self-assigned this
Aug 17, 2017
Coolthulhu
merged commit 2cba5c9
into
CleverRaven:master
Aug 17, 2017
codemime
deleted the
codemime:omap_over_n9
branch
Aug 17, 2017
Leland
referenced this pull request
Aug 19, 2017
Closed
Cities generate in swamps, but fail to place buildings #21497
BorkBorkGoesTheCode
referenced this pull request
Sep 1, 2017
Closed
Have the recent overmap improvements affected Mining Mod in any way? #6
This comment has been minimized.
This comment has been minimized.
|
Having strange behavior in #21809, subway connections in specials are being connected with sewer lines instead. I think I tracked it down to overmap_connections::guess_for()... It is returning the first overmap_connection entry that is underground? I simply reversed the order of subway_tunnel and sewer_tunnel in the json and it started working as intended. |
codemime commentedAug 13, 2017
•
edited
Continues #21563.
One step closer to #19298 (see my comments there).
Observable behavior
Note how the roads reasonably avoid swamps and forests:

The swampy bank of the river isn't a good place for the road, so it goes around:

Terrain-specific road types can now be defined:
riverlocations).What can be done in the future:
Implementation details
polishany connections (roads, sewers, subway tracks, ant tunnels, e.t.c). They are built perfectly connected initially. So thepolishfunction now governs only rivers (5 lines of code). This is probably faster, but I didn't measure the difference.ORTHOGONALwhich produces more angled connections (with fewer turns). It's used to make subway and sewer tunnels.ALLOW_OVERRIDEwas, in turn, removed. There's no need for it anymore: the connections themselves "know" which locations they can/cannot override.pathobjects (the class will be extended later on).lay_out_connection) now precedes the actual building of them (build_connection).paths (from specials to cities, not vice versa). This will be useful to make country roads (that lead from cabins and farms).