Skip to content

A small library that makes it easy to add RPG-Style leveling up to any game, mod, or project

License

Notifications You must be signed in to change notification settings

gurrenm3/RPG-Framework

Repository files navigation

RPG-Framework

A small library that makes it easy to add RPG-Style leveling up to any game, mod, or project.

I always enjoyed the leveling mechanics of RPG games and games like Pokémon. They make all the hours in the game a lot more rewarding. Actually coding a good version of those leveling mechanics can be a lot more difficult than one would expect. This library is my attempt at that. I wanted it to be as powerful, streamlined, and flexible as possible. Every method has been error tested, documented, and made overridable in case you want different functionality. There are overloads and optional parameters whenever it makes sense. To make sure the library would feel comfortable and consistent to use, I agonized over the name of every method and variable to make sure they were perfect. Ultimately, I wanted an RPG-Style leveling system that was easy to use, extremely dynamic with tons of functionality, and would just work. I wanted a cleanly-written library that would do as much as possible automatically while also providing me the ability to do things manually. That's what you can expect from this.

To actually use the library, just make an object of the RPGStat class. While it's called "RPGStat", you can use them for anything, like gaining EXP every time you go to your Desktop or open YouTube. Once you've made your stat object, use RaiseExp to increase the stat's EXP whenever you feel like it. Leveling is extremely easy to do, use the RaiseLevel method, or wait for the RaiseExp method to automatically level up the stat when it's able to. You can also use ReduceLevel and ReduceExp if you'd like that functionality.

One of the most difficult parts of making a great leveling library is making it easy to set how much EXP is needed for each level to LevelUp. On one hand, you may want to manually set the MaxExp for each level, while on the other hand you may want it to be automatically calculated (+25% every level). My solution to this problem was making the ExpTable class. It's whole purpose is tracking and managing the EXP required for each level to LevelUp. You can make your own ExpTable for your RPGStat, or you can have it automatically generated. Currently there are 2 ways to automatically generate an ExpTable. The first is using one of the overloaded constructors for RPGStat. Just provide a baseExp and expMultiplier and an ExpTable will be created for you. Alternatively you can use ExpTable.CreateFromMultiplier to accomplish the same thing.

Lastly, for those of you who need to keep track of all RPGStats, you can use RPGStatFactory to create all of the RPGStats for you. The factory has a List that gets populated whenever you use RPGStatFactory.Create()

About

A small library that makes it easy to add RPG-Style leveling up to any game, mod, or project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages