Commit a93c7a5
authored
Merge pull request #493 from memo33/redundant-adjacencies-removal
[DLL] Remove redundant RUL2 adjacencies
For integration with the DLL-based RUL2 engine, this PR aims to remove a lot of RUL2 code made redundant by the adjacency handling of the DLL.
### DLL-based adjacencies in a nutshell
Whenever you have two adjacent tiles `A | B`, the engine looks for an _orthogonal_ surrogate tile `S` and matching RUL2 rules `A | S ⇒ A' | S'` as well as `S' | B ⇒ S" | B'` that make an override carry over from `A` to `S` to `B`. It then applies the result to the original tiles `A | B` directly, effectively applying a "virtual" rule `A | B ⇒ A' | B'`.
This means you only need to write RUL2 code that connects to pure orthogonals (in and out), but no adjacencies.
Diagonals work similarly, except they use _two_ _diagonal_ surrogate tiles. The effect is the same in that you only write RUL2 code connecting to pure diagonals (in and out).
(The orthogonal and diagonal surrogate tiles are chosen from a hard-coded list of IIDs.)
### Goals of this PR
- [x] Write a [script](https://github.com/NAMTeam/Network-Addon-Mod/blob/7d2db2d9e33ec8f16ee0fc8a316c83d6123aa600/src/main/scala/scripts/RedundantAdjacenciesChecker.scala) to identify redundant RUL2 code (i.e. covered by DLL + other RUL2 code).
- [x] Remove adjacencies from metarules:
- [x] [FlexFlyRuleGenerator](https://github.com/NAMTeam/Network-Addon-Mod/blob/staging/src/main/scala/module/flexfly/FlexFlyRuleGenerator.scala)
- [x] [OST generator](https://github.com/NAMTeam/Network-Addon-Mod/blob/staging/src/main/scala/module/onslope.scala)
- [x] [RhwRuleGenerator](https://github.com/NAMTeam/Network-Addon-Mod/blob/staging/src/main/scala/module/RhwRuleGenerator.scala)
- [x] [RealRailwayRuleGenerator](https://github.com/NAMTeam/Network-Addon-Mod/blob/staging/src/main/scala/module/RealRailwayRuleGenerator.scala) (contained no adjacencies in the first place)
- [x] [SamRuleGenerator](https://github.com/NAMTeam/Network-Addon-Mod/blob/staging/src/main/scala/module/SamRuleGenerator.scala) (covered by [meta-sam](staging...meta-sam) branch)
- [x] Run removal script and regenerate metarule-based RUL2 code (needs to rerun after previous step is complete).
- [x] Sight the remaining RUL2 code in the repository and remove redundant parts _manually_:
- [x] Some files seem to consist of almost entirely adjacencies only, for example:
* [Controller/RUL2/07_RHW/Sec7b_BaseNetwork](https://github.com/NAMTeam/Network-Addon-Mod/tree/staging/Controller/RUL2/07_RHW/Sec7b_BaseNetwork/)
* [Controller/RUL2/08_NWM/](https://github.com/NAMTeam/Network-Addon-Mod/tree/staging/Controller/RUL2/08_NWM/)
Partially scripted, see [remove-rhw-adjacencies.py](https://github.com/NAMTeam/Network-Addon-Mod/blob/9c1152880f93843277df3a3d33e6168958dc904e/src/scripts/remove-rhw-adjacencies.py) and [remove-nwm-adjacencies.py](https://github.com/NAMTeam/Network-Addon-Mod/blob/9c1152880f93843277df3a3d33e6168958dc904e/src/scripts/remove-nwm-adjacencies.py).
- [x] Some of the handwritten adjacency code seems to have some bugs in it.
Partially scripted, see [SegmentOrientationChecker](https://github.com/NAMTeam/Network-Addon-Mod/blob/9c1152880f93843277df3a3d33e6168958dc904e/src/main/scala/scripts/SegmentOrientationChecker.scala) and [MissingInstanceChecker](https://github.com/NAMTeam/Network-Addon-Mod/blob/9c1152880f93843277df3a3d33e6168958dc904e/src/main/scala/scripts/MissingInstanceChecker.scala).893 files changed
Lines changed: 300818 additions & 10882407 deletions
File tree
- .github/workflows
- Controller
- INRULs
- RoadAdvanced
- StreetAdvanced
- StreetBasic
- RUL1
- 01_Road
- 09_Dirtroad
- RUL2
- 01_Maxis_Misc
- 02_Diagonal_Streets
- 03_Turn_Lanes
- 04_Roundabouts
- 05_FA_WRC
- 06_Road_Viaducts
- 07_RHW
- Sec7a_Initial
- Sec7b_BaseNetwork
- Sec7c_RHWxRHW
- Sec7h_Flex_Transition
- Sec7i_FLEXRamp
- Sec7j_FLEXFly
- Sec7k_FlexSPUI
- Sec7l_3Level
- Sec7m_Crosslinks
- Sec7n_MRC
- Sec7o_SubRHW
- Sec7p_RHW-FTLs
- 08_NWM
- 09_SAM
- 10_GLR
- 11_Rail
- 12_HSRP
- 13_DualNetworking
- 14_DBE
- 15_PedestrianRevolution
- Sec15a_Pedmalls_Paths
- Sec15c_Draggable_Pedmalls
- Lite Controller/RUL2
- project
- src
- main
- resources
- scala
- localization
- module
- flexfly
- pathing/nwmpaths
- scripts
- scripts
- test
- resources
- scala
- localization
- module
- flexfly
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
168 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
169 | 177 | | |
170 | 178 | | |
171 | 179 | | |
172 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
173 | 185 | | |
174 | 186 | | |
175 | 187 | | |
| |||
261 | 273 | | |
262 | 274 | | |
263 | 275 | | |
264 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
265 | 280 | | |
266 | 281 | | |
267 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3212 | 3212 | | |
3213 | 3213 | | |
3214 | 3214 | | |
3215 | | - | |
3216 | | - | |
3217 | 3215 | | |
3218 | 3216 | | |
3219 | 3217 | | |
3220 | 3218 | | |
3221 | | - | |
| 3219 | + | |
3222 | 3220 | | |
3223 | 3221 | | |
3224 | 3222 | | |
3225 | 3223 | | |
3226 | 3224 | | |
3227 | | - | |
| 3225 | + | |
3228 | 3226 | | |
3229 | 3227 | | |
3230 | 3228 | | |
3231 | 3229 | | |
3232 | 3230 | | |
3233 | | - | |
| 3231 | + | |
3234 | 3232 | | |
3235 | 3233 | | |
3236 | 3234 | | |
3237 | 3235 | | |
3238 | 3236 | | |
3239 | | - | |
| 3237 | + | |
3240 | 3238 | | |
3241 | | - | |
| 3239 | + | |
3242 | 3240 | | |
3243 | 3241 | | |
3244 | 3242 | | |
3245 | 3243 | | |
3246 | 3244 | | |
3247 | | - | |
| 3245 | + | |
3248 | 3246 | | |
3249 | 3247 | | |
3250 | 3248 | | |
3251 | 3249 | | |
3252 | 3250 | | |
3253 | | - | |
| 3251 | + | |
3254 | 3252 | | |
3255 | 3253 | | |
3256 | 3254 | | |
3257 | 3255 | | |
3258 | 3256 | | |
3259 | | - | |
| 3257 | + | |
3260 | 3258 | | |
3261 | 3259 | | |
3262 | 3260 | | |
3263 | 3261 | | |
3264 | 3262 | | |
3265 | | - | |
3266 | | - | |
3267 | | - | |
| 3263 | + | |
3268 | 3264 | | |
3269 | 3265 | | |
3270 | 3266 | | |
| |||
3290 | 3286 | | |
3291 | 3287 | | |
3292 | 3288 | | |
3293 | | - | |
| 3289 | + | |
3294 | 3290 | | |
3295 | 3291 | | |
3296 | 3292 | | |
3297 | 3293 | | |
3298 | 3294 | | |
3299 | | - | |
| 3295 | + | |
3300 | 3296 | | |
3301 | 3297 | | |
3302 | 3298 | | |
3303 | 3299 | | |
3304 | 3300 | | |
3305 | | - | |
| 3301 | + | |
3306 | 3302 | | |
3307 | 3303 | | |
3308 | 3304 | | |
3309 | 3305 | | |
3310 | 3306 | | |
3311 | | - | |
| 3307 | + | |
3312 | 3308 | | |
3313 | 3309 | | |
3314 | 3310 | | |
3315 | 3311 | | |
3316 | 3312 | | |
3317 | | - | |
3318 | | - | |
3319 | | - | |
| 3313 | + | |
3320 | 3314 | | |
3321 | 3315 | | |
3322 | 3316 | | |
| |||
0 commit comments