After a long hiatus, it feels great to be back and working on this!
Route Setter ToolSince the beginning of the project I have been manually placing all holds by duplicating, moving, and rotating each individual hold. This process of creating levels makes it a thousand times more tedious than it needs to be, so I decided that I needed a tool to make the level creation process easier and faster.
A nice bonus of working in Unity is that it is easily extendable and has some nice built in 3D GUI drawing. Between my day-to-day work and this, I've only spent a few nights on it, but its now in a state where I can make a lot more progress on the list of levels I have planned.
The tool has two components that makes putting objects in the scene very easy:
- Collections/palettes
- Prefab selection
The 'collections' is basically a Scriptable Object that asks for a list of prefabs. This means that I can have a collection of climbable rock prefabs, a collection for obstacles, and a collection for environmental assets with each of these collections having any number of defined prefabs.
This collections and prefab selection system is based on the functionality of
ChevyRay's PrefabPalette.
The Tool
One of the crucial things I needed for this tool was measuring the distance between the last holds I've been placing, as well as selected holds.
Currently, the max length in units that the player can reach reliably is anything below 1.50 units/meters.
Selecting two holds shows the distance between them, and if the distance is safe or too far.
There are some contingencies though. The distance of 1.5 meters is only reliably safe if the holds are more horizontal to each other. Once a hold is 1.5 meters straight above another, the hold becomes a lot harder to reach and requires both using side-to-side swing momentum and also swinging slightly backwards while pulling up.
To fix this, I simply compare whether the hold I am currently about to place is too far above the last hold I placed.
The whole point of this measuring system was basically to eliminate the need to playtest as much. There have been too many times before, where I have been recklessly placing holds and not been able to get the distance right - only realising when playtesting that the holds were way too far apart.
For more specific cases like the Slopers (which all have widely different sizes), measuring between the objects shell and the last hold is crucial since there can be a wide distance between what part of the Sloper is reachable if its facing a certain way.
To solve this, I use a sphere cast from the last hold placed to the newly created Sloper. This way I can more reliably get the distance information I need from weird edge cases like this. The cast only happens whenever I have just placed a Sloper or selected one, as I usually need to rotate them a bit more manually. If the cast is from a Sloper and not a normal rock hold, the cast is started from the shell of the first Sloper gets the distance information when it hits the last one.
The sphere cast is nice because I can get away with just casting towards the general direction of the Sloper to get whichever part of it sticks out the most and closest to the previous hold.
The green ball represents the nearest point where the distance is measured.
Two other features I added for the tool were buttons for easy selection and focus of the Player and Summit, since these are two objects that get kind of lost within the scene hierarchy and I need to tweak regularly when adding features or placing the start and end of each level.
Another small but useful feature I've added to the tool is a toggle to have the route visualized in the scene view. When creating a level, some of the rock holds usually disappear for me, mostly due to the visual style, so this feature is great when I need to see the entire route throughout the level. It takes in account all of the rocks I have placed, including other types of holds like Slopers and Micro holds.
The last feature I added was the ability to paint/drag place rocks. When painting, this allows me to continuously place rocks with a set distance, defined by the Placing Distance value. This value can be changed by holding Alt and scrolling up or down with the mouse scroll wheel, so it's very useful when I need to place a whole bunch of holds.
This feature is also extra useful when I need to populate a level with a lot of environmental assets. Applying a random scale to this also gives great results and faster environment creation. I have also made the feature toggle-able by hotkey which always makes working easier.
The lightbluish outer circle is the range of the Placing Distance.
The last two features I added were surface offset, which is self-explantory, and a hotkey to randomise the rotation on the go. The surface offset was needed because some of the holds clip more or less into the wall depending on the type of hold. The randomising rotation on the go is also super useful. The scaling and rotation modes were adopted from PrefabPalette, but modified heavily to suit my needs.
I'm happy I got down to it and actually worked on this a bit more extensively than I had originally planned, because this will end up saving me a lot of time in both playtesting and level design.