Sparkletron's Terraformers


Add some spice to your next map. Explore oceans, new hexagonal worlds, or expand a modular base through regular diamond chokepoints

Content
3 years ago
1.0 - 1.1
1.05K
Environment

i Canal Maze?

3 years ago

Would it be possible to add a "maze" toggle to the canals so that not all cells have all sides connected?

Happy to help with maze algorithms if you need.

(I've been working on maze mods, but if intergrated this would blow my stuff out of the water)

3 years ago

You are welcome to borrow whatever code will help you, but I don't think the maze code will work at map gen time. The noise expressions are very restrictive, it's not typical lua. Even 'if-else' statements don't work.

3 years ago

Oof. And thanks :-)

Having looked around the code all I have to say is "this is the blackest of magics" (I have no idea how any of this works)

Would it be possible to do the same "size sync" that the hexes have for the squares?

With that and some way to get at the cell size and shape in the control stage I could "paste" a maze over the top, at least for the regular types.

How regular is the island web setting? (Could I cheat coasatline detection with some magic numbers?)

3 years ago

If you wanted to sync up with the Hexy map, you could use the hex functions in the MapGenUtil.lua. Instead of using x,y coord in your maze, you'd just use q,r coords. It takes a bit to wrap your head around, but its really cool :-P. This is the hex-grid bible that I used as a guide https://www.redblobgames.com/grids/hexagons/#rounding

Aligning to the boxy square grid would likely be easier. I think you should be able to use the code more or less directly.
This line
local center = util.square_center(x,y, 10 * land_pattern_scale_multiplier())

should get you an x,y for the current 'square'. So if your squares were 100x100, and x,y = (33,57) then center would = {50,50} I think.
So instead of using chunk boundaries (which I think is what you are doing) you would have to use the xy coords and align to the same grid as boxy.

3 years ago

Oh and the island web (and river maze) setting probably won't help you. It's just a clever repurposing of the coherent noise functions that make the normal map. It has no idea what an 'island' or a 'bridge' is, so it would be difficult to impose a maze on them since you can't specify 'turn off this node' or turn off this graph edge'

New response