Master Class System - Quickly Create & Populate Classes w/o Writing Code

EDIT: Here’s the latest video. The project is no longer a “First Person Party Based RPG Framework”. I mean, it is that, but it’s a lot more now. I’m not sure what to call it. So currently “Class System” is good enough.

The project is basically, I think, a quick way to set up a class structure in Unity. Rather than hard coding your classes, you can create new lists and embed the data in them right in the editor window. You can link to other lists – basically referencing one class inside another, and as you add, delete or edit class or item names, everything is kept up to date.

So it’s somewhat flexible. Let me know what you think!


Hey all! I’ve started working on a First Person Party Based RPG Framework that I’ll be using to make my own game (http://www.TheQuestHerores.com). I’m going to put this on the Asset Store when it’s done, for a few reasons:

  1. The money, if any, will help me continue to make the game without having to get a job.
  2. Knowing it’ll be on the store gives me more reason to make sure that I do everything as well as I possibly know how, to learn better ways of doing things and to comment all of my code.
  3. I’m hoping others out there who want to make RPGs will be helped out – making the framework is half the work. I produce all the characters and environments in the InfintyPBR series, so that, along with this, will be most of the work for anyone interested in making a similar game.

The framework will have a lot of editor scripts to make setting things up easier. One of the big things I have now is a “Proficiency Editor”, shown below. Each Class & Race has different proficiency levels for all the skills and stats in the game. So this window lets me somewhat easily edit all the details in a table format.

I’m also building a catch-all “First Person RPG Game Data Editor” which is currently mostly a set of foldouts for the various things, shown below as well.

Let me know what you think!

2 Likes

First WIP video!

Is the code in C# ?

2 Likes

Yep! All of it :slight_smile:

2 Likes

Here’s what I want to provide:

  • All the generic code to get a game working. If you don’t do any changes to the math and stats and systems, you should be able to build your own game quite easily.
  • There will be a selection of solid-color-textured items, characters & enemies that I’ll be using to build the “Demo”. I don’t want people to take the framework and be able to publish the game as is, so the demo will be short and small, mostly aimed at testing every aspect of the system.
  • The UI will be bare bones and intended to test the system, rather than be perfect for game use. I want people to have to make their own UI, so that anyone who actually makes a game with this framework has to make it more unique. No sense in players seeing UI similarities between various games. Also I hate making UIs, so I doubt anything I make will be the best. And, also again, what the UI shows is really dependent on what the developer wants it to show – some may give hints when you can pick up an object or open a door or what not, while others (like myself) may prefer that users not be given such hints. (Unless, perhaps, they have a skill that would enable the hints).
  • The ability to modify the code will require coding experience. To some degree, you can add new things within the framework – skills, spells, character classes etc. But beyond that, you’ll need to do coding. I’ll be trying to figure out how to make the math somewhat unconnected from the stats, but I haven’t yet figured that out. I’d like a formula “damage” to be something you can adjust in the editor without code… but I need to figure that out.

That’s about it… It’s the code that’s important, the part that takes a lot of (often boring) work before you get to start making cool caves and dungeons and monsters. Once the code is done and solid and has all the things needed to make the game, the rest is much easier, I hope.

Very impressive. What will make it first person as opposed to an RPG framework manager that allows for any character controller? Is it that you are intending on making it a complete template that heavily integrates with your first person character controller? For example, a spell caster with first person arms, animated for casting various spells you defined; Same for warrior, archer, etc.

Personally, I’m just interested in what you have already created, regardless of any future plans for a first person character controller. Seams like a huge time-saver for creating an RPG system.

FYI, your original post url for www.thequestheroes.com has a typo (…Herores.com). Also, your Quests, and more importantly, Patreon links do not work.

1 Like

Yeah I dig the editor window that looks very slick.

I’m working on a sorta Might and Magic-ish game (skewing more Wizardry than M&M) myself. For a while I was trying to turn it into an asset store rpg kit thing but it was pretty tough not to end up with all my game specific systems spread throughout the code. My best attempt was doing a lazy loaded scriptable object singleton (in resources) that contained all the constants and formulas. Like instead of going around configuring items to have X stat (15 dmg, 5 defense, etc) they were all set to be X% of the average. So a sword could be set to 75% of average damage, a special sword to 150% average damage, when I had calls to determine damage or something it passed through that singleton, etc.

RPGs are such a pain in the ass as you proceed further and the endless edge cases and it became impossible to keep it generic so I gave up on making it able to split off into an asset store product. All those RPG kits I see on the store look like such giant piles of messy code I’m guessing from trying to cover all cases.

So maybe you’ll be more successful limiting your scope to blobber games as you can make a lot of assumptions and not have to make it too generic. I’m eager to hear more of your attempts to develop a M&M style game either way!

1 Like

Thanks! yeah, the patreon link will come down. My plan is that once I have something that’s actually playable, people can sign up for like $1 a month or something to play it and take part in fleshing out quests, fixing issues and all that. idk if anyone will be interested, but that’s the goal, like a pre-alpha-launch I suppose?

So it’s a first person party based RPG, which (to me at least) means no first person arms. Instead, the plan is to replicate the experience of Might & Magic VI - VIII.

https://www.youtube.com/watch?v=Ndx0ZvjCyXA

It does not age well… :slight_smile:

So the game will be similar to that feeling. It’s real-time, but has a turn-based mode for combat, so you can take more time picking the right spell and all that. There will be a lot of emphasis on puzzles and solving things out, and I hope to build a decent amount of randomization into the game, including randomizing the layout of some of the dungeons and quests (and solutions), so that each time you play you have to still figure things out.

I was thinking earlier today that it may be easy enough, once it’s complete, to modify it for other game styles. Most of the data would be the same. But we’ll see how it ends up going. Some aspects i still have to figure out.

I will be adding various enemy logic and spell logic – those two things are important, I think, since both have a lot of various ways of happening in game. Spells can be just a cure spell on a character (with particles on their portrait, for this style, rather than in the game view), or a fireball or an explosion or even a giant meteor shower. Enemies are equally varied: Walking, running, flying, burrowing, big & small, and all that.

There needs to be more M&M games! :smile: I wish there were more mobile ones too.

That’s an interesting way of doing the damage! I did a game (http://www.TheBarbarianGame.com) with Might, Stamina and all that, but for that I just added the might value directly to the damage. The math was more simple. For this, I’m attempting to copy the M&M math as closely as possible, since they had a really nice curve as you advanced. Unfortunately there aren’t too many resources I’ve found. There are some, but so far none that lists outright the formulas they use.

For the generic / specifics, yeah. That’s part of the reason I’m frustrated with the character creation scene. There is some code that’s more generic, but much of it is boiler plate. I may be able to make it simpler after things are more fleshed out. RPGs really are a beast. This is my 3rd attempt at this type of game – the first was my first Unity game and i Was not at ALL ready for it. I made “The Barbarian” instead – the game works, but man do NOT look under the hood.

A little over a year ago I started working on a similar project, but I think I went about it wrong, and when I got busy I stopped updating it. It was also in Unity script, and over the past few months I’ve been forcing myself to do my scripts in C#, and I’ve finally had it click, so things are going well now.

Back to mobile: I don’t want to promise anything, but I am hoping that I can include both mobile & console controls along with the desktop. Since Unity makes it so easy to make a desktop game export for mobile, I figure at some point mobile devices will be so fast that it won’t be terribly difficult to make a desktop game work on mobile. And like I said, there needs to be more M&M games for mobile! There really needs to be more fantasy RPGS in general – REAL rpgs, though, not mobile ones that feature only one or two concepts and keeps you coming back to a home base / store to buy more stuff.

Yeah blobber style games seem pretty ideal for mobile (same for EoB/DM style) so I’m surprised the only attempts I’ve seen are pretty half baked.

Some people were working on a MM6-8 engine rewrite in C++ and a Russian group was trying to do the same in Unity and they might have the old M&M math decompiled somewhere. M&MX was made in Unity (somewhat unfortunately as its poor performance gave some people a bad impression of Unity) so you can just run that through DotPeek or something if you want to check out their damage code. Considering their XP curves were nothing like the older MM games it might not be that helpful though.

Anywhere you can make things easier definitely go for it! As you said these games don’t need hands or player animations and take every shortcut you can. RPGs thrive on content so anything that simplifies adding more content is a good idea.

Have you decided how you will handle spells/skills/monster abilities? I’ve gone for the “everything is an item” approach so spells are an infinite use item, monster attacks are a dummy item, etc. That was the approach of some classic CRPGs but its definitely an important decision to make and there’s a lot of different ways to accomplish it.

1 Like

Neat, I wasn’t aware of those projects – I googled some and think I found it. Doesn’t look too active – but still, interesting. I’d be more interested in a 1:1 re-creation that doesn’t use the original assets, that uses modern assets instead.

Can you describe more about what you mean having the spells & monster attacks be “items”?

You have one logic route for your actors to “use item” rather than have a bunch of different actions like use spell, use ability, use weapon, etc. All items would have the configurable data of range, who they affect, range, power, etc. Obviously you’d need an “ItemType” enum or something so you couldn’t equip a spell or drop an ability.

So when a player attacks they use their equipped weapon but a mob would have a dummy item that just has the range, power, etc configured with no need for a name, icon, and such. A consumable would have an OnComplete effect to reduce the count by 1, a spell would have an OnComplete to reduce spell points, etc.

Since everything is used the same you don’t need to write very similar logic in multiple places. All you perform action logic is the same. No need for a special spell inventory just a normal item inventory marked to only accept spells, an ability inventory that only accepts abilities, etc.

Seems ideal if you are going for an asset store kit as its easy to just have items or expand out to spells, abilities, etc without having to change the central logic.

I’ve seen other approaches especially if the game is going heavy on command pattern as maybe you want everything to be an action and items to just be static data that changes how the action is performed.

Yeah, that may be ideal. I’m probably going to start building an item system, since I want each player to have some items in their inventory based on the skills chosen. I’ll think about this for a bit before I head into that!

I’ve been playing w/ the idea above, and I think I like it. I can switch my hard-coded “Conditions” and “Skills” to this system.

It does require some variables that may only apply to one category though. Skill, for instance, will have “Skill Points”, which is unique to them, and something the player adds.

Skills also will require a variable to “multiply effect by skill points”.

This is because each “Inventory.Item” (Skills.BodyBuilding, for instance), can have stat modifications. For Body Building, there will be a “Set Value” of 1 for the stat “Hit Points”. However, the actual formula is this…

HitPoints = (1 * SkillPoints) * SkillLevel + BaseBonus;

So I’ll need three extra variables: multiplyBySkillPoints, multiplyBySkillLevel and baseBonus

These variables, I think, can really only be used with BodyBuilding or similar skills. They’ll be visible in the editor, however, for all other “Inventory.Items”, such as “Items.Sword”. Unless I can figure out a way to only show groups of variables based on the parent class of an item.

You could take a look at the approach taken here (last post):

or here in his demo
https://github.com/petesimard/datablocks

They both have conditional attributes that only show in the inspector if they meet some criteria.

You could also solve this with inheritance (EquipmentItems have an EquipSlotType) or with this method (Attribute that hides EquipSlotType unless ItemType == equipment). To have a pseudo component approach on a ScriptableObject I screwed around with the ItemType enum being a [Flags] once so you could check if the ItemType has Equipment flagged so an item could be multiple types without any edge case coding (like a Helmet that you can also ‘use’ could be both Equipment and Usable)

Not sure what’s the better approach.

1 Like

On Making Custom Variables
The Problem of the Moment™ is that while I can have user-defined “categories” of Inventories, such as “Skills”, “Conditions”, “Items”, “Spells” etc, I want a way to add custom variables to each category. A developer may easily want a new category in Inventories and need custom variables for it. I do, actually. For “Skills”, I need these variables:

skillPoints
skillLevel
(and probably more)

In my math logic, some skills will modify stats based on skillPoitnts & skillLevel. But these aren’t needed for any of the other categories.

Potential Solution
I’m thinking of having a class of “Floats”, with a Name & Value as the only variables. This way, under each item in “Stats”, I can have a List of “Floats”. I can also have a function that returns the id # of a “Float” by name…

So…

float totalValue = firstPersonRPG.inventories[i].items[t].statModifications[m].modAmount * firstPersonRPG.inventories[i].items[t].floats[0].value * firstPersonRPG.inventories[i].items[t].floats[0].value;

// This can also be, if I use a function to find the ID based on a human readable name...

float totalValue = firstPersonRPG.inventories[i].items[t].statModifications[m].modAmount * firstPersonRPG.inventories[i].items[t].floats[GetFloatID("skillLevel")].value * firstPersonRPG.inventories[i].items[t].floats[GetFloatID("skillPoints")].value;

Any thoughts on if this causes any potential problems? I’m thinking it doesn’t…but maybe I’m wrong? There could be similar classes for bools and ints.

That shouldn’t be a problem. A serialized dictionary with string keys and float values will work but you probably will end up with few enough mods a regular list you iterate and look for the key is probably better.

If you poke around the MMX code you’ll see they have some dynamic stat collections where they assign stats on the fly based upon buffs and such. I think they are lazy loaded so if something wants to modify a stat on something that lacks it the stat gets created at its default value and then applies the mod. The opposite so if they check the value for “label” and there’s no stat it returns 0. They really liked driving everything through csv files so the designers could add things without bothering the programmers presumably.

Some people also like code generating editor scripts so your stat types and such could be an enum that if you adjust it in an Editor Window gets rewritten to match the configurable value. That makes it configurable but also type safe.

1 Like

Hmmm yeah dictionary may be better. I’ve never used one before, but it seems to be what I’m looking for since each custom variable only has a name & value. I’ve implemented a List version in the code, and that seems to work. I’ll look into switching it to a Dictionary before I much more deep into one version. I really do like this “Custom Variable” idea though. It seems versatile.

Unfortunately I’m on a mac and as far as I know the only way to look into to the code of other games requires a PC.

M&M X was a disappointment to me – I couldn’t get into it at all. First I had to wait 4 or 5 months for it to be released on the mac, even though the pre-order page said the mac & PC would be released at the same time, so I preordered. But then, when I started the game, the first sign for the town was super pixelated. Like, they just uses a low resolution image or something, and no one decided it was a bad thing. That’s telling.

But then I just didn’t get into the game after that. I have no idea why they went back to the grid based movement system.

[EDIT]
I think I’m going to stick with the classes. From what I gather, Dictionaries aren’t serializable by default, so it may be easier to just use the class and a function instead of the List ID in order to use a human readable name.

I dunno about mac stuff, but yeah M&M X wasn’t very good. The game felt pretty rushed and uneven. Like the gameplay mechanics were decent and looking at the code it seems well organized but the environments were terrible. Wildly uneven texture quality and they made a ton of performance mistakes that made it run way worse than it should. Slightly uneven floors were created with the terrain engine so they are an incredible number of polys for no reason and walls are similarly thousands of verts instead of using a bump map for details.

While I like M&M6-8 my favorites are World of Xeen so I was okay with going back to grid based but they screwed it up. Typically grid movement games have fairly grid like environments even if they are polygonal (e.g. Grimrock) so the tactical space is easy to see but the M&M X environment weren’t built on grid at all and just had grid markers stuck on it. Movement never felt right.

btw, if it is helpful I posted the code to my conditional display drawers over here:

as I’ve found a little problem with attribute drawers and custom class drawers.

1 Like

Thanks, I’ll check that out and see if I can’t learn from it. Everything I’m doing is still somewhat a learning experience :slight_smile:

I’ve completed switching the skills etc to an “Inventories” system, and I really like how it works. I think I’m going to do the same for the main stuff as well. Genders, Races, Classes – those are things that many games will need, but perhaps not all, and perhaps some games need more than just those things.

So, I’l have to come up with a name for it, but a Categories.Items system similar to the Inventories.Items should be good. And I think I can devise a way to expose a specific Categories Items list as a selectable. Character Stats, for instance, need to be represented in the “Modification” area. So I have to think on it more, but I Think I can make this so that the entire structure is customizable from the ground up, without any coding.

Once everything is set up, coding would be required. But that would depend on what kind of game a user wants to make.