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.
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.
Java 2D Tile-based RPG Project
Sunday, August 5, 2012
More random bits of progress
Another amalgam of little things:

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...
- 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.
Monday, July 30, 2012
Lots of new stuff! Input handling, dialogue, menus, event dispatching, and map editor improvements
Ok it's been about a week since the last post, and I've improved on quite a bit of stuff.
- Implemented an event-driven communication system for game objects
- Instead of trying to directly access another object's data or continuously check a condition each frame, objects can now send "events" through a central event dispatching system. Objects can register with the EventManager to receive notifications for specific types of events like "Event_Game_ActorCreated" or "Event_UI_MenuOpened". Each frame, the EventManager stores events in a queue and dispatches them in the order they were added.
- Revamped the input handling system
- Keyboard and mouse states are now recorded in handler classes. This allows more advanced state information to be recorded that the native java handler doesn't support(or I don't understand how to use), such as distinguishing between operations that require a key to be held down versus just pressed once. My input handlers store the key states as boolean values in a int array (since keycodes are ints). Each frame it updates and the advanced state of the key is stored in a separate array of enum KeyState, which has PRESSED, RELEASED, and ONCE, where a key is ONCE only the first frame it is pressed. This is useful, for example, if pressing a key opens a menu; you want to make sure the menu only opens once even if you hold the key down, otherwise it would keep opening and closing non-stop
- character movement is much smoother now with this system
- Added a really simple and poorly designed dialogue system, but hey the text scrolls! :D
- Added some awesome translucent in-game menus. Escape brings up the system menu with save, load, exit, etc (only the resume button does anything right now but its easily extensible). T opens the game info menu with player stats, inventory, and skills.
- Improved the map editor
- I made it so that the editor only draws to the visible area in the scroll panel (I'm at a loss as to why that's not already a feature) so I can create HUGE maps now with barely any lag. Even a 999,999,999 x 999,999,999 map ;). But if I try to fill everything with tiles it freezes at around 2000x2000, though I'm not sure if I could fill it manually or not. Anyways that's big enough since the game will connect multiple maps.
- The tiles are also sorted now! There's a new panel that allows you to select the type of tile you want to paint, like terrain or trees or characters or whatever. It's not complete but the implementation is there.
- Now for some random details.
- I reorganized the class structure for renderable things, so stuff like Character extends a Sprite class which encapsulates the drawing information.
- I also took the big enums like GameState and EventType and made them their own classes cause it was really annoying to have to make the static reference every time.
Monday, July 23, 2012
Animation stuff
Back from China a couple days ago, didn't get to touch this much over there since I didn't have much free time and the internet was maddddd iffy. Anyhow since I got back I've created a working animated sprite class family and did some work on tile collision. The animated sprite takes images from a sprite sheet that ImageLoader splits up into frames and displays each frame based on a timer. Also, it can display the animation according to the direction of the object, so if a character is running to the left it will show the left facing animation. I also added basic undo and fill-all features to the map editor.
A random map from the map editor. You can't see the running animation but trust me it works :)
Saturday, June 30, 2012
Map Editor
Over the past couple of days I've been working on a map editor to make creating maps easier. Basically you can select a tile on the right and it will draw on the grid panel. It features drag drawing, a stunning but soothing light purple grid color, and a beautiful translucent highlighter that highlights the tile that your mouse is hovering over. It also has a menu that creates new maps of a specified size and name, and saves and loads as per usual. Still some kinks to work out; the way I have it right now if you try to make a map 300x300 tiles or so java will run out of heap space... D:
I also made some changes to the structure of the main game code so now the map loading is much more efficient. Before each tile held a reference to its image but now all the images are held in a hashmap in the imageloader and each tile just points to the corresponding one, so it can load maps of any size no problem.
Going to China tomorrow morning so it'll be a couple days before I can get back to it.
Wednesday, June 27, 2012
First update!
So I've been working on a 2D tile based RPG game in Java for the past month or so, though I only started coding about a week ago. Actually I just looked up when the files were created and it was exactly one week ago...within 30 min :D. Before that I've studying up on game programming basics like the game loop, animation framework, image loading, collision detection, sprites and good OO programming. I'm writing everything from scratch, and as of now I'm not planning on using any third party game engine or framework, though depending on how things go I might have to migrate to one. I've also written a good bit of the basic story line and history, and planned out most of the game mechanics.
Game mechanic-wise it's essentially going to be a mix between Fire Emblem and Final Fantasy, where you walk around and explore the world, but at certain points you are presented with a scenario that you must complete at which point the game becomes a turn based chess-like strategy thing (like in Fire Emblem). When you attack an enemy the combat is similar to Final Fantasy, and you will have a party too.
The game is very early in the development stage. Right now I have the basic game frame down, and have written most of the core code for characters, maps and tiles, a timer, and a camera that determines what is visible on the screen. Here's what it looks like right now (video quality's really bad sorry).
Game mechanic-wise it's essentially going to be a mix between Fire Emblem and Final Fantasy, where you walk around and explore the world, but at certain points you are presented with a scenario that you must complete at which point the game becomes a turn based chess-like strategy thing (like in Fire Emblem). When you attack an enemy the combat is similar to Final Fantasy, and you will have a party too.
The game is very early in the development stage. Right now I have the basic game frame down, and have written most of the core code for characters, maps and tiles, a timer, and a camera that determines what is visible on the screen. Here's what it looks like right now (video quality's really bad sorry).
You can move your character around and it moves smoothly from tile to tile and the camera follows the player. I just finished the camera class and it took a while to figure out how to get it to follow the character smoothly and pan around the map so patting myself on the back right now :). You can pause the game and change screens, where esc goes to the "title" screen and C goes to a blank black screen. As you can see there is occasional glitch with the character rendering, I might try to fix that later but I'm not too savvy with graphics stuff like hardware acceleration so I might just leave it.
My friends Allan and Brandon are helping with the project: Allan's doing some concept art and might eventually end up doing most the game art and Brandon is helping me code.
I most like won't finish this summer, but either way its gonna be KICKASS.
Mike
Subscribe to:
Posts (Atom)