Design really depends on your requirements. If this is going to be pokemon style the id system is easy.
0 none default catchall placeholder
1 creature x
2 creature w
3 … Etc.
I would create a Resource class that has all the base stats and assets defaults for each creature. You can have a base class and extend it with the name of the creature
extends Resource
class_name Creature
@export var creature_name = "PLACEHOLDER"
@export var type = TYPE.NONE
@export var sprite = PlaceHolderImage.new()
enum TYPE {
NONE,
GRASS,
...
}
... Etc.
extends Creature
class_name GrassMonsterCreature
func _init():
creature_name = "GrassMonster"
type = TYPE.GRASS
sprite = load("res//: path to sprite")
Or!
set the type and assets in the inspector and save a stand alone .res without making a new script.
This Resource is added to an exported array. And can be filtered and sorted based on your needs. This system will be in charge of spawning creatures in the wild.
Then when the player collects the creature the resource is saved with the player inventory, the resource can be used to display UI elements repurposing the sprite property creature_name and type.
Then for the creature character assign the resource to the character
extends characterbody2d
class_name CreatureBody
# set this when creating a creature body
@export var creature_res:Creature = Creature.new()
func _ready():
$Sprite.texture = creature_res.sprite
$NameLabel.text = creature_res.creatue_name
$TypeIcon.set_creature_type(creature_res.type)
...Etc.
This can be extended for custom animations, attacks and so on.
The id part can be a function of the master list that has all the base resources. Or it can be a tool that looks at the list and sets a creature id based on the order in the list and resaves the resources.
Idk this is just an idea there are many ways to go about this. All that matters is how you want to manipulate the objects.
So design the attributes of the creature that need to exist. Design the systems that will need various resources to represent a creature. The systems wil dictate what is needed in the data and the data will dictate the interactions with the systems.