@TheCasanovaGirl t.co/L5tfC9WzFz (Today)

@TheCasanovaGirl AAUAUGHAIghdsiash430th048hahdhfadfhioahsf (Today)

@RobaatoX <3 <3 you reminded me that I need to finish this game ASAP! (Today)

@JesusCripe I am making a bunch of stuff but all of which isn't really ready for release yet ;_; Hopefully something this year though! (2 days ago)

.@Livelyivy and her team worked their BUTTS OFF on Gravity Ghost t.co/ybroOoadqw get it so they can afford butt reattachment surgery (2 days ago)

RT @Livelyivy: GRAVITY GHOST IS LAUNCHED I LOVE YOU ALL! t.co/69UeajfNCF (2 days ago)

@arcv2 it's hopefully a tool that can be used on any Google sheet. I'll release it after I polish it a tiny bit more. (3 days ago)

@Silvanis_s I'm not sure, I'm using the google docs json feeds and I think those freak out over empty cells right now. Will test later! (3 days ago)

@Silvanis_s you mean like an empty cell in the sheet? (3 days ago)

Spent the weekend making a thing that takes somethin like this: t.co/KpA4JFMBcp and turns it into this: t.co/5yRHuaLSqZ :D (3 days ago)

@KnechtsLevel @mguniverse I'll make it out tonight, probably around 6ish. (3 days ago)

@mguniverse maaaybe I don't know for sure (3 days ago)

@vonFawks looking pretty cute! (3 days ago)

RT @Livelyivy: Today is your last chance to preorder Gravity Ghost! t.co/0t1h9Nuylk (Saves $5, and you can say you liked it before i… (3 days ago)

Well according to twitter there exists a secret society of people that actually do use the insert key quite often. The more you know! (3 days ago)

Has anyone ever pressed the insert key, started typing, and then thought "yes, this is exactly what I wanted." (4 days ago)

@Fruckert Haha wow, so it is. I did a ctrl+F on the whole thing and for some reason it didn't find it. Whoops ;D (4 days ago)

@infinite_ammo @theBanov ohh I dunno. Maybe not til around pax time again for me ;( (4 days ago)

@NoelFB Or maybe t.co/QjrHFNFbbU or do you mean REAL as in only classical stuff? Like not metalish + chiptune? (4 days ago)

@NoelFB t.co/7dTg3mhOi5 (4 days ago)

follow
search

2014 - 1 - 21 / 11:59 am / general

Dev Log: RPGish Systems

Dev Log: RPGish Systems

I'm spending this week at the lovely Indie House in Vancouver, Canada! Since I was coming up to Seattle for Steam Dev Days I figured it was a good opportunity to just hop on a bus and spend some time with my best Canadian pals.

The past couple of days I've been banging my head against a wall trying to come up with some kind of RPG inspired system for the game tentatively titled Gaiaden. One of my goals for the game is to have a robust system of equipment, weapons, enchantments, and all that kinda stuff for the player to experiment with. I've never really created anything like this before so all of this stuff is completely new territory for me.

I thought a good place to start would be to check out roguelikes since they are games usually all about systems of items, equipment, spells, and more. I searched around for some open source ones and managed to find Amaranth. Although the source of this game is super clean, it was pretty hard for me to follow.

I also tried looking up just some general purpose roguelike development tutorials for using items, equipment, and all that kinda stuff. I read through a couple like this one and this one but they weren't really digging deep enough to get to the part I was really curious about. I want a system in which "Enchantments" can trigger, and then have an effect on something in the game, and I couldn't find any resources to help me understand how to build such a system.

I put out a call for help on Twitter and got help from a lot of developers, and I'm constantly amazed at how awesome the game making community is. Special thanks to all of you who helped me out via Skype and Twitter! You are the very best.

After some late night chats with developers who've been through this scenario before, it seems like I have to go down the route of using a bunch of events in order to trigger any enchantments that are on the player. The idea is that equipment in the game can have enchantments which could have simple to complex conditions, and effects. I want to ultimately be able to generate equipment and enchantments on the fly... and it turns out this is pretty tough to figure out.

I have a basic system working now, but the way I do it right now is to loop through all the available enchantments on the player and have them call a CheckTrigger() function. That function also takes in a struct called TriggerInfo, which will eventually contain a boatload of info about the current game state. I might scrap this and go for a pure event based system, but I worry about over using events and not being able to follow the code if everything gets totally decoupled. The TriggerInfo method works great currently, but I have a feeling once I try to trigger enchantments based off of things like "the player just built an island" or "the player just took damage" it'll become a pain to register that with TriggerInfo on the update function.

So that's where I'm at now, just churning away at this system to eventually enable the player to get some cool stuff set up.

2 Comments
Avatar

2014 - 1 - 22 12:17 AM

Jake Albano

It sounds like you're looking for loosely-coupled system interactions. Most of the games I make have some sort of functionality which is helpful for that kind of thing.

At its very basic level, I have a function on my World class that sends a message to every Entity:

BroadcastMessage(string name, params object[] args)

You can stuff anything in there as the payload, but you have to be careful; the flexibility comes at the cost of compile-time checking for message arguments. C# Events are stricter but they make it a lot harder to get things working on a wide scale.

In each Entity, you register a callback for when a message is received, which is done (in my case) with a dictionary of String -> Delegate. When an Entity receives a message, it runs all the callbacks that are associated with that message.

At that point hooking up complex interactions is really easy:

When you equip a ring of fire resistance, just register a function on that ring as your Player Entity's "Just got hit by fire" response.

When you make a sound in the world, broadcast the "noise" message in a certain radius so that only nearby Entities react to it -- and only if they're listening for that type of message.

When an enemy is checking to see if he has line of sight to you, receive the "LOS" message and respond back appropriately. Maybe you're wearing a cloak of shadows; have that item handle your response for you.

Trying to pick up an item? Send the "grab" message in a line in front of you and see if the item responds.

The coolest part about designing things in a loosely-coupled way is that things start to happen that you didn't even intend, but (if you design your systems correctly) make complete sense.

Codes:
https://bitbucket.org/jacobalbano/punk/src/57b843a330f373dfe82209dd17786d75df4f31d4/World.cs?at=default#cl-474
https://bitbucket.org/jacobalbano/punk/src/57b843a330f373dfe82209dd17786d75df4f31d4/Entity.cs?at=default#cl-130

Avatar

2014 - 1 - 22 1:08 PM

Kyle

Right, Otter already has an "EventRouter" that can do all kinds of messaging stuff. I don't think I want to overuse it though because things start to become insanely decoupled and logic and bugs become hard to follow and track down when everything is being fired off by events.

Avatar

Post your comment!

POST COMMENT

about

About

Hi there, my name is Kyle, and I'm a kid disguised as a grown up. I'm making video games and living the indie game developer life in Tempe, Arizona. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. I also created and maintain Otter, a 2d game making framework. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by! You're the coolest.

facebook

videos

Do you want to make a Let's Play of one of my games, or a just a video featuring footage of my games? You have my full permission to do so! Even if you are monetizing your videos, you still have my full permission to use any footage from any of my games. Go for it!

contact

Your message has been sent! Thanks :)
SEND MESSAGE