0 votes

Hi, so I've been really into the FINAL FANTASY style of games, and wanted to take a crack at building my own. So far the logic is coming to me and I'm understanding things, but there are lots of things I do not understand. Here are some things I'm questioning and my thought processes behind them. If possible I'd like to be pointed in the right direction.

Character / Entity Relationships
I'm aware I can build an Entity.gd, fill it with basic default stats, and make sub gdscript files for each character that would modify their stats. I'm wondering. Would I make them all scenes and perhaps put them in a "Character" folder? I assume every character I make would be a Node2D that has a player script and extends my Entity.gd. Then each scene for each character could have its own sprite, an animation player, etc.

Keeing Track of a Player's "Team"
I'd like to build a lot of characters that a user can choose between to "build their team". I understand that using auto load is a way to keep things to persist between scenes. Would this apply for a player's "team" or is there a better way to go about it. From my understanding I could perhaps create a PlayerTeam.gd autoload singleton that would keep track of which characters the player has.

Since there are maximum of four on a player's team at any given point perhaps I can do something along the lines of:

var char1
var char2
var char3
var char4

Then in another script, for example a menu to change a particular character

var player_team = $myAutoloadSingleton
player_team.char1 = $Characters/SomeCharacter

And whenever I'd need to get and use a player I can just grab that character using player_team. This is my thought process but I'm wondering if this is appropriate or if there is a better simpler way? (or even if this will work at all)

in Engine by (18 points)

1 Answer

0 votes

The heart of this question appears to be "am I thinking about these concepts correctly?" and "is my plan viable?".

The answer to both is yes.

If you are looking for an alternative implementation just to have something to evaluate the tradeoffs of your approach against, you could consider not having a 'team' so much as always having references to all of the characters and each of them having a variable that indicates if they are currently on the active part of the roster. At the start of combat you'd loop through the list and add those with the variable set.

Note: I am not advocating that you change your plan, just offering another option for contrast.

by (856 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.