RPG Class and Experience System (WIP)

The title seems a little ambitions, right? Yeah i think so too, but i feel that i can do it. As such i present to you my first build (not ready to be downloaded, but ok enough to play and get a idea on it). First off i want to say this: this here is my FIRST real effort at making something worth while in unity. Secondly, this is the first thing i plan to release to the community as a community project (eventually).

Now what kinda features it’s got thus far:
Class System.
-You can choose your Race (all with unique stats)
-You can choose your Sex (no game play difference in this build)
-You can choose your Name.
-You can fully modify your characters attributes

The Class System is buggy, and not to user friendly, but it works. Eventually i will hammer out the kinks to get it so it will work in any ones game…hopefully.

The Experience System:
-Levels
-Experience Earned Needs to be greater than Required to Level
-Has a tutorial phase, where you can’t earn EXP till the tutorial is over (like Elder Scrolls or Fallout 3)
-Leveling up grants you 5 attribute points to upgrade you character

Now the experience system works pretty flawlessly, as it is pretty easy to do anyway, but i feel for people who are just starting with Unity, this would be a good thing for them.

Now those are the two major system in this build, but they both rely on a third one.
The Attribute System:
-Multiple Attributes
-Attributes actively modify player
-Attributes are completely modifiable and changeable

Now the attributes i got so far are for are: Speed, Strength, Acrobatics, Luck, Intelligence, and Vitality. Now, Luck and Strength do not do anything, but they are good place holders to show users how to add new ones. Speed increases your movement speed, acrobatics modifies how high you can jump, vitality controls your health, and intelligence controls your mana.

Now i want to say this now:
All Formulas used in both the attribute modification and experience system come from Oblivion and Fallout 3.
Also, all art is not mine, i simply have it as place holders, will remove them once this project is released as i do not want to get in trouble.

Now if you read this far i bet your wondering where the link to the game is. Well that is right here:
http://xtoxicinferno.webs.com/rpggametest.htm

For controls or to figure out what the different boxes do then check below the game at my website. It is fairly self explanatory though.

Lastly, the dialogue system is pretty bad, and not something i am pursing as it has been done by a few people in this community. Same thing with the quest system, i simply added both to show proof of concept.

I am looking for feedback, comments, questions, and ideas on what to add!

Thank you for trying it out, hopefully this will become something really useful to some people, and if nothing else a learning resource!

WHAT A LONG POST!!! IF YOU READ THIS WHOLE THING, I AM VERY GRATEFUL!!!

An RPG class is well and good, don’t get me wrong. But there’s one problem with a generic library: each game is different. Some RPGs are action RPGs with a simplified stat system; some RPGs are complex like post-Wrath World of Warcraft, or Final Fantasy VII. If a most basic RPG backbone could be made, that would be OK, but going any further would be wasteful on your part.

All that said? Good luck!

Well the way i am designing it will make it so that regardless of the style it will work. Right now i am going after the more hardcore side of RPGs (not counting WoW as i do not play it) due to the fact, that is what most people on here seem to attempt, and i got my ideas from them. Later on i will go about tweaking it so instead of gaining EXP to level up your attributes or something like that, i will simply have it so money adds a point to you stats, much like a RPG on the iPod.

As for race and sex, that stuff can all be added or removed depending on what the people using it need it for. I plan on having this be very open-ended. Of course it will take a lot of work, but i am confident that the community will point me in the right direction.

My first thought was this:

  1. I have my stats
  2. An item has it’s stats
  3. When a player selects an item in a config screen, it should not show mine or the item’s stats. Instead, it should show the NEW value obtained by subtracting whatever WAS equipped from the current stats before adding what WILL be equipped if you select the item.

Essentially, I want to add the stats of a new item to th base stats but still remember what the equipped item id to my stats so I can display the new stats in red or green depending on wether it is an upgrade or not…

So this means keeping track of your base stats so you can upgrade that via level up etc. It means also tracking CURRENT upgrades while allowing for a temporary value to be displayed (but I don’t want to loose my current stats). Then there is also the possibility of a temporary stat upgrade / downgrade like a spell causing 25% less HP for 3 rounds etc…

My first attempt at dealing with this is as follows:

class cBaseStats extends Object{
	var Name				: String;
	var PowerBar			: _PowerBar;	
 	var values				: float[];

	function cBaseStats()
	{
		cBaseStats(0);
	}

	function cBaseStats(Base: float)
	{
		// 0 = base values 
		// 1 = adjustments
		// 2 = temporary adjustsments to max
		// 3 = temporary adjustments
		// 4 = sum total 
		values = new float[5];
		values[0] = values[4] = Base;
	}

	function GetValue() : float
	{
		return values[4];
	}

	function GetMaxValue() : float
	{
		return values[0] + values[1] + values[2];
	}

	function AdjustTempMax(amt : float)
	{
		values[2] = amt;	
		AdjustValue(0);
	}

	function SetBaseValue(amt : float)
	{
		values[0] = amt;
	}

	function AdjustMaxValue(amt : float)
	{
		values[1] += amt;
	}

	function AdjustMaxValueUpdate(amt : float)
	{
		values[1] += amt;
		values[4] += amt;
	}

	function AdjustMaxAndValue(amt : float)
	{
		values[1] += amt;
		values[4] = values[0] + values[1] + values[2] + values[3];
	}

	function AdjustValue(amt : float) : float
	{
		values[4] += amt;
		if (values[4] < 0)
			values[4] = 0;
		if (values[4] > GetMaxValue())
			values[4] = GetMaxValue();
		return values[4];
	}

	function TakeDamage(amt : float) : float
	{
		AdjustValue(-amt);
		return values[4];
	}
	
	function ApplyHealth(amt: float) : float
	{
		AdjustValue(amt);
		return values[4];
	}
}

var HP : cBaseStats;
var MP : cBaseStats;
var XP : cBaseStats;
var SP : cBaseStats;

Hope this helps in some way…