How many positions are there in a 1x1 spacetile?

Guides about mapping and everything Teeworlds related.

Index
User
Posts: 1070
Joined: Mon May 05, 2014 7:30 pm
Player profile: ٭ıƞdex'<3
Mapper profile: ٭ıƞdex'<3
Clan: Eagle

Re: How many positions are there in a 1x1 spacetile?

Post by Index » Fri Jan 27, 2017 4:17 pm

Well, I never knew that I want to know these random facts.
But it's awesome, thanks for this tutorial!))
I linked this in the Link List, added headline in your post and also highlighted timakro's answer in your first post .__.
Might actually x-post this to /r/mildlyinteresting and /r/TodayILearned

User avatar
Aoe
User
Posts: 742
Joined: Thu May 29, 2014 10:54 pm
Location: Denmark
Player profile: Aoe
Mapper profile: Aoe
Clan: Infamous
Contact:

Re: How many positions are there in a 1x1 spacetile?

Post by Aoe » Wed Feb 08, 2017 10:37 pm

28x28
Image
29x29
Image


If a tee is 28x28, it should be able to move 5 pixels in between 2 blocks?

but if its 29x29 , its able to be in 4 places, it would make sense to what im corneum found out about.

So how big is a tee really? is it 28x28, 29x29 or something else?
Image

Frr
User
Posts: 121
Joined: Sat Dec 12, 2015 9:57 am
Player profile: Frr :3

Re: How many positions are there in a 1x1 spacetile?

Post by Frr » Thu Feb 09, 2017 12:10 am

Really interesting question.

<3 to topic starter.

Cloudly
User
Posts: 25
Joined: Mon Aug 03, 2015 3:52 pm
Clan: Infamous

Re: How many positions are there in a 1x1 spacetile?

Post by Cloudly » Thu Feb 09, 2017 8:42 am

timakro wrote:

Code: Select all

	//character's size
	static const int ms_PhysSize = 28;
Character size is 28

Code: Select all

int CCollision::GetPureMapIndex(float x, float y)
{
	int Nx = clamp(round_to_int(x)/32, 0, m_Width-1);
	int Ny = clamp(round_to_int(y)/32, 0, m_Height-1);
	...
}
Tile size is 32


32-28=4
32-28=4 but the 4 should be the pixels the tee can move then. How does he only move 3 pixels in the video?
Something went wrong there.

Im 'corneum
User
Posts: 1046
Joined: Thu Oct 30, 2014 4:58 pm
Clan: ☭birming

Re: How many positions are there in a 1x1 spacetile?

Post by Im 'corneum » Thu Feb 09, 2017 9:06 am

Cloudly i move only 3 pixels because i am already standing in the first position, the ground/wall.
reply to this post or your mom will die in her sleep tonight

User avatar
timakro
User
Posts: 414
Joined: Mon May 05, 2014 6:05 pm
Location: Germany
Player profile: timakro
Mapper profile: timakro
Clan: υηιqυє
Website: https://timakro.de/

Re: How many positions are there in a 1x1 spacetile?

Post by timakro » Thu Feb 09, 2017 4:19 pm

Aoe is right, would be interesting to know whats true ^^

Im 'corneum
User
Posts: 1046
Joined: Thu Oct 30, 2014 4:58 pm
Clan: ☭birming

Re: How many positions are there in a 1x1 spacetile?

Post by Im 'corneum » Thu Feb 09, 2017 4:24 pm

so there are 3 things we have to be aware of:
1. the stoppers could have a bigger Area-of-effect (Aoe ;D) than one block
2. the hook-unhooks could be smaller than one block
3. teesize is hard to find out because we dont know what tile is 1 block big, also tees are wobbly. :D
reply to this post or your mom will die in her sleep tonight

User avatar
timakro
User
Posts: 414
Joined: Mon May 05, 2014 6:05 pm
Location: Germany
Player profile: timakro
Mapper profile: timakro
Clan: υηιqυє
Website: https://timakro.de/

Re: How many positions are there in a 1x1 spacetile?

Post by timakro » Thu Feb 09, 2017 4:41 pm

Your right, the real size of a tee is 29x29! This piece of code is used for collision detection, in vanilla also for the flag for example, it gets passed 28x28 as tee size but makes the object 1 bigger than we would intuitively expect. https://github.com/ddnet/ddnet/blob/609 ... #L329-L385

Cloudly
User
Posts: 25
Joined: Mon Aug 03, 2015 3:52 pm
Clan: Infamous

Re: How many positions are there in a 1x1 spacetile?

Post by Cloudly » Thu Feb 09, 2017 11:32 pm

Im 'corneum wrote:Cloudly i move only 3 pixels because i am already standing in the first position, the ground/wall.
That is literally what i said. :D
you can move 3 pixels.. but with a tee being 28x28 you should be able to move 4 pixels.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests