Best Methods for 2D Frame Data Storage

Godot Version

4.7

Question

What is a good way to store framedata for actions?

For a game I’m working on, I have a character with a variety of weapons and tools (all controlled by a state machine), each with behavior that changes depending on directional input. I’m currently just reading the data I need out of a JSON file at load (for saved numerical data and all that), and I was wondering if there was a better way of doing so?

Moreover, is there a good way of storing objects directly? Or is best practice simply saving the necessary primitives to construct them later? Any advice is much appreciated, and can provide more info as needed :slight_smile:

Please do.

What more information would you like? Details on the frame data contents? The state machine structure?

How would I know? It’s your responsibility to describe your problem as clearly and completely as possible. Make it easy for people to help you. Otherwise you might not get any useful responses. Read the guidelines I linked and try to follow them.

I believe I’ve provided the necessary information needed to answer the question. I offer more in case there’s something I’ve overlooked that an answer needs, but I wouldnt know if I’ve overlooked something as that’s why I ask. I’ve found nothing that quite matches what I’m looking for so far as well.

Did reading JSON pop up in your profiler? The first thing you should do is test performance if you aren’t bothered with the current programming.

In Godot using resources is one of the best ways to load and to some extent store game data. You can extend the Resource class to create your own.