
-----------------------------------
Zren
Tue Dec 06, 2011 10:08 am

RPG Mechanics
-----------------------------------
My Eventual Goal is something similar to FF Tactics, 3D and all as I can't create decent pixelart to save my life. However, RPGs are complex motherfuckers hard, and complicated.

First off, I attempted to make an isometric view in 3D. This led me down the spiral pit into madness of learning OpenGL in Java. This entire project was respured into motion when I realized how simple Processing did 3D objects. Though I wanted more complex things with it than it provided. So I checked what it ran on. JOGL was a disaster. Luckily I remembered about LWJGL from reading about Minecraft. I briefly considered JME, but it felt like using a very high end tool when I needed to learn the low end first. So after grasping the basics of GL, I came up with this:

http://i.imgur.com/7wNIo.png
http://i.imgur.com/AKgRx.png
http://i.imgur.com/POYo6.png

After implementing ImprovedNoise (2D)
http://i.imgur.com/jRYeN.png
http://i.imgur.com/ypkXs.png

As you might of noticed, I haven't converted the mass of cubes into a single mesh yet. For now however, I realized I should most definitely start with the game mechanics. The renderer can be either 2D or 3D, but neither matters if the backend doesn't work.

So for now, I'm going to recreate the mechanics of the origional FF first. Figured I'd post the tidbits I finish for peer evaluation as I write them. Basicly for peers to tell me what I'm doing terribly, terribly wrong.

For now a LevelCurve class.

LevelCurve

/**
 * A class to hold and generate level curves. Uses the factory method pattern in
 * order to generate the curve. Level's begin from 1 .. maxLevel. The experience
 * required for each level is stored in experienceRequiredPerLevel at the id of
 * (level - 1) or shifted to start from zero.
 * 
 * @author Chris H (Shade / Zren)
 */
public class LevelCurve {
	private final int

Output

Character -> Stats
Character -> Jobs (aka Classes)
Character -> Job -> onLevelUp(Character -> Stats)
Item/Equipment Type
Character -> Equipment


After that I'll probably start the battle system with just a basic Attack action.

-----------------------------------
Zren
Wed Dec 07, 2011 3:32 pm

Re: RPG Mechanics
-----------------------------------
Alright, the next bit of code will most likely get a fair bit of scrutiny. That because I'm still not sure how I want to do it. The character statistics come in 3 categories.

- Always increasing integer (Level / Experience)
- Integer that will also sometimes have offsets (buffers / slow magic / etc) ( = value + offset)
- A fraction of a maximum amount. Sometimes the maximum will be buffed (HP / MP) Character

public class Character {
	private Map stats = new HashMap();
	private Map statOffsets = new HashMap();
	private Job job;
	private LevelCurve levelCurve;
	private int level = 1;
	private int experience = 0;
	private final EquipmentInventory equipmentInventory = new EquipmentInventory();
	
	public Character(Job job) {
		setJob(job);
		setLevelCurve(LevelCurve.none());
		resetStatMap(stats);
		resetStatMap(statOffsets);
	}
	
	public void setLevelCurve(LevelCurve levelCurve) {
		this.levelCurve = levelCurve;
	}
	
	public LevelCurve getLevelCurve() {
		return levelCurve;
	}
	
	public int getExperience() {
		return experience;
	}
	
	public void setExperience(int experience) {
		this.experience = experience;
	}
	
	public void addExperience(int value) {
		setExperience(getExperience() + value);
	}
	
	public int getExperienceToNextLevel() {
		if (getLevel() >= levelCurve.getMaxLevel())
			return 0;
		return levelCurve.getExpirienceRequiredForLevel(getLevel() + 1) - getExperience();
	}
	
	public void setLevelAndExperience(int level) {
		setLevel(level);
		setExperience(getLevelCurve().getExpirienceRequiredForLevel(level));
	}
	
	public void setLevel(int level) {
		this.level = level;
	}
	
	public int getLevel() {
		return level;
	}
	
	public void nextLevel() {
		setLevel(getLevel() + 1);
	}
    
    // ...
	
	/**
	 * Main method used for testing.
	 * 
	 * @param args
	 */
	public static void main(String

Output (of a single tick):


My next update will be a simple back and forth battle ([url=http://finalfantasy.wikia.com/wiki/Battle_Systems#Traditional_Turn-Based]Traditional_Turn-Based). submitted something of it's kind before here, but oh well. Following that I'll work on making into an ATB. Then I'll walk down that page. I'm purposely skipping magic and other menus as the more current system involve a charging up and a cooldown system.
