I couldn't find a core 2D line segment intersection routine in Unity and I didn't really like the forum solutions, so I wrote my own, it's here in case anyone else wants it: https://gist.github.com/sinbad/68cb88e980eeaed0505210d052573724
I like how the generator has built an alternate path around the back of the L-shape on the right of the screenshot: this is allowed because although it's off the main (yellow) path, it doesn't compromise the structure because it rejoins a similar point and isn't shorter. It's still correctly avoided all the other places which could have punched through what is quite a winding, tightly packed path
Hand-crafted special areas can now integrate with my wave function collapse random gen. Generation is guided by paths, with automatic shortcut elimination. This gives a random appearance, details and offshoots (more organic than just prefab room & corridor) but a more designable high-level structure than pure random
Level gen conforming to multiple hierarchical paths (branches & defined shortcuts, loops), which also eliminates unwanted shortcuts as it builds. There are so many edge cases to this but I think I've finally got it stable (famous last words)
Gif here, sorry too big for Masto
https://twitter.com/stevestreeting/status/1130881598822522880
Still experimenting with procedural generation; this iteration:
1. ensures a spline path is walkable,
2. makes sure no shortcuts that would skip sections of the path are generated
3. allows random offshoots so long as they don't contravene 2
I quite like this method because it can detect shortcuts as it builds, using a sort of contextual flood-fill. Since I resolve path constrained areas first, & then cells most restricted by those, as you flow outwards you can detect clashing frontiers
It's tough to get music to suit a game, but sometimes I hear a track and like to imagine what kind of game would suit it. Like this one, I kinda just want to make something that fits with it: https://soundcloud.com/danmason420/k0rl9m0txert#t=1:05
Upgraded my key caps to double shot because the top print on my old set was wearing off. 👍
Tried to get PBT but it’s really hard to get hold of ISO sets in decent colours, so they’re ABS.
(Filco Majestouch tenkeyless with cherry brown switches, Tai Hao Navy) #keyboards
In case anyone's interested, I revisited and updated my 2D spline component for Unity this week, gave it a few more features such as working in the XZ plane for 3D projects (planar splines can still be useful). Grab it here, it's MIT licensed: https://github.com/sinbad/UnitySpline2D
Formerly engine (Ogre3D) / devtools (Sourcetree) creator, now one half of an indie gamedev couple. Coffee nerd.