[Eternal WIP] Basic RPG Framework

As the title implies it is basic RPG Framework. At current stage it is really basic, and can serve more as an code sample to see my thought process when I have created it, rather than fully fledged starting point for creating RPG game.

My main goal with this project is to make framework for RPG building game, where you don’t have to code, but where you simply assemble all needed functionality in Blueprints. Out of nessesity more core game mechanics are implemented in C++. These could be done in Blueprint, it would make them far to complex, and the goal is to make blueprints as simple as possible. Some of these are already in. They work at basic level, but I haven’t yet tested it by creation (or recreation ;p), more complex spells/abilities, like you can encounter for example in Guild Wars.

Also please note that all my decision were dictated by RPG mechanic design I have create far earlier, and all further addition will also be dictated by this design.

DISCLAIMER:
The code might work, or it might not work. It might blow up your PC or your city. I don’t know and I do not take responsibility for it.
It is provided as is. Updates are not to be expected. When there will be update in repository expect it will break all compatibility with previous code.
I might accept pull requests if someone is crazy enough to commit something here. But don’t expect that. If you want to commit, put your name in file in code, and describe here why you changed thing that you changed (or why you added new one).
Adhere to Epic coding standard. If you will not, you will burn by the flames of thousand suns for eternity.

I’m not working regularly on it. Most often on weekends. I’m not programmer, so expect bad practices.
If you have any feedback feel free to post it here. Or on GitHub. I might consider it or I might not. Depends on my mood, and how it fits to my plan.

Feel free to do anything with the code.

What is in:

  1. Some Blueprint helper functions that will help you create Powers. Powers are active abilities that player can use to harm, help, or perform other interactions with world.

  2. Effects - persistent objects that can affect any actor that have EffectManagerComponent. Also comes with some Blueprint Helper functions. Effects do not exist in the world beyond on actor that they are affecting.

  3. Some more or less basic attribute system, along with struct data structures. They do not serve any particular purpose now beyond storing simple data, you can treat more as an example on how I decided to solve pretty common RPG games problems, like:
    a) Where do I store character attributes ?
    b) How do I know how many debuffs character currently have ?
    c) Where do I get my data for calculations (resistances, value per attribute etc).

  4. Basic implementation of damage system. I utilized AActor::TakeDamage and UDamgeType class. I decided to use it solely because it is quite deep integrated into base code of provided engine already, and there are lots of events and blueprint function that make use of those systems. Instead of reinventing everything again I decided I will bend UDamgeType to do my bidding. Even though it looks like there might be potentially dozens of DamageType classes to fully support system.

  5. Basic inventory management. It is implemented as separate component. It handles equipping and unequipping items from character. Also handles things like stats subtraction/adding from/to character.
    Default implementation assumes that there is no stat stacking. Highest stat will be preserved and everything lower than it will not be added to final stat pool (just like in DnD).

What is missing:

  1. XP Gathering. I have no intention of adding any sort of levelling system. As I never plannned to have levels in the first place. Though There will be probably some sort of XP gathering, for small progression.
  2. Save system.
  3. AI.
  4. Quest creation helpers.
  5. Replication. Honestly I don’t even know how hard it would be to make this code good for replication as I never considered multi player.
  6. Melle combat system. Frankly I don’t even know how to best handle it. Trough powers, weapons, or as entirely as separate system.
  7. UI - well there is some basic UI. But there is nothing like Action Bars or inventory.
  8. Weapons. There is basic class, but beyond holding skeletal mesh it does nothing.
    My plan is to create an ordinary shooter weapon system with some RPG twists (like spread/recoild handled by attributes and by player)

