Time for another sneak peek at my fabulous artwork. The fourth map was just going to be a rather boring forest, until I had the idea to make it a rather boring cave instead... I just didn't see a lot I could do with either one with my skill level. The good idea I had was to combine both into a multi-level map, but that probably set me back another two weeks as I tried to reconcile ground != (y=0) with everything I'd done on the project so far. The first hurdle was obviously A* and setting destinations for my AI, but I also had to worry about my Teleporting Cows once again, and even a little thing called gravity. I had turned it off for all my players, and frozen their y-positions, but in order to make them traverse the ramps from once level to another, I needed to go back on those decisions. And then suddenly the UFOs were bouncing all over the place, trying to climb up the sides of force fields and trees, and getting blasted into the sky by other players' shots. I had to rebalance a lot of numbers for forces, and in fact ended up not using Unity's gravity but instead applying a constant downwards velocity to the players... It wasn't a fun time, but rather than bore you with any more details, let's just look at the art.
I made a bunch of purely-geometric trees, which are all fine because that's the kind of art I'm good at: making exact measurements and plugging the points into the individual fields. You can see the two color schemes for some more variation, and I even resurrected Urbanopolis' BuildingScaler script to randomly stretch each tree instance in the y-direction once it's in-game. This faked randomness does more than you might think, and it really helped me later on too.
Next up are some rocks, which were in fact a lot harder for the exact reason I mentioned above. I wanted a bunch of random low-poly surfaces, and even though all I really needed to do was pull the vertices every which-way, it was hard to be satisfied. But just like the trees, once I had a couple of them, I applied some more random stretching so that you'll never see two rocks that are the same in the game.
Lastly, I created a cave opening to be the point of entry to the underground part. It's actually quite easy to get lost in the forest on a large map, so I needed something big, bulky, and colored to stand out as a visual landmark.
Now, here's the real genius behind the multi-level map: I'm still using the tiling system, it's just that each tile is now two planes separated by 15 units in the y-direction. All the player barns are on top, generic pens are below, and of course the cave tiles include ramps that span both. I didn't have to change any code though; my map generation algorithm just knows that it's placing a tile at the specified position, and in this case a tile happens to be a multi-level affair itself.
Now, notice something else about these tiles: the stalactites on them. I cheated one more time here, because I really only have two different models, which have been rotated and scaled so wildly that you could never tell. I had to be a little less random with them though. Notice how, in the below image, you can see the collider box stretching all the way down to the ground? This is because that stalactite hangs low enough that a UFO could crash into it. So I needed to have it be included in the navmesh, so the COMs would path around it, and the only way to make that happen was to have it intersect the ground.
The underground cavern ended up being pretty maze-like as well. One last quirk I introduced was to force players to interact with both levels. I mentioned that all the barns are in the forest...well, the cow distribution on each tile is weighted heavily towards the cave below. So players will definitely want to go down there. And as for the game modes that are stealing-only, I introduced an impenetrable tree border around each map quadrant. If you want to visit another player's barn, you need to use the cave to go underground, fly around there, and find another exit back to the top level. Just don't forget which pathway leads back to your own barn in the process!
This map is a great example of doing a lot with a little. I just had a handful of simply-modeled trees, rocks, and cave features, but I used that to my advantage to build a map that it's really easy to get lost in, integrating that into the gameplay. I also combined two one-note ideas and made them more interesting with the multi-level gimmick. Each one of my maps really brings something different in terms of both visuals and gameplay, and that's really cool.
Next time: lighting.
Comments