Gruedorf Post 2021-02-28
- Can now add water polygons to the map
- Set up z-indexing so I can have multi-part entities that sort correctly
- Built a "follower" system for having party members on map, but commented it out
- Can now add shadow polygons to the map
- Drop shadows on character entities are not part of the sprite now, they're an actual shadow
- Started work on hopping off cliffs
While Black Mountain is a relatively low resolution game and the end result will probably be mostly pixel art, I am not trying to mimic any particular old hardware, nor am I holding myself to any sort of purity test. I am doing my best to avoid actual mixed resolution (because I personally hate it), but I am not going to avoid using modern conveniences like shaders or polygons to do things. The water can be added to a map similar to an entity, but by drawing out a polygon (which Godot's built-in tools make pretty easy). It is animated, rippling slowly and wobbling the underlying tiles of the background, and I am able to give it a direction for the movement so I should be able to use it for (slow-moving) rivers as well.
One thing that I always find annoying with making maps is dealing with thin upright pieces -- things that you want the character's head to render in front of when they're standing in front of them, and you want the character's feet to render behind them when they're standing behind them. To make this easier on myself I actually have a lot of "placeables", which are basically furniture, and are just entities like the character sprites. I put them in with the sprites on the map layer and they get sorted appropriately.
Unfortunately, this means that you have to be careful with exactly how it's drawn. Every entity has an origin -- for the character it's the space right between their feet. The origin is the y-position used to determine render order. If the character's origin is higher on the screen than the placeable's origin, it gets rendered behind. If it's lower, it gets rendered in front.
But what about things like rubble strewn on the ground? A treasure chest with coins spilling out of it? This is fine as long as the "floor" layer of the sprite is entirely contained to below its origin, but that's not always the case, and when that happens you end up with rocks, seemingly lying on the ground, floating on top of the player when they walk there.
To allow for this, entities can now have other parts. Godot has a built in z-index system that gives you an extra means of control over the render sorting that's happening. It's a little bit brittle; it'd be easy to make something draw entirely wrong. If I were worried about other people using this I would probably try to do something about it, but if I shoot myself in my own foot, well, I know who to blame.
I feel like any game where you can see the ground beneath the feet of the character benefits from having a drop shadow. I had a drop shadow under the character before, but it was just a hand-sketched partially transparent circle.
The problem with partially transparent things, of course, is that when they overlap, you get a darker spot. This is fine for Venn diagrams but not so much for shadows. So to fix that, I added a shadow layer to my maps.
The shadow layer can have shadows added to it by an entity that lives on the map (or is placed there), and it can also just have shadows added directly to it by the map maker. It works by drawing all of the shadow polygons to a separate surface, and then drawing that surface all at once with transparency. As you can see in the screenshot, the shadows lie underneath the sprites and on top of the background layer of tiles... but it is underneath the foreground layer of tiles. The real assets for the game are going to have to be constructed to deal with this; I'm not exactly sure how I'll do it but I'm confident I'll figure it out and that's good enough for this stage of development. Also for the future is to figure out the best way to make them softer-edged.
Because it was easy, I also added a way to look up if an entity is currently standing in a shadow (other than their own). If they are, I draw them darker too.
Showing Followers on the Map
I always go back and forth on how I feel about having the rest of the party shown on the map as you explore. I could do the classic thing where everybody marches in a line that perfectly follows the leader, but I don't feel like that would fit with Black Mountain. I put a bit of time into testing something where there are other sprites on the map and they try to catch up to you, but I didn't really care to make the pathfinding work correctly so they just kind of got hung up on things (I'm fine with monsters getting hung up on things, since it means the player can be clever and escape from them... it's less great when your party members are too dumb to walk around a tree to catch up to you). I also realized that having them on the map complicates some of the things I'd like to add later... so I turned them back off. I've still got the code so you never know, they might come back, but for now you're just driving the leader around the map.
Hopping Off of Things
One of the things I'd like is for Black Mountain to be a game that feels better to move around in, and involves the characters doing things outside of combat on the map. This is driving a few of my core decisions about the game, and in a sense it's pushing it a bit away from your traditional jRPGs towards an action RPG -- getting a little Zelda in my Final Fantasy, if you will.
To that end, I'm going to be adding some of the staples of more action-oriented RPGs. The first was to add the ability to jump down off of cliffs. The intent of doing this is actually what drove the shadow separation work I rambled about above (along with wanting to deal with the overlapping polygons), so that I could lift the player sprite up off of their shadow to make it seem like they are falling or hovering.
This isn't quite done. I have the hop and the fall, the shadow separation, etc working, but I'm stuck on the nitty-gritty of figuring out exactly where the character needs to land when they jump off. I know roughly what I want to do, I just need to make sure that the plan doesn't wind up with the character stuck in a wall or being annoying to set up. Since I'm largely ignoring the grid for a lot of Black Mountain, I can't just cheat by saying "jump down by 3 tiles".
That's it for now! It was actually a pretty productive week, all things considered, even though it felt like a bit of a slog at times. See you next week!