There is some sample content with code. I’m not 100% I uploaded everything (;. Easiest way to start working with it, is to create TPP template, name it RPG and the delete source code folder.
Copy my source code instead. Remember to do not use provided solution file. Delete it and generate your own.

I haven’t had time to check it out, but it looks really promising. Do you have any videos or screenshots of this in action?

Well, there is nothing really to show on screenshot. Unless you are interested in flying box, DebugDrawLines, random numbers on screen and debugger from Visual Studio.

If I had some flashy content I would post for sure :wink:

You definitely need to add some programmer art and make a video.

Every framework needs a working example to showcase what it is capable of.

Hi inside,

I created a TP_ThirdPerson C++" Project, Name is RPG and i delete the source code folder. In VS2013 rebuild the RPG Project and when i start this, have this error “The game module ‘RPG’ could not be found. Please ensure that this module exists and that it is compiled.”

Can u pls help me inside?

Greetings,
Ulrich

@anonymous_user_fb796d6c
It works fine. I restarted my VS2013.

I’m working on porting my RPG Engine over to UE4:

Check it:

http://www.garagegames.com/products/rpg_engine_toolkit

My Youtube Channel:

https://www.youtube.com/user/shoiko

Its a SQLite3 Database Driven RPG System.

Are you sure you have build it using DebugGame Editor or Development Editor option ?

Also make sure to right click on RPG.uproject and Generate Project Files.

I know. Just adding art here is no priority right now :D. I’d rather focus on more clear interface, so I can show some numbers crunching.

I found how to make it work, you need to override all source that are inside sources -> RPG, but do not overridethe 2 filles called RPG.Target.cs and RPGEditor.Target.cs

Then you can generate visual studio files from the RPG.uproject and you will be able to compile and play.

inside, I have some questions, it seems like you forgot to add the crosshair material, can be this the reason because I cannot fire spells(powers)?

I mean, Its suppossed that I have a power and a weapon (cube) equiped, but mouse do nothink, the only difference I see with the TPP starter template ingame is the lateral movements, the “awesome text” and that I can attach a weapon to a socket.

Could you explain a bit what is the current state of development or how to test it? any kind of functional attack, power, or damage added?

Thanks!

I forgot to tell that you need to create custom input binds for function. By default I binded mine to 1 and 2 on keyboard, though didn’t uploaded config files. You can do it trough editor > project prefrences.

ActionButtonOne()
ActionButtonTwo()

Name your bind the same as function ActionButtonOne etc.

If anyone interested i have recently made some changes:

  1. Added new blueprint node that will temporarly decrease health of character, and after set amount of time it will return it by the same amount. Other nodes in similiar fashion should come along, as soon as I figure out how I want to handle it for attributes.
  2. Refactored a bit RPGPowerBase, and splited it into subclasses, that are based around how those powers are casted (instant cast, charged cast (you must keep pressing button to charge power), charged channeled (you keep channel power as long as you press button), cast time and channeled).

changes are not yet pushed to github.

Great work, with that Im able to do some things.

Thanks for your help and keep up the good work, Im just starting to figure out how Unreal Engine is working with the c++ and blueprints, but if I can help you with somethink tell me, I will be testing and developing this framework too

I have updates sources on GitHub.

I have refactored EffectManagerComponent to not be dependent on actor to which it is attached (as it should be from the start).
It is still somewhat depedant on URPGEffectBase (and vice versa), I don’t know if or how to break that dependency since, essential task of Effect is to modify actor it is affecting.

I also refactored quite a bit of properties, and changed them to protected or private, and instead added functions that modify them. Like Add, Remove, Set, Get, Subtract etc. It is on going process, and eventually I will strip all public access to fields that are not UPROPERTY (and in some cases UPROPERTY will be protected for sake of sanity).

Also. All types of Power types are now perform basic task of… casting!
Powers are subclassed based on how they are casted. Like CastTime, CastTimeCharged, ChargedChanneled, Instant etc.
Each of them override basic events, to perform correct casting behavior, and subtraction of resources needed for casting.
Resource subtraction is not implemented yet. I have not decided how i exactly I want to do it, although basic implementation is fairly simple, if anyone want it right now.

I also added some helper functions to use in Blueprints for effects. Like getting current amount of Effects per type on target character, temporarily subtracting health (after set amount of time subtracted amount of health is returned to character).

Sorry still no video, but beyond walking blue character with box attached to head, that shoot other boxes, there is not much to show right now.

Once I get some fancy UI going on that is able to show numbers in visible manner, I will add video!

Another thing, to do would be to add some animation handling to effects and powers, so they can apply animations to actors.

Project is still alive.

It have undergone some heavy changes and refactoring.

Now project is splited into two Separate folders. RPGSystem and Game. In future it should be splited into separate modules.

Attribute and Effect system is going to be complete replacement for default Unreal DamageType system.
Actors that have AttributeComponent, can be targets of effects. Actors without this component are completely ignored.
Effects and Componenets doesn’t care what attributes are on actor. You can specify attributes for your actor as you see fit, and the tell effect to affect those attributes.

To add your game specific attributes, you MUST create Child class of RPGAttributeComponent.
In that child class, add your game specific attributes along with any functions, that might be helpful, to handle them with your game specific cases. You can see example in Game folder.

You create effects using Blueprints, but extending from RPGEffectBase, or your own class that derive from RPGEffectBase.
You can modify attributes in effect by getting variable TargetAttributes or CauserAttributes, and using function SetNumericValue, Get NumericValue or ModifyAttribute. You must specific Name of attribute you want to affect.

There should be better way of specifing attributes you want to affect, rather than typing them. Like Asset with all attributes, and you just select one from drop down.

It’s still WIP but now basis are pretty fleshed out. Things that are needed now are events, and utilities for applying attributes to actors in various ways.

I had a similar thing going on myself, also named ‘RPG’ from which I’m deriving my UE4 version of Elium (which is in its early infancy). I say ‘had’ because I’m focusing all my attention into my UDK version of Elium, but once I finish that (hopefully sometime this year, or the next at most) I’ll switch to UE4 completely

perhaps we could join efforts in the future? we’d need to discuss some sort of planning and goals of course, but even if the projects are different I imagine doing a joined effort for the codebase could be beneficial. let me know what you think

also there’s the RPG template in Epic’s roadmap for UE4, which is another good reason for me to wait :slight_smile:

My issue with the SkillSystem that is Unreal code right now, is that is very heavly focused on using Data Tables, Data Curves, Data Assets.
While the SkillSystem is far more advanced than mine, I honestly don’t like they way it is intended to use in most cases. Though it is still early in development, and I don’t see a reason why it wouldn’t change.
While I focus on leveraging blueprints to do all work. Which also have downsides (and I even hit some of them).

Help is always welcome. While I don’t really need help with coding, it would be good to have some feedback, on what to change what to improve, how people like to work.

I don’t know about this SkillSystem that you’re speaking of, I’m only talking about the “RPG Game Template” in Epic’s roadmap which they’ll do in the future. I don’t think it’s the same thing but maybe I’m wrong

like I said it’ll be months before I make the full move to UE4 so maybe by then my help would be completely unnecessary. for now I’m afraid I don’t have time to check it out to give feedback, but I’ll keep an eye on this and whatever it is that this ‘RPG game template’ from Epic ends up being, and when the day comes I’ll probably use one or the other.