HomeWildfire Games

Adds the path placer library by historic_brunno to rmgen. Fixes #892.
AuditedrP11152

Description

Adds the path placer library by historic_brunno to rmgen. Fixes #892.
Also takes all the duplicated parts of random maps including the new player start entities and random biome system into rmgen libraries.
Tweaks nile river and snowflake random maps.

Details

Auditors
elexis
Committed
SpahbodFeb 25 2012, 4:53 PM
Parents
rP11151
Branches
Unknown
Tags
Unknown

Event Timeline

elexis raised a concern with this commit.Nov 15 2017, 2:44 AM
elexis added a subscriber: elexis.

I'm really thankful that so much starting unit and random biome duplication was removed in this commit!
The pathplacer was a really important feature and was polished in the commits above.
It should have been committed separately though.

/ps/trunk/binaries/data/mods/public/maps/random/rmgen/misc.js
1

After staring at one line of vector code for two hours I finally found the bug.

The clipping of the here unused passageMaker (inline paragraph) is defect.

Lorraine Plain (rP12110), Unknown (rP12545), Unknown Land (rP12654) and Unknown Nomad (rP12747), English Channel (rP12786) don't pass the map border as boundaries to this function.
So if the code would actually clip to these numbers, then a passage would end in the middle of some tributary rivers.

So both the numbers in the maps and the algorithm are wrong but the errors cancelled each other out.

This commit now has outstanding concerns.Nov 15 2017, 2:44 AM
elexis accepted this commit.Jan 22 2018, 7:34 AM

The random biome getters were terribly named and removed.
The random biome definitions were moved to JSON files.
JSON file reading support was added.
JSON file reading support was unified across all JS contexts.

/ps/trunk/binaries/data/mods/public/maps/random/rmgen/misc.js
1

I don't remember the bug in the weird math of passageMaker, but after I went through the math I could convert it vector algebra. That one is now so easy to comprehend that it's easy to maintain and find any bugs.

The boundaries set by the maps might have been intentional, but I have set them to the map bounds regardless so that all parts of the map can be reached.

All concerns with this commit have now been addressed.Jan 22 2018, 7:34 AM