Sunday, August 5, 2012

Combat System

So after thinking about it for a while I've actually decided on the direction I want to to go with the combat system (inspired by Kevin Jiang).

It's going to be entirely grid based, similar to Fire Emblem, but instead of moving your characters and attacking one by one, you have to assign each and every character's moves before they are executed in sequence at the end of your turn. I think this is more realistic tactically because in an actual fight everyone would be moving at once, and would have no knowledge of how their teammates are faring at each moment.

For example, with hard enemies, you have to send as many characters as you think it will take to defeat it. If the first 3 kill it, one wouldn't be needed, but if 4 wasn't enough, you have to face the consequences. This is more realistic and also forces the player to think ahead and make more tactical choices.
 (lol)

Also the use of character skills will be highly integrated into the combat map. For example a skill may allow a character to move more spaces during a turn, attack through an enemy or object, heal, change the range of an attack, manipulate or pass terrain obstacles, push enemies back, modify certain stats for a period of time, modify counterattacking abilities, etc.
Each turn characters will have a certain amount of skill power to spend, to normalize skill use.
Characters can choose to defend during a turn.

I did away with the pokemon/final fantasy type battles where both sides just stand there and you pick attacks to throw at each other. I find that kind of mindless and much more conducive to annoying tedious grinding. This is going to be more like turn based strategy fighting.

Combat scenarios will be entered in two ways:
A) on the world map, in areas where the player can encounter enemies, combat begins by focusing in on a (randomly generated?) character-scale map (meaning the character is actually proper size compared to stuff as opposed to the world map where the character sprite will be the same size as a city when traveling). Enemies will be loaded and then you kill them in a turn based strategy type thing.
B) on any given map, a trigger on a tile or area can prompt combat, maybe with a cut scene.

More random bits of progress

Another amalgam of little things:

  • I put all the Fire Emblem map tiles into the map editor so I could make cooler maps. Just for fun and to see if the map editor's tile loading was extensible. I changed the tile image HashMap to a TreeMap so it would sort alphabetically so it wouldn't be all scrambled in the editor screen.
  • Added a primitive fade transition, so when changing game states it will fade through black instead of just changing screens instantly. 
    • Right now it's simply filling the screen with black and changing its transparency, switching the game screen when the black is least transparent. I'll need to either change this or create a different transition so I can fade anything in and out like menus and sprites. I think I can either go through each pixel in an image and change its transparency or apply some sort of alpha mask to the whole image.
  • Finally got around to adding sound. I made a SoundLoader that loads all sound clips, plays, stops, pauses, and otherwise manages them. Not very complicated so I don't think I'll have to change this much later but I might want to add support for .mp3 as right now it only takes .wav.
  • Made an entity editor so I can create characters, items, dialogues, quests, skills, etc with a GUI. The character tab is the only one that does anything right now. I just need to finish the inventory and skills lists, and add functionality to the "change portrait" button,
  • Improved dialogue display so it can display dialogue of any length properly. There's two lines of text at a time and the words wrap! There's also a blinking cursor when the lines fill and waits for user input to continue. It actually loads text from a file that knows which dialogue text belongs to which object.
  • Started working on combat mode. The camera can now properly pan to any target center tile, and a display a blinking cursor during combat mode. User input for this mode moves the cursor like any other sprite.

Maybe I should focus on one thing at a time instead of doing little things everywhere? But it's more fun this way and I keep thinking of things along the way...