This post isn’t actually about shadows. But after poking around a bit, I’ve finally got shadows performing nicely. Look at that timing bar at the bottom left corner of the screenshot, and compare it against any of the recent screenshots (with or without shadows) to see how little a performance difference is being caused by the shadows, now.
As I mentioned yesterday, there’s still a lot to do with shadows. Most notably, right now shadows are only being generated for a single area of the game world (covering about half of the starting region). Move away from there, and shadows vanish again. I’m planning to implement cascaded shadow maps, which will result in shadows being calculated near the player, and with better resolution near the player; blockier further away. I’ll make an attempt at this on the coming weekend.
But what I really want to talk about today is the screenshot from yesterday, with all the red squares in the actionbars. In a lot of ways, for me, those screenshots are more exciting than these ones with the progress on shadows. See, what’s going on is that I’m in the middle of a massive refactoring of how action bars work. And here’s why:
I’m adding an inventory. Both for in-game characters, and for the player himself. “Items” are now objects which can be carried around, and optionally perform a function when clicked upon. And almost everything is now an infinite-use “Item”, including all of the terrain editing and building placement tools. Even the button for stepping off of the graveship is an “Item” now. Similarly, the various combat abilities of mmo classes are now implemented as infinite-use items, too.
Items are stored in various places (inventory, class abilities, etc), and shortcuts to these items can then be dragged into action bar button slots. I haven’t yet implemented stacking and depletion of similar items, but that’s planned; hopefully should have that working by the end of the week. This support gives me the ability to (for example) give the player once-off consumable items, such as “construct a capital city”, without cluttering his interface with disabled buttons for all the time when he’s not allowed to do that. It also opens the door to, for example, the player being able to de-rez a building, pick it up, carry it somewhere else, and then rebuild it elsewhere, at no charge. I think I like that mechanic a lot more than the current “drag the building freely around the landscape” interface.
In a more obviously useful vein, it also allows the MMORPG game to have things like health potions, spell scrolls, and other one-use items, and have the AI players automatically understand how to use them. These consumable items are all implemented in exactly the same way as class abilities, which means that they should slot straight into the AI action selection logic that already exists.
Originally, the idea for MT2 was to abstract away items, because of all the complexities that surround them (drop tables, loot frequencies, etc), but in the end, I really wanted to be able to give items to the player for the purpose of building the world. I probably won’t expose the complexities of drop tables in the first release of MT2; it’s not really what I want the game to be about. I’ll just have AI game designers fill them out automatically.
So that’s what I’m up to at the moment! Hoping to polish off the item interface this week, and get cascaded shadows over the weekend. Wish me luck!