ID:1176332
 
(See the best response by Ter13.)
I am having trouble with getting the bounding boxes for my icons as well as layering.

I will show you two pictures of my character standing 'in front' of and 'behind' a tree, and then I will explain what my problem is.

Here's a pic of the character standing 'behind' the tree:

http://d.pr/i/U9Ir


Here's a pic of the character standing 'in front' of the tree:

http://d.pr/i/aRFY

As you can see, the tree trunk is a layer above the player, so when the character walks from behind the tree, all is well since the stump has a bounding box around it.

The problem is when the player is standing in front of the tree, the trunk is a layer above, so it puts the character under the trunk and above the stump.

This may be a very trivial problem but im new to all this pixel movement stuff, so I apologize for any noobiness.

What do I have to change around to minimize the bounding boxes for my character (which is just around his feet) and the tree (which is just around the stump), in order for characters to pass in front of and behind the tree 'normally'.

If I haven't made myself clear, please let me know.


Thanks again,

Balt
Bump
Best response
What you are doing is an example of 3/4 perspective. Try swapping the world.map_format to SIDE_MAP

By default, BYOND considers games to be TOPDOWN_MAPs, meaning that regardless of positioning, things with a higher layer always show over things with a lower layer.

Isometric and Side maps, on the other hand, assume that things closer to the bottom of the screen are in front of things further back of the screen, and handle layers within those constrains with an exception of background layered objects.

BTW, this really should go in Developer Help.
First, yeah i was kind of torn between this forum and the Developer help forum, but I guess it couldve been either.

Second, thanks for your help.

I'll try doing what you suggested and I'll reply with my results.


Thanks again,


Balt
Hi,

How should I set the layers for the tree then? Should they all be one layer above my player? or all on the same layer?
Now I am getting this:

Because my player is "below" the top of the tree, the player is considered 'in front' of the top of the tree.

This is happening even though the layer of the top of the tree is MOB_LAYER+1.

The tree is split up into three separate icons, the top, the trunk, and the stump.

The trunk and top are both a layer above, but still appear 'behind' the player when the player walks into a position under them.

Any ideas?

Ok.

I solved my own problem.

I made the tree one icon instead of several, and no more issues.

Thanks again.


Balt
I believe that this is the snippet.
the simplest thing to do is to put the starting point of the tree at the bottom most pixel in the tile. Of course the tree is SUPER skinny, I haven't tried this because all of my bounds are based on a 64x64 base, but you might be able to change pwidth or that specific tile/icon.

The easiest thing for me to do when doing a tileset is use up as much of the "tile" as possible. That means making the bottom part hog up the box and start up the bottom. The bad part about this is that you're using pixel movement, so making the tile dense would probably be for the best. It just works better if you use up all of the space you can for trees.

for my game I have this:
mob
base_state = "mob"
pwidth = 24
pixel_x = -14
pheight = 32


Which gives me this:

Because the pheight is smaller than the actual base it basically allows me to add an extra depth to the game instead of just putting a tree stump as non dense tile and on a lower layer than the base, and then the upper part of the tree being a different layer from the bottom. (Don't mind those bushes btw, just for the example)
Thanks for your replies.

I ended up making the tree into a single icon, and then making the bounding box surround on the stump. All this after changing the map_format of course.

Everything works the way I'd like it to work.

Thanks again,


Balt