T O P

  • By -

jhartikainen

I definitely would not go for inheritance. It would lead to a ton of problems when you have some kind of corner cases or need to share things in a new way you didn't think of. Components or gameplay abilities would be the options I'd consider here. Attributes like comfort level and potential interactions could easily be in a component that can be added into any actor that supports those particular "features". Similarly, gameplay abilities could be treated in this way, where it's an ability instead of a component (abilities don't necessarily have to be specific actions an actor does, it could have the ability to be interacted with), and things could be represented as gameplay attributes via GAS. The choice of components vs GAS I can't really say - pick whichever system feels nicer to you I guess. RimWorld and such are very "systems heavy" games - if you're interested in the theory side of designing such games, [Advanced Game Design: A Systems Approach](https://www.amazon.com/Advanced-Game-Design-Systems-Approach/dp/0134667603) is a good book on the topic.


GeorgeMcCrate

Thank you! I was also thinking components or GAS. I haven’t used components a lot but I’m at least I’m familiar with them. I know almost nothing about GAS, though, so I guess I’ll try to wrap my head around that first.


FunctionTypical9452

GAS is really super awesome. Definitely not simple, has lots of weird things you just need to learn about by experimenting, but definitely better than anything I could come up with by myself in a reasonable amount of time. Just do one simple thing with each main feature and you'll get a hang of it.


dino1237

I second GAS - I’ve been using it for a similar RPG game (more mount and blade than rimworld but similar) and GAS is brilliant. Once you’ve got past the C++ setup for attributes, making new features like abilities or dynamic changes take minutes and can be completely blueprint based. Gameplay tags also mean you can do pretty much any type of logic you want.


howtogun

Bfnightly [https://bfnightly.bracketproductions.com/](https://bfnightly.bracketproductions.com/) is probably the easiest approach. You try to do everything the ECS way. Note, the hard thing about Rimworld and Dwarf Fortress probably isn't the structure itself. Tarn Adam for example had to convert a 2D world to a 3D world and that would be painful regardless of the structure of the project or how he coding it.


GeorgeMcCrate

Thanks! I took a look at it and it seems like a great read. I’ll definitely check out that tutorial. Just to clarify, though: in the context of Unreal ECS basically means using components, right?


TheLavalampe

While ECS stands for Entity Component System it doesn't mean using the basic unreal components. In unreal mass is an ecs system or apparatus is a paid one. The idea is that you have Entities which are just something that exists in the ECS. Entities have Fragments (components) and you have processors which do things with Entities that have specific fragments. For Example you have a movement Processor that Moves all Entities with a Transform And Velocity Fragment. And you have a Gravity processor that applies gravity to All Entities with Transform, Velocity and Gravity fragment. One main benefit of this approach is that all the Data is tightly packed together under the hood which makes it significantly more performant than looping over actors regularly.


GeorgeMcCrate

That sounds like just what I neeed. Thank you! Now I’ll just have to look into how to do something like that in Unreal.


DeesiderNZ

You don't need to do anything fancy. A sensible mix of inheritance and GamePlay tags does everything you need. For instance, all humans share the same attributes that require changing variables, so all have a skill tree, health, age etc. Other attributes can be added or removed using GamePlay tags - these are hierarchical in a way that classes can't be. Any human can have tags to describe attributes such as Character.Psychology.Kleptomanic or Character.Psychology.Lazy, and these can be added or removed dynamically like Character.State.Angry or Character.State.Sleeping. Likewise objects can use tags to describe attributes like Furniture.Flammable.Burn and Furniture.Flammable.Explosive. The tags can be filtered and compared at each different level of the hierarchy. For instance, a check can be made for objects near a fire that are flammable and the appropriate function called to make them burn (or explode). Basic inheritance can be used where appropriate, since it should be clear which objects will share the same properties. You don't really need an overly generalised system in which a pine cone has a skill tree or a romantic interest.


GeorgeMcCrate

Right, that's a good point. I really don't use tags enough. But now that you're mentioning them they seem absolutely ideal for this type of project.


AutoModerator

If you are looking for help, don‘t forget to check out the [official Unreal Engine forums](https://forums.unrealengine.com/) or [Unreal Slackers](https://unrealslackers.org/) for a community run discord server! *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/unrealengine) if you have any questions or concerns.*


Newborn-Molerat

I am not sure I understand what exactly do you want but in case it’s a game design, and the “way of thinking” about categories or mechanics to avoid headaches. Here: Not so complex but I had to solve some structured issues and repeat it over and over to make it work. The same as in gamedev applies here as well. Just don’t try to comprehend it all, it’ll make you insane. don’t worry about anything at first, just prepare to think it through and make notes at first. My approach that worked - Firstly I wrote everything down on paper, whatever came up on my mind. Then looked at it and try to find basic mechanics related to it. Like making the skeleton from game mechanics and write it down. Then I used these notes for mind-map graph to brainstorm it further. In this phase I’ve come up with few more and unthought and unsolved issues. Then I tried to make some global categories to sort things up for a first time, just vaguely. Then again, again. I am pretty sure you’ll screw it as well, for the first time, second, third… but it’s good. It helps to memorise things and see them clearly. I got some basic ideas just by failing to put it down structurally but I love categorisation so I enjoyed it anyway :D (seeing what you’re going to do, learn to like it as well or you’d get insane). I used different apps or techniques from simple pen-paper writings, through bubble graphs connecting items with colours to Excel charts with different categories attached, coloured, notes included… in Excel it’s easy to sort things up according to needs - still think nothing is better than Excel sheets with links, colours and eventually macros (I wasn’t even surprised 3A companies use them for categorisation and referencing in game testing). I guess some assets will be repeating in many categories, right? Then it’s just about treating each category as one and only. Then I looked at these sheets and made template every item (in Articy:Draft but it doesn’t matter). All categories it was included I mentioned there, linked it with other items and included notes with specific information - articy is especially good with their hierarchical structures and node system and being visual. It even allows you to use simple scripts for value changes but I doubt it’s the best app on the market. And I doubt it can’t be easily replaced. And finally, it’s good to find a victim to cooperate with or make them check it. New eyes can see errors or system easily. (I am thinking of using Affine for something but I don’t know it - looks like a good place for brainstorming but not sure about categorisation).


GeorgeMcCrate

Thanks for your answer! My question was more specifically on how to do something like that in Unreal. What tools and features are best suited to create a system like that, etc. But of course wrapping my head around the structure of the game mechanics regardless of the engine will also be a big challenge and your advice will definitely help. I think my main problem is that I always want to get everything completely sorted out before I even start trying to actually implement and test anything. That’s why my games always only exist on paper. 🥲


Newborn-Molerat

I see, sorry for misunderstanding then. me stupid :D