Asking about structure of my game

Hey guys!

I hope you can help me understand a few things on how to structure a game better.
First of all: it shall be an Action-RPG with a few functions im not sure about how to set them up.
One of my problems is to decide what kind of functions i place in my PlayerState or in the Pawn.
The player should be able to switch freely between figures. So i would say the basic things like climbing or interactions should be in the player state. But what about the inventory and equipment. The equipment should be unique to every character but the items over all should be visible no matter of the pawn thats possessed.
And also the player should be able to lvl up those characters indiependent from eachother. Where do i save the stats and increase them unique to the pawn. The function to lvl up at the player state and the stats at the pawn? And can i scale those stats unique to every character and save them in one AttributeSet or do i have to make multiple data sheets? And also im not sure how to save them bc data sets are ReadOnly arent they?

Hope u guys can help me understanding how it works.
Thanks

You can download the Lyra demo project to check how is done. it is an advanced setup but I think is best to learn that system instead of half baked youtube tutorials from people than never finished making a game.

Specifically to your question, Lyra game (which is very similar with how fortnite works) is set up like this. There is a hidden skeleton/pawn that player controls which doesn’t change. This will then drive a visible character, in that case there is the male and female variants. So you can swap this visible character very easily as the functionality of the player character is separate of how the character looks visually.

in general store data at the highest shared level

to get started you can have everything in the player controller. just get it working

then, if your project really demands it, you can split out functionality from there to various classes

usually the impetus for code separation is to support collaboration on a team

only in AAA scoped cases will it matter for optimization concerns. given that you ask these questions, i assume and would hope you are not attempting to make a AAA scoped project.

and code separation is a detriment to maintainability so I don’t do it unless there is a clear and present reason compelling it

in other words, walk the straight and narrow path and only deviate if there is an impassable blockade

Hey,
I dont want to make an AAA game or something. The reason is mainly that i have to do it only once. So the goal is to implement basic abilities like running, jumping etc into the PlayerState so every pawn shares those abilities. And then i have to implement only character unique abilities into the character. First and formost i have to say that ist a complete singleplayer game.
Im not even sure if its clever to do it that way…

Edit: wait maybe i should use the Player Controller for it and build in the basic mechanics.
Huh… i cant get myself down to business untill i know i make it the best way possible… i hate that mindset of myself

if it is single player you especially don’t need to separate the code arbitrarily

if you are not collaborating with another person who will also be working on the same blueprint classes, you have no reason to split up the code

doing things right the first time really is not possible in games, unless you are making something from an extremely well defined template. the usual method is an iterative process where you first make quick code to test your design ideas, and then once the design ideas are locked in, you refine the code as needed for maintainability and performance.

remember, the code is means to an end. What is “right” is if the game/app functions to specification. THat is the measure. Not the code.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.