Coder Social home page Coder Social logo

gurrenm3 / rpg-framework Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 2.0 18 KB

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

License: MIT License

C# 100.00%
rpg levelup game mod modding modding-tools framework tool unity

rpg-framework's Introduction

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()

rpg-framework's People

Contributors

gurrenm3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.