How would a faction system work?

So every now and then I have a deep ponder about how to put various game mechanics that I really enjoy into Unity as naturally that’s going to ultimately help me make a fun game I’ll enjoy. Recently I’ve been thinking about faction systems, when they’re done right, they’re so interesting, especially if the factions in question have a lot of background story to them, even minor ones.

Now I thought about how to do the basics, I’d have two sets of integers, I’d say one indicating the faction itself, much like how you’d deal with weapon switching, then another bunch of integers indicating you relationship with that faction and maybe I’d use boolean to indicate whether I’m friends with that specific faction or not after the relationship rises.

Hope that makes sense so far, but the big question is, how would I group them all together so it makes sense in the game?

Found this post and it gives a general idea at least, so I need to use arrays?

I haven’t done anything like this as of yet, but I think classes are generally best for that kind of thing, or at least a struct, because you can decide you need to add information, etc, and you don’t get in trouble. And when you are talking numbers, you generally want to use enums so the number has some type of meaning. You are going to see this same type of thinking with things like equipment, etc, and a class generally works better for that, too. Then you attach the faction class to a character, just like you would attach an equipment class to an item.
The best thing to do is look at some simple rpg examples because they do quite a bit of that kind of thing. Maybe not with factions, but with other designations, like equipment designations for head, chest, arms, feet or whatever.

I get you, good think Brackey’s has been doing a tutorial series on that very subject recently, thanks.

So you’re getting way ahead of yourself here. Don’t head down the path of “I’ll use an int for this and an array for that”. You haven’t even sufficiently described what you want the system to do yet.

What is a faction? What properties does it have? How does it change over time (if at all)?
Who belongs to a faction? NPCs? Players? How do you define what faction they belong to? Can they belong to more than one? Can they switch their faction?
How does a player change their standing with a faction? Can this be different between factions? Can factions interact with each other outside of player actions?
What impact does a faction have on the world? Do they affect territory? Grant skills or items? Provide bonuses?

There’s loads more to answer - that was just what initially came to mind.

2 Likes

Thanks, well I was just thinking that it would be a relatively simple one based on numbers to start off with to be sensible. I’m thinking of something like Freelancer long term, where your reputation increases or decreases with every mission you complete.

I found a video of the faction system I was thinking of, sorry, it’s in German, but you get the idea, you do missions or attack NPCs belonging to various factions and depending on who you kill etc. the numbers will change and that’s how you get friendly with them rather than just clicking a button to join.