Tips on how to structure many procedurally generated characters using inheritance?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nwgdusr999

Hi, trying to create a RPG-like game with procedurally generated land & characters. So far I have a character scene with a sprite, collision box and script containing stats, hp, etc. So I’m wondering, how should different character types be structured? Should they be Scenes? Just scripts? Other?

For instance, goblin should somehow inherit character, then have its stats generated, actions added, random gear, etc. Should ‘Goblin’ therefore be made into a scene?

Or should the Character initialization be done in a stand-alone goblin_script, which would initialize stats, sprites, actions, etc. and handle maybe specific/unique goblin behavior? If so, should be script be somehow ‘attached’ to the goblin instance?


I haven’t created many procedurally generated projects, but I would think that creating a script for entities (more specifically, NPCs or monsters) would be a good idea. Have a script which generates the stats for the creature, and then have another script place that creature in the necessary scene.

So it could go like this:

(Entity creator) (Goblin properties) (Scene creator) (Enemy [with attributes, such as actions and gear] placed into scene)

Ertain | 2019-06-20 16:23