ID:750938
 
I don't know what forum this belongs in since I don't have anything posted on the hub yet. It's just a library/framework that's still in the works. I'm just looking for comments, questions, and concerns.

I've been working on an Action RPG Framework. It'll provide almost everything you need to create a game. If you define some turfs, items, enemies, and make a map, you'll have a game. It's not ready to be released, but here are some screenshots of what it contains:

Combat:



To create the melee attack, you just need this code:

Ability
MeleeAttack
cooldown = 10
animation = "attacking"

use()
var/mob/target = melee_target()

if(target)
Combat.attack(owner, target, 10)
target.effect("sword-slash")

mob
Login()
bind_key("z", new /Ability/MeleeAttack())

The framework provides the base /Ability object whose use() proc gets called when you use an ability. The melee_target proc is a helper proc that belongs to the Ability object.

The Combat object is a global instance of the /Combat type which contains all of the procs for attacking and dealing damage. It's default implementation is simple but you can use it to add effects like damage reduction from armor. Since all damage is handled in that object, you just have to implement damage reduction in one place.

I'm not sure to what extent enemy AI will be handled for you. Currently, the framework activates mobs when a client is near them and deactivates them when no clients are nearby. The actual AI is up to you but the framework can provide helper procs to make it easy to implement.

Interface:




The framework provides the on-screen interface elements. You can customize how they look by changing the icon file they use. I expect that novice users will use these interface elements exactly as they are. They give you some flexibility (ex: you can easily change how large the inventory is), but if you want to make huge changes to them you'll have to implement your own on-screen inventory.

Here are the full lists of features I've implemented and features I'd like to implement before posting it:

Features it contains:
* Enemy AI foundation with some basic helper procs
* Deactivates mobs when no players are nearby
* Combat, damage, and death
* Health, mana, money, experience, and level vars
* The Ability object for skills, abilities, attacks, spells, etc.
- basic helper procs to use an ability, get a target, etc.
* On-screen health and mana meters
* On-screen inventory display (w/ ability to equip or use items)
* On-screen looting interface (w/ ability to pick up items)
* Ranged attacks
* On-screen money and experience display
* Inventory management (figuring out if you can hold an item)
* Support for stackable items

Features I'd like to add:
* On-screen shopkeeper interface
* On-screen townsperson interface
* Townsperson AI (limited wandering)
* Helper procs for more advanced enemy AI
* Better basic enemy AI
* Items that apply stat bonuses
* Saving and loading
* Examples of items you can use
* More graphics (overlays, weapons, etc.)
* Demos to show isolated features
* A comprehensive sample game

I'm still not sure how much will be handled by the framework and how much will be handled by the games that use the framework. The framework defines money, experience, and level vars. This way it can provide the interface to display them and the procs to update their values. But, if you don't want to have experience or level ups in your game, you're free to not use those vars.

The user will have to implement enemy AI and all attacks, but the library can make it easier to write them. The user will have to define all items but the library provides the inventory management, looting, stacked items, and equipping/unequipping. I'm not sure how the framework will handle bonuses from equipment. It doesn't define equipment slots but gives you an "equipment" list that's an associated list where equipment["slot"] is the item equipped in the slot named "slot". You're free to define whatever slots you need and it'll call the equip/unequip procs as you change your equipment.

Giving bonuses to equipment might be as easy as overriding the item's equip/unequip procs:

item
sword
equip(mob/m)
m.power += 5

unequip(mob/m)
m.power -= 5

Currently, stats like power, strength, speed, and defense aren't defined by the framework. They're completely up to you. It defines health since it's a pretty safe bet you'll have health values, but who knows what stats you'll want to have. These stats will be used by abilities and the Combat object. An ability computes a damage value (this is where stats like strength would be taken into account) and uses the Combat object to inflict the damage. The combat object is where you'd take defensive stats into account. The procs of the Combat object are easy to override so this will be easy to add, it'd be something like:

Combat
attack(mob/attacker, mob/target, damage)
damage -= target.defense
..()
I'm expecting a fun weekend now.
In response to Kaiochao
Kaiochao wrote:
I'm expecting a fun weekend now.

I don't know when I'll get a chance to post it. It's certainly not ready for actual use in developing games, but I figure I'll post it before its complete because it'll really benefit from user input.
In response to Forum_account
The countless ways to accomplish the same thing is what keeps me from finishing anything. Maybe a ton of user input would bring up a "best way"...
In response to Kaiochao
Kaiochao wrote:
The countless ways to accomplish the same thing is what keeps me from finishing anything. Maybe a ton of user input would bring up a "best way"...

It also might help people just to have the framework underneath - there are many ways to accomplish the same thing when you start from scratch, but there may be an easier or more obvious method to accomplish it using the framework.
This is really a neat idea! Hopefully it will lead developers to expand it.

I have been playing with a similar framework for a sci-fi rpg game using your pixel movement and hud libraries! The pixel movement lib demos solved a problem for me of handling what happens when you get on a spaceship since I wanted them to fly around in space by turning and applying thrust.

Incidentally, the equipment system I use is exactly as you describe. I would suggest that since variables will likely vary between games, in the demo just have one that shows items that add to the basic stats like health. Following that example should make adding new stats and items that affect them pretty easy.
This is kind of dangerous. It will spawn A LOT of action rpg's.
This looks and sounds really great! I would really like to see a turn-based RPG framework though.
In response to FIREking
FIREking wrote:
This is kind of dangerous. It will spawn A LOT of action rpg's.

Just like Albro1's framework has? lol
In response to A.T.H.K
A.T.H.K wrote:
FIREking wrote:
This is kind of dangerous. It will spawn A LOT of action rpg's.

