Tasks that are Easy Enough for newcoming programmers - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Tasks that are Easy Enough for newcoming programmers (/thread-503.html) |
RE: Tasks that are Easy Enough for newcoming programmers - Stephen304 - 06-21-2013 Hey, got VC2008 up and working 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/38528459/Stacking.patch Oh and btw the edits to BlockID.h are only notes on the missing items. RE: Tasks that are Easy Enough for newcoming programmers - xoft - 06-21-2013 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 Patch committed as rev 1614. RE: Tasks that are Easy Enough for newcoming programmers - Stephen304 - 06-21-2013 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/38528459/PickupRange.patch http://www.mc-server.org/support/index.php?do=details&task_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) RE: Tasks that are Easy Enough for newcoming programmers - xoft - 06-21-2013 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. RE: Tasks that are Easy Enough for newcoming programmers - Stephen304 - 06-22-2013 (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. RE: Tasks that are Easy Enough for newcoming programmers - FakeTruth - 06-22-2013 No, it's because the MCServer physics have no support for half slabs, only full sized blocks RE: Tasks that are Easy Enough for newcoming programmers - Stephen304 - 06-22-2013 (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. RE: Tasks that are Easy Enough for newcoming programmers - xoft - 06-22-2013 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. RE: Tasks that are Easy Enough for newcoming programmers - Stephen304 - 06-22-2013 (06-22-2013, 02:10 AM)xoft Wrote: Where did you get those numbers? Are they exact, or are they measured? I took (*itr)->GetPosY() and printed it to the server console, so it should be exact. It also explains the behavior I was seeing. RE: Tasks that are Easy Enough for newcoming programmers - xoft - 06-22-2013 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 |