Pages

Wednesday, July 25, 2012

Combat Is Hard

Yet another status update! Before I get to that, here's a really quick progress video, showing off what I've been working on since last update - it's been a while since I made a video, so I figured it was time for a new one.



It's a short video, but you can get a glimpse of more or less everything I've been doing recently. You can see the world map in action - I think it looks a lot nicer in action (and with music!) than what you see from the screenshots I had previously posted.

As for the new things:


You may have missed it in the video, but I made a few minor updates to the main summary menu. The most important additions are:

  • There now are icons in the header for stats that weren't visible before. The staff with the red X on it is your Arcane Spell Failure chance (from wearing armor), the blue dashing guy is your Initiative score and the black icon on the bottom-right of the header represents your Armor Check Penalty (used when you're wearing heavy armor and try to use skills like Hide or Move Silently).
  • All of the new icons have tooltips, indicating where the final number comes from, in terms of your stats and equipment
  • Some of the old stats which didn't have tooltips now do. Notably, you can now see how your equipment is contributing to your carrying weight, and where your HP value comes from. If you pay attention to the video, the HP tooltip displays how much HP you're getting from your class. If you take more levels in that class or in a different class, the tooltip will display how much of your total HP comes from each level you've taken in all classes you've ever taken a level in. 
I'm a big fan of giving players all the (relevant) information you can, so I think these are all pretty nice additions to the summary menu.


Another small but important addition is loading screens. RPG Maker games are usually so small and have such tiny resources compared to a standard 3D PC game that loading screens aren't actually necessary, but I find that - if done well - they're actually pretty nice to have just to add more visual flavor to the game.

I'm not entirely sure I like the font color on the LOADING/SAVING text, but I'm pretty happy with everything else about how these turned out. I'll be using various D&D related images throughout the game. 

Which image you see is usually random, though I've also added code in to allow me to display a specific image (or a random image from a specific set of images), so that you'll generally end up seeing images related to what you're actually doing in the game. When you rest in town you'll see a different image from when you rest in an inn, and those will be different from what you see when you fast travel or enter a map that's part of a particularly important plot point. I think that when used properly, these can add a lot to the atmosphere of the game.


Finally - the big elephant in the room - the combat system! Well. Almost-combat-system. Since you technically can't actually have any combat yet.

This is where the bulk of the work has been going in during the last couple weeks for me. The UI is intentionally completely bare-bones for now: I'm still implementing most of how the combat works; I can worry about what it looks like later (I'd go so far as to say the visuals are the easy part).

What you see in the video is pretty much all I have at the moment. There's a turn-based system running managing combat, and you can see the turn order (which is determined by every combatant making an actual d20 initiative roll at the start of combat) by looking at the portraits in the top-left of the screen.

Most of the commands in that menu don't actually do anything yet; I just put them there to get a feel for how the menu layout will eventually look like once it's done, and as a reminder for everything I want to eventually get working in the game. Every single one of those commands will eventually be implemented and work the way you expect them to if you're familiar with what they usually do in D&D.

The AP bar doesn't mean anything right now, though it eventually will. I'm planning on using it as a visual representation of what you've actually done so far that turn. For example: in D&D you can move up to twice per turn (or move once then act once). So after moving once, your bar will be half full.

The three little axes on the bottom-right display are placeholders for, in order: whether the unit is an ally or an enemy (eventually will be some kind of blue or red icon, depending on who the unit is), how many free actions the unit can make per round and how many Attacks of Opportunity the unit can make this round.

There's a few interesting things I put in the system that I'm not really able to show off in a video yet, like the ability for enemies to have random names (picked from a list of several hundred). They also have their own inventories, which determine loot at the end of combat - so if you see an enemy wielding a Great Sword of Kitty Murdering + 4, you will actually get it as a reward once you kill him in a fight. If an enemy starts combat with a bunch of potions or spell scrolls, you can get them as loot if you kill it before they get a chance to use them. And so on.

