2D Practices - Making enviroment , character , npc's

Godot Version

4.6 Stable

Question

I’m starting a new thing which i haven’t focused a much but trying to get a more head around.

Current look ,pretty much empty project with tilemap.

I had go in past with 2d games, and followed how to .

But there is not many thing explained about what is best to use for which purpose .

First Question -

I see two types of tilemap from Kenny , does it serve some purpose or different usecase in Godot ?

2.) Generally in most of tutorials saw using Sprite2D as child of CharacterBody2D , but what about AnimatedSprite2D would be not suitable ?

Is creation of AnimationPlayer better practice ?

3.) What is easiest way to get Sprite2D from tilemap asset ?

Do you ever change Import setting for those tilemap asset for different format ?

4.) Parallax background - Parallax2D

Is it only Sprite2D can be attached to this type of node or you can utilise tilemap asset to create more intresting and layered background ?

5.) Making NPC - Friendly NPC to interact with for exchange resource

So making resource ( coin, gold_wings) , UI and simple signal to open UI when player enters collider , - Would StaticBody2D be appropriate or its better use Area2D ?

NPC would be in one place .

The difference is the size in memory. The packed one use less space, but are somewhat more difficult to work with because the objects aren’t lined up. Starting out I would use the non-packed version. You are unlikely to run into memory issues unless your project becomes much larger.

If your have an animated sprite sheet, you can use AnimatedSprite2D. It just exposes some syntactic sugar. e.g. you can call “play” on it to start the animation easily.

I think once you start making more complicated animations, this is what you will use. You can do anything with AnimationPlayer that you can do with an AnimatedSprite2D. I went this route from the beginning just to learn the harder thing. It just takes a bit more setup than just calling play() on the AnimatedSprited2D for example. But it lets you do many complicated things as well.

For what purpose? I suppose you can use an image program and just cut out what you need. You can also just put the entire tilemap png into a Sprite2D and then use the Animation section to narrow it down to the single image you want.

You wold change Frame which is just an increasing number counting the frames. You would need to set Hframes and Vframes to match the rows and columns you have in the png.

Can you clarify what exactly you would want to do with a tilemap here?

I’ve generally used Area2D for this and OnAreaEntered.

Dan

1 Like

Random allocations across certain sizes of cloud and their positions with extra layer of gradient of darker and brighter area utilizing tilemap tiles and module them slightly

I am not aware of anything built in to allow you to do this, but of course you should be able to write code to manipulate your tilemap files as you like.

1 Like

It’s a bit of custom idea I have in mind , similiar to chunk system but here using tilemap coordinates to allocate certain tile’s from tile set and for background just multiple tilemaps controlled with script below parallax2d