How should GDevelop handle entities in Tilemap data from LDtk and Tiled #2836
Replies: 6 comments 5 replies
-
For anyone wanting to chime in and aren't familiar with LDtk Entities: https://ldtk.io/docs/general/editor-components/entities/
Entities can be either a single point, or an entire array of data. Entities are SUPER useful for numerous things in game design. One common one I've thought about is the Point (array) entity. If we can utilize this in GDevelop, we can build an enemy patrol path in the Tilemap (which stores x/y points), and use that data in events for movement. Here is an example with two different point arrays that could easily be used for enemy patrol paths: (I will mention that a slightly different beast is the Enum type (enumerator). These are MUCH more complex and can lead to different things. My understanding is they will eventually be how LDtk handles collision structures.) |
Beta Was this translation helpful? Give feedback.
-
My general suggestion is to pull the entity data in as an object variable on the tilemap. That way we can use existing expressions/actions/etc to utilize that data in game logic as needed. From my original post here: #2434 (comment) What if the entity data was imported as object variables (probably some kind of structure or array) of the tilemap object as part of using the LDTK map? Like, turning this from the output JSON into an array or structure variable on the tilemap object itself? In theory this would allow all of the entity data to be visible in the Editor (by looking at the Tilemap's object variables), the user could use existing events and expressions to pull those variables for other needs, and you wouldn't have to worry about object creation? |
Beta Was this translation helpful? Give feedback.
-
So for this task ideally we want the same api to handle tiled and ldtk entities identically. There are a number of things you need to take into consideration:
If you look of usages of tiled and ldtk with other game engines - all the behaviour of what entities do is declared in the game engine. They are just there as placeholders of data to create objects that the game engine understands - this happens when you run the game - it doesnt happen when you edit them in the game engine's ide. You either use tiled/ldtk to edit entities data or you use the game engine ide to do it - you dont use both and try to keep their data in sync. If we try to create data mirroring the one from tilded/ldtk inside gdevelop I think we will end up with potentially harder to maintain code with many corner case bugs to whack. My idea for handling this goes like so: Entities can be rendered in Gdevelop's IDE, you just cant move them in it or change their properties.If you want to do that - you use ldtk/tiled. Gdevelop has events for creating objects already, they can greatly compliment these entities. As part of such a task of course a good example project will demonstrate how to use entities data to create a game from it |
Beta Was this translation helpful? Give feedback.
-
Would entities also be of interest to be added to GDevelop? This way it's not just related to LDtk, but in GDevelop, that will be also usefull to make spawners, path node and others.. ,even an entity with a collider because actually people use a sprite for make a NPC moveing from left to right and vise versa, an entity is better than a sprite in this case. I think that entities are very useful in both LDtk and GDevelop. |
Beta Was this translation helpful? Give feedback.
-
I think Bouh's idea is an interesting one. Am I understanding the idea correctly: There is some kind of Entity object that can be used (e.g. "This is an object that isn't visually rendered during runtime, but can contain have variables/logic/be impacted by events") and a bunch get automatically created when an LDTK/Tiled map is imported? Is this something that would be created in the editor (slightly different than the runtime idea of Blurymind) Or am I misunderstanding? |
Beta Was this translation helpful? Give feedback.
-
Yes I agree it might be better informed after we have ldtk itself bundled
with gdevelop.
I was thinking of having the renderer display entities in gdevelops ide,
but not in the runtime, unless you have created an object out of them via
the event sheet.
One other idea I had was to have gdevelop create objects based on the data
that is set in ldtk. For example if you set a gdType field in ldtk to
sprite on an entity, gdevelop can interpret that as an instruction to create an object
of it in the runtime. In that regard gdevelop can have some sort of a schema you would use in ldtk to instruct it what to create.
…On Sat, 24 Jul 2021, 19:46 Aurélien Vivet, ***@***.***> wrote:
Am I understanding the idea correctly: There is some kind of Entity object
that can be used (e.g. "This is an object that isn't visually rendered
during runtime, but can contain have variables/logic/be impacted by
events") and a bunch get automatically created when an LDTK/Tiled map is
imported?
That's the idea I had in mind 👍
Is this something that would be created in the editor (slightly different
than the runtime idea of Blurymind)
We add a commands/expressions/conditions to the event sheet that reads
from the entities data and lets you create gdevelop objects from it. Doing
this in the event sheet and it happening on runtime will let us do what
other engines do
Sort of yes. Entities could be a new type in object list, The user choose *Entity
object*, select the type, enum (structure variable?), point, etc… and
configure the next inputs inherited from the chosen type.
All entities from LDtk have to be in read only in GDevelop scene editor, I
agree with that.
The others entities (not from LDtk) are free to be edited and moved, they
are not linked to a file from another program.
Reminder: We should think IDE first and event sheet after in general in my
opinion. Let's not fall into the trap of doing everything by events, both
are complementary, IDE is much easier to use for people, event sheet is so
powerful. Of course, it is necessary to be able to get the data from the
entities 😁
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2836 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRRWVNNLGL66WP6PNRP6OTTZMDBBANCNFSM5A4LGCWQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Bringing over the conversation from #2434
From @blurymind 's original question: #2434 (comment)
The big question and conversation:
How should we handle entity data in GDevelop?
Beta Was this translation helpful? Give feedback.
All reactions