dinsdag 14 februari 2017

HKU - Playful Worlds - Part 1

This week I made a lot of progress with my procedural dungeon generator. It utilises a script that places UTF-8 Characters in a certain algorithm. The next thing it does it that it uses a script that places prefab models into the scene. The player is able to move inside these objects.


XXXXXXXXXXXXXXXXXXXXXXXX
X┌─┐┌┐┌┐┌──┐┌┐┌─┐┌──┐┌┐X
X└─┴┘│├┼┼┐┌┤└┴┼─┴┤┌┬┴┴┘X
X┌───┴┴┘││├┤╔╤˄╤╗├┘└┐┌┐X
X│▼╔╤╤╤╗├┘││╟@@@╢├─┐├┘│X
X└┤╟@@@╢├┬┼┴˂@@@˃┤┌┴┤┌┤X
X┌┴˂@@@˃┴┘├┐╟@@@╢││┌┴┤│X
X│O╟@@@╢┌┐├┤╚╧˅╧╝└┼┤┌┤│X
X└┐╚╧˅╧╝├┘└┼┐┌┤┌┐┌┤│└┼┤X
X┌┤┌─┴┐┌┤┌┐├┼┼┼┤└┼┤│┌┼┘X
X│├┼┬┐├┤└┘└┤│├┘│┌┼┤├┘└┐X
X├┘├┘├┘├┬┐┌┼┴┴┬┴┴┴┤│┌┬┤X
X└─┴─┘O└┼┴┤│╔╤˄╤╗┌┴┘│││X
X┌┐╔╤╤╤╗│┌┤│╟@@@╢└┐┌┘├┤X
X└┤╟@@@╢│├┴┘╟@@@˃┬┼┘┌┼┤X
X┌┼˂@@@˃┼┼─┐╟@@@╢│└┬┤└┤X
X└┘╟@@@╢└┤┌┤╚╧˅╧╝└─┘│┌┘X
X┌┐╚╧˅╧╝┌┘├┴┬┐└─┬─┬┬┼┘▼X
X└┤┌┬┤┌┬┤┌┼┬┼┤O╔˄╗│└┘┌┘X
X┌┘│├┴┴┼┤│└┼┤└┐╟@˃┼┬─┴┐X
X│┌┴┴┐┌┤└┼─┼┤┌┤╚˅╝││┌┬┘X
X└┤┌┬┼┘└┬┤┌┼┘├┴┬┼┐│└┤│▼X
XO└┘└┘►─┘└┴┘►┘►┴┴┴┘O└┴┘X
XXXXXXXXXXXXXXXXXXXXXXXX

Above here is a pattern for the maze that is being generated.

















Above here is an early stage picture of how the room layout was being generated, note the big hole on the left to make space for an at that point invisible room.












Here I was trying to import some models I got from the tutorial I followed.

















I also ran into bugs... very often.



















But eventually I managed to get a pretty decent algorithm going.

















A big shoutout to Richard Hawkes (https://www.youtube.com/channel/UCiYIoN_wIwA0etN2DHbI6Zw) for the tutorials I follow and the models I used to make this happen.