Do I need a scene for every gamobject (i.e trees, stones, ...) I want to create?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By torte
:warning: Old Version Published before Godot 3 was released.

Hello

I recently started working with the Godot Engine.

But I encountered a problem with instancing.
If I want to create gameobjects like trees or stones or something else, do I need for every single object a single scene?
Or is there a way to achive this using only a few scenes.

I want to instance these gameobjects by the script and not manually place them.

I might have just found an acceptable solution:
I am going to use a tileset and a script for the special functions.

I am looking forward for answers.

Thanks in advance

:bust_in_silhouette: Reply From: Zylann

“It depends”.
if your game is procedural, you might need less scenes by convenience. And if it’s content-driven, you’ll prefer having scenes so you can use the editor and see what you’re doing.
You can also instance scenes by script, there is no absolute separation between “doing scenes” and “doing by code”.
Now, if your game is 2D and grid-based, I think you’re indeed going to have a lot of “static” object be tiles instead of scenes, but some more dynamic objects like the avatar, enemies or pickups can be scenes.

:bust_in_silhouette: Reply From: eons

Having one scene per element could make easier to patch stuff too.

For example, If you have one tree, then you make a better tree and needs more than just replacing the sprite/texture (like collision shapes or animations or make them random forms), you will have to change whole scenes instead of a single one for a tree.

But as Zylann says, it depends on the project.