Just like Albro1's framework has? lol

Funny man.
Haha...
Jmurph wrote:
I would suggest that since variables will likely vary between games, in the demo just have one that shows items that add to the basic stats like health. Following that example should make adding new stats and items that affect them pretty easy.

I'll probably have two kinds of demos. One kind will be a complete game that extends the framework to create a simple game. That demo will add items, stats, enemy AI - lots of things. The other kind of demo will exist just to show what the framework provides. In these kinds of demos I won't have stats or anything that's more game-specific.

FIREking wrote:
This is kind of dangerous. It will spawn A LOT of action rpg's.

That's the idea! BYOND has a lot of game developers who seem to have ideas in their head, but they get bogged down implementing other stuff. By the time they get to the part where they'd add the ideas they have that'd make their game unique, they're sick of the project. A framework like this lets developers skip a lot of that up-front work. From the very start you can focus on the things that make your game interesting.

LordAndrew wrote:
This looks and sounds really great! I would really like to see a turn-based RPG framework though.

Action RPGs and turn-based RPGs aren't terribly different. While this will only be suited for action RPGs, a large part of the project would also work for turn-based RPGs. The reason I went with action RPGs is because combat is more consistent. Turn-based combat can vary greatly from game to game. It'd be hard to make a turn-based combat system that people can customize however they need to. Maybe that'll be my next project =)


Edit: The framework also has on-screen prompts that work like alert():



You just call the mob's prompt() proc and pass it parameters like you would pass to alert() and it returns the selected value. The framework doesn't use it yet but it'll make it easy to add confirmation prompts (ex: are you sure you want to buy that item?).

I might post what I have done later today to get some feedback but it's still pretty far from being complete. I'll be busy the next few weeks and won't be able to work on it much, so I'll try to get something posted before I get busy.
I am disappointed my gag didnt get more lulz. ...
Looks like really good stuff, I'm genuinely impressed.
Cool stuff!

Features it contains:
* Deactivates mobs when no players are nearby

Just making sure but, you remembered to include an option to toggle this on a mob-by-mob basis, right?
In response to Toadfish
Toadfish wrote:
Cool stuff!

Features it contains:
* Deactivates mobs when no players are nearby

Just making sure but, you remembered to include an option to toggle this on a mob-by-mob basis, right?

What do you mean? That you can disable this feature for certain mobs so they're always active? Or that mobs are deactivated on a mob-by-mob basis?
I've been making good progress on this and will hopefully have something posted later this week. Most of the remaining features I'd like to add would be added to the sample game, not the framework itself. The only thing I really need to add to the framework is an ability bar that lets the player customize their key bindings.

Features it contains:
* Enemy AI foundation
- some basic helper procs (ex: to delay the next time ai() is called)
- only activates mobs when a player is nearby
* Combat, damage, and death
* Health, mana, money, experience, and level vars
* The Ability object for skills, abilities, attacks, spells, etc.
- basic helper procs to use an ability, get a target, etc.
* On-screen health and mana meters
* On-screen inventory display (w/ ability to equip or use items)
* On-screen looting interface (w/ ability to pick up items)
* Ranged attacks
* On-screen money, experience, and level display
* Inventory management (figuring out if you can hold an item)
* Support for stackable items
* An easy way to customize constants
* Proper display of stackable items
* Damage numbers
* Object interaction (triggered by the space bar)
* On-screen townsperson interface
* Items that apply stat bonuses
* Separate cooldowns from Ability objects
- Makes it possible to use a single Ability object for all mobs
- Makes it possible to add something like global cooldowns

Features I need to add:
* On-screen shopkeeper interface
* Helper procs for more advanced enemy AI
* Saving and loading (might be part of the demo)
* On-screen ability display that can be used to modify key bindings

Things I'd like to add to the demo:
* Examples of items you can use
* More graphics (overlays, weapons, etc.)
* Demos to show isolated features
* A comprehensive sample game
* Better basic enemy AI (currently they don't attack)
* Townsperson AI (limited wandering)
* Example of alternate combat type (ex: for handling magic damage)
* Example of additional combat mechanics (blocking, critical hits, etc.)
* Additional graphical effects (not sure what they'd be yet)

I've made some changes to how combat and abilities work. An attack generates a raw damage value and the Combat object applies that damage, taking all combat mechanics into account. By default there are no combat mechanics - if you tell the Combat object to deal 20 points of damage, it deals 20 points of damage. It contains procs you can override to add support for stats and new mechanics.

For example, if you want to give mobs an "attack power" stat that increases the damage they deal, this is taken into account in the Ability object. When an attack computes a raw damage value it factors in your attack power. The Combat object could also handle this, but the way attack power is used may vary from ability to ability. The Combat object applies all defensive combat mechanics. Abilities may compute raw damage values in different ways, but the Combat object can be used to apply the same defensive considerations - no matter how you compute the damage being dealt, the damage is reduced based on the target's armor value the same way every time.

If you wanted to have two kinds of damage, physical and magical, you'd create two types of Combat objects. One would handle physical damage, the other would handle magical damage. You define the procs to behave differently - the physical combat object would use the player's armor to reduce damage while the magic combat object would use their magic resistance to reduce damage. When you use an ability that deals magic damage, you'd call MagicCombat.attack().
Or that mobs are deactivated on a mob-by-mob basis?

Yup. So you can have AIs that are always active (merchants going around the world? et cetera).
In response to Toadfish
Toadfish wrote:
Or that mobs are deactivated on a mob-by-mob basis?

Yup. So you can have AIs that are always active (merchants going around the world? et cetera).

You can override the mob's deactivate() proc and just make it do nothing. The framework defines projectiles that can't be deactivated.