Analysis of trading routes and patterns in JG's Wilderness setting
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.dir-locals.el
.gitignore
README.org
analysis
bmpread
cities
kentish.png
lists
map1-csiodays.png
map1-trading-sharp.png
map1-trading.png
map1.bmp
map1.cities
map1.days.pgm
map1.trade.pgm
mapmaking
params
pixelpath
pqueue
squares
testmap.cities
utils
vectors

README.org

Mapping of Trade Routes

This is the Forth code to take a map in .bmp format and analyse it for trade routes. Although it has features for fantasy D&D maps, it could be used without referencing them. The core is a Reilly gravitational model

It is invoked by

forth pixelpath map1.bmp 8

Where “map1.bmp” is the map to analyse and “8” is the number of pixels per mile (if negative it’s the number of miles per pixel). It assumes that for a map file called xxx.bmp there is a forth source file called xxx.cities which defines demographics for that map (i.e., the towns, locations and their populations).

Notes

Forth

This code is written for my own Forth compiler. You’ll need to adapt the file handling somewhat and define a loop structure (n times…iterate) which counts down from n-1 to 0. Neither are particularly hard.

Make multi-threaded

The map given here takes 5hrs to analyse using a single thread on a 3.6GHz AMD processor using native code-generation, albeit with few optimisations. Threading is doable but not done.

Blog

There is a blog post about this.