I did some coding today on the prefab builder. I want to get most of the possible functions in before I go and build a load of test prefabs. If not I'll have to go back and rebuild them, or build a bunch of new ones.
Since I'm hoping that later people will help to expand the game by making new prefabs I want to make sure the prefabs are valid before saving them.
Right now I've only included a couple of checks, there are more I should add. Such things as checking if a prefab has any encounter areas set, if it has a valid walkable path from the entry hook to the exit hook (pretty essential to avoid game breaking prefabs), if it has any invalid door or stair placements and other things like that.
The check for stairs came to me when I was thinking of how to deal with stair containing prefabs vs non-stair containing ones. How can I choose the right kind in the right situation? Why should there be two types? Why not include stairs in every prefab? Then when placing the prefabs the algorithm can decide if the stairs are needed or not. If they are not needed then they can be replaced by plain floor tiles. If they are needed the level builder can decide if they should be stairs up or down.
This way makes it much easier to lay out levels and have down stairs match co-ordinates with the upstairs while still having stairs placed in logical locations, and having things such as door guard encounters and safe rest areas at the bottom of a new set of stairs.
Since I'm hoping that later people will help to expand the game by making new prefabs I want to make sure the prefabs are valid before saving them.
This one is not valid. Need to add a message to state that fact eventually...
Right now I've only included a couple of checks, there are more I should add. Such things as checking if a prefab has any encounter areas set, if it has a valid walkable path from the entry hook to the exit hook (pretty essential to avoid game breaking prefabs), if it has any invalid door or stair placements and other things like that.
The check for stairs came to me when I was thinking of how to deal with stair containing prefabs vs non-stair containing ones. How can I choose the right kind in the right situation? Why should there be two types? Why not include stairs in every prefab? Then when placing the prefabs the algorithm can decide if the stairs are needed or not. If they are not needed then they can be replaced by plain floor tiles. If they are needed the level builder can decide if they should be stairs up or down.
This way makes it much easier to lay out levels and have down stairs match co-ordinates with the upstairs while still having stairs placed in logical locations, and having things such as door guard encounters and safe rest areas at the bottom of a new set of stairs.
Comments
Post a Comment