That's about all I have so far. There's a placeholder for a status window (which will look something like the summary window in the main menu, but you'll be able to see them for enemies too), though I doesn't have much inside it right now, and there's some enemy AI (though all it does at the moment is "Think" for 4~5 seconds, then end its turn without doing anything).

The groundwork for combat is all there, now I just have to keep adding to it. I can see why people don't build custom combat systems that are too different from RPG Maker's default very often. I still have a very long way to go before this is proper D&D combat and it's already taken me a couple weeks of work and 7 scripts which together total about 3000 lines of code.

That's all for now. I'll be working on combat for a while, posting more updates every now and then, when I make progress significant enough to show off in screenshots or a video.

Thursday, July 12, 2012

EVO 2012!

It's been a little too long since my last status update, but here it is: better late than never, I suppose.

In case you're wondering, the reason for the delay is that this past weekend was EVO 2012 - the largest fighting game tournament in the world, held every year in Las Vegas - which I attended. I took some time off RPG Maker-related things for the last couple weeks to get a little bit of practice before going.




Now that that's over (it was incredible, by the way, you should watch some of the matches if you haven't done so already - KOFXIII and Marvel 3 in particular) - I can get back to work.

Despite the rather long break, I have actually gotten quite a bit done since my last update. The first major thing is that the game now has a Day/Night system.


Now, as simple and common as such a system might seem, it will actually have a significant effect on how you play the game. I don't want to give away too much just yet, but: in addition to the time of day changing, and the tint of the screen changing in outside areas, which actual day it is will matter as well.

The game will keep track of how many (in-game) days have passed since you started the game, and various events will happen differently depending on how soon or how late you trigger them. This will be a major influence in how the game's main storyline unfolds, and ultimately how the game ends. That's all I'm going to say about that for now!

Another thing you may have noticed is that in addition to a clock, the main menu now also has a World Map option. From there you can view the game's map, as well as fast-travel between locations you've visited before.



You can move the cursor around to highlight your destination, while moving it to the edges of the screen scrolls the map (which is actually quite large). For those without the patience to find their destinations' exact locations on the map (or for those times when you've simply forgotten), you can instead press X to open a quick menu displaying all your available destinations in a list.


Another new addition to the main menu is weapons and armor. The weapons & armor menus are now actually functioning menus, rather than placeholders, as they used to be.



All base (i.e.: non-magical) equipment functions as expected of a D&D 3.5 game, including the ability to Dual Wield smaller weapons, use larger weapons in two hands and Double Weapons having two separate attacks.

All equipment is unique, so you can have several different pieces of Chain Mail, for example, each with different extra bonuses. You can also press X while highlighting any piece of equipment to view a description window detailing its properties:



Another nifty feature is that the equipment you use will actually affect your character sprite's appearance in-game. So even if you have two characters which look exactly the same after you've finished customizing your appearance when you start the game, they will still end up looking different if you have, say, one wearing scale mail and the other wearing a helmet and a set of full plate mail:




Finally, I've completely reworked how I'm representing player attributes in-game. Initially, I was using the standard RPG method of assigning players some base value of, say, Strength, then in a separate structure I'd hold any enhancement bonuses they might have from, say, equipment or abilities.

When I started actually implementing equipment I realized how this didn't quite fit the way D&D handles attributes: there's an unlimited number of different bonuses that can be applied to any attribute, and you have to keep track of what bonus is of what type, because bonuses of the same type don't stack (with a couple rare exceptions).

With that in mind, I completely reworked how I model player stats. Now, every attribute is actually a hash table, which itself contains an array of values of a given type of bonus. The largest value is always used, but all values are stored, in addition to some meta-information on what's responsible for that bonus in the first place.

I like this because it's a much more faithful representation of how D&D attribute bonuses work, but also because it allows me to add new cool features like this:


That's what the status menu looks like (and has looked like for a while). Before, all you could do was look at it. Now, you can hit the confirm key and move the cursor into that window, like so:


And you'll get to highlight the core stats displayed in that window. Each stat you highlight has an associated tooltip which displays everything that's contributing to that stat's final value. In this case, your total AC is 17 - 10 from the base value every character has, and another 7 from your equipped armor and shield.



Bonuses are displayed in green, while penalties are displayed in red. In addition to bonuses from equipment, you can also see modifiers for certain stats, like your character's saving throws (which are modified by certain other core attributes).

And that's all I have for now!

Next on the schedule, I've actually decided to put off some of the things I detailed in my previous post (such as autosaves and minimaps), since I don't think they're terribly important to get done just yet.

Instead, I'm going to start tackling what is probably the most important part of the game: the combat system. It is, after all, the biggest part of the core gameplay and I haven't even started working on it yet. I've also gotten all the major requirements for some basic combat done (i.e. characters have equipment, stats, feats, etc. - they're more or less ready for combat in every way outside of having an actual combat system).

That's probably going to take a while, but once I have that done, this will feel a lot more like a proper game, I think. Then I can start working on the smaller things - like the minimaps, the autosaves and the quest system.