Adam's Lair Forum

game development and casual madness
It is currently 2017/09/26, 02:16

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2017/07/13, 22:03 
Newbie
Newbie

Joined: 2017/07/13, 22:00
Posts: 2
Location: Germany
Role: Gamer
Hi, I just started using Duality yesterday.
Really liking it so far and I've been reading some tutorials and trying some things for myself. I have a tileset in my project and was wondering if one can attach components to a single tile in a tileset to define how a tile should behave or interact with other objects in the game.
Or am I completely missing the point of TileSets and they are only a "visual" component with no logic attachable? Like for example a spike tile that hurts the player when walking on it?

Thanks


Top
 Profile  
 
PostPosted: 2017/07/14, 07:24 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2014
Location: Germany
Role: Professional
Hey there and welcome!

As you noticed, individual tiles are not objects, only tilemaps are. For the most part, this has performance reasons, as having around 10000 objects for a 100x100 tilemap is a very inefficient way to handle things. Instead, a Tilemap component defines the entire map as a single data block, while the TilemapRenderer renders only the visible part in a single drawcall. Think of it like a terrain object in some 3D engine: It is a single mesh which you can edit to have different textures at some places than at others.

Now when you want to attach special behavior to some areas, you'd do it by creating additional objects and placing them on the tilemap. The editor has some snap-to-grid functionality to help you with that, but theoretically, you can place your spikes and traps anywhere you like, and they will interact with other objects independently of the map.

As an example, you can check out the Tilemaps sample in the package manager, where some barrel objects are placed on the map, which the player can move around.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2017/07/14, 10:12 
Newbie
Newbie

Joined: 2017/07/13, 22:00
Posts: 2
Location: Germany
Role: Gamer
Yea I guessed it would be this way, it makes sense :)
The tilemap sample was really helpful indeed although my map is a lot simpler than that.
I will just implement more things step-by-step and if I have any questions I will just ask.

Thanks so much!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group