0 votes

Hi,

I have a turn-based game with several characters with stats etc. At the moment my save script runs at the end of the fight, and saves all nodes belonging to class "character". This leaves removed nodes out. I want to save both removed and remaining characters at the end of a fight, to award xp ad so forth.

What is the best way to go about this? I have some ideas on how to proceed, but I'd appreciate some confirmation from someone with exprience and insight.

a) Have a boolean variable "injured". This would require a lot of checks with turn system, pathfinding etc.
b) Re-instance injured characters to an invisible node, and read them from there for saving.
c) Append the removed characters to a list, and re-instance them for saving.
d) Save all character experience (or other relevant info) to singleton, and save the information from there at the end of a fight.

Thanks for any input!

in Engine by (51 points)

1 Answer

0 votes
Best answer

Don't overthink it. Since this is a relatively simple problem I think most of your suggestions would work fine.

If you asked me this question without providing options I would probably just suggest keeping a list of the defeated enemies and use that list to calculate the experience/treasure/etc after combat.

by (856 points)
selected by

Thanks. I'm going ahead with a dictionary of sub-dictionarys per character, and copying that to a singleton at the end of a battle.

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.