Tasks that are Easy Enough for newcoming programmers
#31
Hey, got VC2008 up and working Smile

I took a bit of time and added the max stack cases for all the blocks that are defined. So far there seem to only be a couple blocks missing from the definitions, so I skipped those to leave the naming up to you guys.

Missing from BlockID.h are:
Item Frame
Empty Map
Nether Star
Iron/Gold/Diamond Horse Armour
Lead (Leash)
Mob Nametag

Other than those, everything else is properly added to the max stack thing.
https://dl.dropboxusercontent.com/u/3852...king.patch

Oh and btw the edits to BlockID.h are only notes on the missing items.
Reply
Thanks given by: xoft
#32
I think blocks should be named only after they are released in the game, so the horse armor, leash and nametag will be better off left until the name settles Smile

Patch committed as rev 1614.
Reply
Thanks given by:
#33
Well I found the part that checks if blocks are in range to pickup, and I think I fixed the bug where you can pickup blocks 1 block below you (in a 1 block deep trench). It's a really simple fix, and it seems to work fine. Take a look:

https://dl.dropboxusercontent.com/u/3852...ange.patch
http://www.mc-server.org/support/index.p...ask_id=396

I just added && DiffY > -0.6 so items a block below you don't get picked up but items half a block below still get picked up.
When experimenting, I found that "(*itr)->GetPosY()" doesn't indicate whether items are on a half slab. (When on level ground, Y=101, when on a slab, Y=101 still)
Reply
Thanks given by: tonibm19
#34
I think the problem is in a different thing. The Y coords are based at lowest entity points, so the distance from the pickup is measured to the player's feet. It might be better to measure distance to torso, at Y + 1, this should provide much better results and won't need the extra condition.
Reply
Thanks given by:
#35
(06-21-2013, 04:44 PM)xoft Wrote: I think the problem is in a different thing. The Y coords are based at lowest entity points, so the distance from the pickup is measured to the player's feet. It might be better to measure distance to torso, at Y + 1, this should provide much better results and won't need the extra condition.

That still wouldn't solve the problem as it's not a problem with the player but with the dropped items. The items have the same Y coordinate when they are on slabs as when they are on the ground instead of having a .5 Y coordinate.

In other words, the Y coordinates of items are always integers.

In addition, a problem is that a sphere is being used to test distance for pickup, so there will always need to be an extra clause unless the square distance method is revised because the player should be able to pick up at 1.5 blocks away horizontally, blocks 1.5 above the feet, and .6 blocks below the feet. So you see 2 of these are 1.5, so they are already consolidated in one condition. If you change the measurement from the middle of the torso, you will need 3 separate checks, because it will be 1.5 laterally, .5 up from the torso (if torso is 1 above the ground), and 1.6 below torso.

I tested this for a few hours. The items Y coordinates of items on the ground are definitely bugged, so even if we measure from the torso, the problem won't be solved.
Reply
Thanks given by:
#36
No, it's because the MCServer physics have no support for half slabs, only full sized blocks
Reply
Thanks given by:
#37
(06-22-2013, 12:21 AM)FakeTruth Wrote: No, it's because the MCServer physics have no support for half slabs, only full sized blocks

That would explain the lack of half-coordinates for items. But I mean it is that that's causing the problem right? I don't think measuring from the torso will do much. The player's coordinates seem fine.
Reply
Thanks given by:
#38
Where did you get those numbers? Are they exact, or are they measured?
A simple solution would be to use an aspect ratio on the individual coords, so that the unit sphere matches the ellipsoid we need for the check.
Reply
Thanks given by:
#39
(06-22-2013, 02:10 AM)xoft Wrote: Where did you get those numbers? Are they exact, or are they measured?
A simple solution would be to use an aspect ratio on the individual coords, so that the unit sphere matches the ellipsoid we need for the check.

I took (*itr)->GetPosY() and printed it to the server console, so it should be exact. It also explains the behavior I was seeing.
Reply
Thanks given by:
#40
I meant, how did you come up with the 1.5 and 0.6 blocks distances for collecting, did you test that on a vanilla server, or is it just a guess?

Measuring is always an approximation only, the exact numbers can be found only in the client sourcecode, if you manage to get MCP working Smile
Reply
Thanks given by:




Users browsing this thread: 9 Guest(s)