TownGeneratorOS
TownGeneratorOS copied to clipboard
Some cities which produce errors
Someone on the Azgaar FMG discord was telling me that there's a problem with larger cities producing too much recursion for the browser (on Firefox and Chrome at the least). In practice it seems the examples they gave both produce errors for me as well, but sometimes different errors; probably because of different settings we have. For example, the second one only produce errors if Improved Lots are turned off.
In any case, the problematic cities:
https://watabou.github.io/city-generator/?size=60&seed=8414616970181&name=Test2&population=59782&hub=0&random=0&elevation=1&green=0&farms=1&citadel=1&urban_castle=0&plaza=1&temple=1&walls=1&shantytown=1&river=1&coast=0
https://watabou.github.io/city-generator/?size=61&seed=8414616970001&name=Test&population=60811&hub=0&random=0&elevation=1&green=0&farms=1&citadel=1&urban_castle=0&plaza=1&temple=1&walls=1&shantytown=1&river=1&coast=1&sea=0.3
A quick disclaimer, I am not a HAXE dev, I've got experience in Java, JS and Typescript primarily but thought I would have a quick dig.
Just tested both use cases, and found that:
First link
https://watabou.github.io/city-generator/?size=60&seed=8414616970181&name=Test2&population=59782&hub=0&random=0&elevation=1&green=0&farms=1&citadel=1&urban_castle=0&plaza=1&temple=1&walls=1&shantytown=1&river=1&coast=0
produced TypeError: Cannot read properties of null (reading '0')
on line 31420 of the TownGenerator.js which was traced to this particular line (Unsure how to get get the Haxe file this relates to):
if(openfl_geom_Point.distance(rect[0],rect[1 % rect.length]) >= minSide && openfl_geom_Point.distance(rect[1],rect[2 % rect.length]) >= minSide) {
Which appears with some further stepping through the code to suggest rect
is not getting defined by:
var rect = front != -1 ? com_watabou_geom_polygons_PolyBounds.lir(lot,front) : com_watabou_geom_polygons_PolyBounds.lira(lot)
Now some digging into the compiled js indicates to me this appears to relate to a class com.watabou.towngenerator.wards.Block
which is being used by an object of type com.watabou.towngenerator.mapping.FormalMap
neither of which appear to exist in the Repo as it stands so that suggests they are on private release branches.
That's about as deep as I can go, so hope it helped a little in respect to that issue.
Second Link
https://watabou.github.io/city-generator/?size=61&seed=8414616970001&name=Test&population=60811&hub=0&random=0&elevation=1&green=0&farms=1&citadel=1&urban_castle=0&plaza=1&temple=1&walls=1&shantytown=1&river=1&coast=1&sea=0.3
I was unable to produce any error, included in this testing:
- enabling/disabling/using drop downs
- All options under Style -> Building
- All options under Style -> Elements
- All options under Style -> Misc
- All options under Style -> Colors
- Changed to a different preset color schemes
Here's another city link: https://watabou.github.io/city-generator/?name=Das+An&population=23494&size=43&seed=49857838580003&river=1&coast=1&farms=1&citadel=1&urban_castle=0&hub=false&plaza=1&temple=1&walls=1&shantytown=1&gates=-1&sea=0.83
It errors out with the following output on the console:
Source/com/watabou/towngenerator/building/Model.hx:126: >> seed:49857838580003 size:43
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:147: -->> seed:49857838580003 size:43
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:179: buildPatches 9
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:180: optimizeJunctions 2
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:181: buildDomains 2
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:182: buildWalls 1
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:183: buildStreets 5
23TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Canal.hx:235: discard
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:152: *** Unable to build a canal!
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:147: -->> seed:1561737363 size:43
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:179: buildPatches 8
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:180: optimizeJunctions 1
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:181: buildDomains 2
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:182: buildWalls 0
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:183: buildStreets 3
22TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Canal.hx:235: discard
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:152: *** Unable to build a canal!
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:147: -->> seed:1054833852 size:43
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:179: buildPatches 5
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:180: optimizeJunctions 2
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:181: buildDomains 1
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:182: buildWalls 0
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:585: Unable to build a street!
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:183: buildStreets 2
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:184: buildCanals 2
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:185: createWards 3
TownGenerator.js:32056 Source/com/watabou/towngenerator/building/Model.hx:186: buildCityTowers 0
TownGenerator.js:60234
Called from module TypeError: Cannot read properties of null (reading 'length')
Called from com_watabou_towngenerator_wards_Block.indentFronts (https://watabou.github.io/city-generator/TownGenerator.js line 29401 column 11)
Called from .new com_watabou_towngenerator_wards_Block (https://watabou.github.io/city-generator/TownGenerator.js line 29166 column 8)
Called from com_watabou_towngenerator_wards_AlleysWard.createBlock (https://watabou.github.io/city-generator/TownGenerator.js line 28937 column 15)
Called from com_watabou_towngenerator_wards_AlleysWard.createAlleys (https://watabou.github.io/city-generator/TownGenerator.js line 28865 column 10)
Called from com_watabou_towngenerator_wards_AlleysWard.createGeometry (https://watabou.github.io/city-generator/TownGenerator.js line 28797 column 10)
Called from com_watabou_towngenerator_building_Model.buildGeometry (https://watabou.github.io/city-generator/TownGenerator.js line 15997 column 15)
Called from Function.com_watabou_utils_Stopwatch.measure (https://watabou.github.io/city-generator/TownGenerator.js line 31630 column 2)
Called from com_watabou_towngenerator_building_Model.build (https://watabou.github.io/city-generator/TownGenerator.js line 14942 column 65)
Called from .new com_watabou_towngenerator_building_Model (https://watabou.github.io/city-generator/TownGenerator.js line 14894 column 9)
Called from module at DocumentClass.com_watabou_towngenerator_Main [as __class__] (https://watabou.github.io/city-generator/TownGenerator.js:3312:2)
TownGenerator.js:60236 TypeError: Cannot read properties of null (reading 'length')
TownGenerator.js:60240 TypeError: Cannot read properties of null (reading 'length')
at com_watabou_towngenerator_wards_Block.indentFronts (TownGenerator.js:29401:11)
at new com_watabou_towngenerator_wards_Block (TownGenerator.js:29166:8)
at com_watabou_towngenerator_wards_AlleysWard.createBlock (TownGenerator.js:28937:15)
at com_watabou_towngenerator_wards_AlleysWard.createAlleys (TownGenerator.js:28865:10)
at com_watabou_towngenerator_wards_AlleysWard.createGeometry (TownGenerator.js:28797:10)
at com_watabou_towngenerator_building_Model.buildGeometry (TownGenerator.js:15997:15)
at Function.com_watabou_utils_Stopwatch.measure (TownGenerator.js:31630:2)
at com_watabou_towngenerator_building_Model.build (TownGenerator.js:14942:65)
at new com_watabou_towngenerator_building_Model (TownGenerator.js:14894:9)
at DocumentClass.com_watabou_towngenerator_Main [as __class__] (TownGenerator.js:3312:2)
TownGenerator.js:2858 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at DocumentClass.__enterFrame (TownGenerator.js:2858:18)
at openfl_display_MovieClip.__enterFrame (TownGenerator.js:58022:10)
at openfl_display_Stage.__enterFrame (TownGenerator.js:2861:10)
at openfl_display_Stage.__onLimeRender (TownGenerator.js:61099:8)
at lime_app__$Event_$lime_$graphics_$RenderContext_$Void.dispatch (TownGenerator.js:42351:16)
at lime__$internal_backend_html5_HTML5Application.handleApplicationEvent (TownGenerator.js:340:23)
TownGenerator.js:29401 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'length')
at com_watabou_towngenerator_wards_Block.indentFronts (TownGenerator.js:29401:11)
at new com_watabou_towngenerator_wards_Block (TownGenerator.js:29166:8)
at com_watabou_towngenerator_wards_AlleysWard.createBlock (TownGenerator.js:28937:15)
at com_watabou_towngenerator_wards_AlleysWard.createAlleys (TownGenerator.js:28865:10)
at com_watabou_towngenerator_wards_AlleysWard.createGeometry (TownGenerator.js:28797:10)
at com_watabou_towngenerator_building_Model.buildGeometry (TownGenerator.js:15997:15)
at Function.com_watabou_utils_Stopwatch.measure (TownGenerator.js:31630:2)
at com_watabou_towngenerator_building_Model.build (TownGenerator.js:14942:65)
at new com_watabou_towngenerator_building_Model (TownGenerator.js:14894:9)
at DocumentClass.com_watabou_towngenerator_Main [as __class__] (TownGenerator.js:3312:2)