I used Ruby to generate a heightmap, then WorldPainter to create the Minecraft map. I dug out the path by hand because I didn't know how to automate that part lol
Ah yes, that's actually my post lol. Thanks for the recognition tho! No specific path was found tho cuz it was just a BFS since the actual path didn't matter, just the step count.
What do you mean by this? You can still reconstruct the path if you keep track of where each point was visited from in your visited matrix or dictionary, instead of just a boolean. Only when you bring the costs and priority queue into the mix will it turn into Dijkstra/A*.
That's true, but I didn't need the actual path, so I didn't keep track of where each point was visited from. I know I could've reconstruct the path, but there was no need to, so I didn't put in the extra work
I like how the up/down movement rules match minecraft as well (assuming no fall damage...) so you could theoretically walk the path in-game without jumping
I'm afraid there's not much to show. I have this Ruby code to generate the height map (lines is a 2D array of characters where 'S' and 'E' have been replaced with 'a' and 'z'):
require 'oily_png'
image = ChunkyPNG::Image.new($w, $h) # width, height
lines.each_with_index do |row, r|
row.each_with_index do |char, c|
image[c, r] = ChunkyPNG::Color.rgb(*([char - 'a'.ord + 1]*3))
end
end
image.save('heightmap.png')
and I imported heightmap.png into WorldPainter (and struggled with the settings for a while to make the rest of the world empty) to create the world save files.
Unfortunately the mob pathfinding doesn't guarantee that they reach the location. AFAIK it implements a form of A* that has a limited number of steps. They'll try to find a closer location, pathfind there and then that repeats. If the search fails and they can't find a closer location within that limited number of steps they stop moving since they can't get closer.
8
u/BluePsychoRanger Dec 12 '22
Nice! Were the calculations done in Minecraft or was it generated afterwards?
29
u/niugnep24 Dec 12 '22
I like how the up/down movement rules match minecraft as well (assuming no fall damage...) so you could theoretically walk the path in-game without jumping
1
u/[deleted] Dec 12 '22
Could I see your source code for how you generated that world in MC?
3
u/delventhalz Dec 12 '22
What, not gonna implement Djikstra in redstone?
2
u/Flashky Dec 12 '22
Indeed an scenic view. Elves will be pleased.
1
u/Activepaste Dec 13 '22
Maybe you could piggyback the Minecraft mob pathfinding solution by using the path traveled by a zombie to the top.
-10
u/erixg Dec 12 '22
Don't seem right. Even the summit is 1x3. In your case it's 1x2.