My current WIP in the Biscuits Project (Garibaldi) is now at parity with my previous iteration on the things I care about: being able to segment a map based on the structure of its streets. Except that it is all now being done client-side.
It's not obvious it's doing anything special as I deliberately just put them back in their original locations. Being able to take something to bits and put it back together again is a key ability! However, it's not very interesting to look at.
Hence Map Mixer. The core idea is to see what a Map of a city looks like if I swap over similar-size blocks from another city. I don't know what this will look like, so time to explore.
My general strategy for personal projects is similar to the Double Diamond approach. The above is me doing "building the right thing" i.e. what am I gonna build next? What comes next is actually building it.
Doing this seems to break down into these steps:
Next, I will try to see what I already have that can fit these needs, perhaps doing some re-factoring / clean-up to get there. I will also do various spikes on different technologies or approaches that fill the gaps. Then I will incrementally start re-integrating these learnings back into the main app, trying out examples as I go. Finally, I will apply iteratative optimisations on the code as I use it, where it seems sluggish.
First spike: Layout. I am assuming that laying out the Map will not be as simple as drawing a Map because bits from each Map won't fit together cleanly. So, some "jiggling around" will be required. To make it look like a real Map, some constraints need to be followed, such as not having overlapping segments. An idea here is to use some sort of physics engine that can apply these constraints.
I've been doing a lot of Rust recently; the small segmenting core of https://garibaldi.houseofmoran.io/ is built in it. So, my first choice for layout it out was seeing what was available in Rust. Specifically, nphysics2d for doing the layout.
Unfortunately, I had some issues getting nphysics to compile under wasm, using wasm-binding. I don't think it's a dead-end, but I realised for the sake of experimentation, it may be simple to use an old-favourite of mine: d3-force layout. So, stay tuned on that.