Flower's Dev Diary (Week of July 22nd)

A place to talk to other users about the mod.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Ah....that felt good.

Ok, so you know that problem with ghasts firing randomly at you in the nether, even though they can't see you, and slowly trying to tunnel their way towards you? Well, it's been bugging the shit out of me since I upped the ghast spawn rate and fixed a few of their other problems, and while I knew the problem resided in a rather low-level portion of the MC code, I had avoided touching it until now as I knew it would be a rather hairy and time consuming problem to resolve (mostly due to having to go through that code line by line to figure out how it's working).

Anyways, late last night it was bugging me so much that I decided to dive into that code, wound up extensively refactoring it in the process of figuring it out (stuff like "var34" is really not helpful when trying to reverse engineer a rather complex 3D ray tracing algorithm), optimized it, found the problem, and just fixed it with what I learned in the process.

Beyond the ghasts, this is a rather big deal, as like I said, this is a low level algorithm that affects many different aspects of the game and there was a big time bug in how it was working that was essentially turning blocks transparent to the code (particularly AI) in certain circumstances when they really shouldn't have been.

So yes, ghasts fixed for next release, and you guys may also see a number of other small annoyances in the game magically disappear along with it, as well as a slight performance boost for good measure. Huzah! :)
User avatar
jorgebonafe
Posts: 2714
Joined: Mon Sep 19, 2011 3:22 am
Location: Brasil

Re: Flower's Dev Diary (Week of July 22nd)

Post by jorgebonafe »

Hell yes! Pun intended :)

You probably don't remember, but I posted a long time ago in the former official anarchy server thread how pissed off I was when I went afk in the nether for a couple of minutes and came back to see a hole in my ceiling and lava on my feet, all my inventory burned to ashes.... So, I can't express how happy this change makes me....

Any hint of what those other annoyances fixed are?
Better Than Wolves was borne of anal sex. True Story.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

jorgebonafe wrote:Any hint of what those other annoyances fixed are?
Man, there are some for certain like skeletons randomly and repeatedly shooting at walls that are definitely related, but there are others which might be linked to it too but which aren't really feasible for me to test right now given they're rather sporadic. I don't really want to state my suspicions there though, as it will inevitably be misinterpreted by someone as being a statement that they are fixed.

The long and the short of it is that there are an awful lot of these kind of line of site tests being run by the game, so having the underlying code working well (and faster) is a good thing :)
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Was just wrapping up my ghast changes/testing, and thought you guys might get a kick out of my testing environment:
Spoiler
Show
Image
It's like my own personal lamentation configuration ;)
User avatar
DocHussey
Posts: 190
Joined: Fri Jul 06, 2012 1:02 pm
Location: Jackman, ME

Re: Flower's Dev Diary (Week of July 22nd)

Post by DocHussey »

FlowerChild wrote:Was just wrapping up my ghast changes/testing, and thought you guys might get a kick out of my testing environment:
Spoiler
Show
Image
It's like my own personal lamentation configuration ;)
"I don't support creative" he says...

On topic though, I don't see thousands of ghasts floating about. How did you get them to stay around long enough to shoot at you repeatedly?
FlowerChild wrote:I'm drawing a line in the soul sand.
finite8 wrote:Give me all your diamonds and your enchanted gear or your base is going to resemble a Chunk Error.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

DocHussey wrote:"I don't support creative" he says...
I don't. I also don't consider any of the other debugging tools I use to represent valid gameplay.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Ok, now that I've had a chance to play around with it for a more prolonged period of time, I'm ready to share ONE of my suspicions with regards to the bugs this line of sight thing may have fixed :)

You know that annoying glitch where you'll be walking through a narrow tunnel and Steve will momentarily get caught as if he's collided with an invisible block? Well, I believe that may be gone as a result of these changes.

I haven't had it happen once since I made them, and I have one narrow tunnel in the nether where it used to happen almost every time I went through it. I just walked its length ten+ times in a row and it didn't happen once, nor has it occurred during several hours of general play either.

I had my suspicions that might be related to the line of sight code. My current theory is that what was happening is that it was turning blocks transparent to the collision code sporadically, causing Steve to become partially imbedded and then blocked in the walls of such narrow corridors.

Anyways, let me know if anyone sees this again, but I strongly suspect it may be another long-standing annoyance resolved :)
User avatar
Folrig
Posts: 199
Joined: Sun Jul 10, 2011 1:34 am
Location: United States

Re: Flower's Dev Diary (Week of July 22nd)

Post by Folrig »

FlowerChild wrote:Was just wrapping up my ghast changes/testing, and thought you guys might get a kick out of my testing environment:
Spoiler
Show
Image
It's like my own personal lamentation configuration ;)
What kind of blocks make up the free standing, jagged looking, wall on the left?
This...all of this...is just...wonky!
User avatar
Zhil
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Flower's Dev Diary (Week of July 22nd)

Post by Zhil »

Folrig wrote:What kind of blocks make up the free standing, jagged looking, wall on the left?
Looks like it's all chiseled stone bricks?
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
Gunnerman21
Posts: 378
Joined: Wed Aug 22, 2012 12:53 am
Location: WA, USA

Re: Flower's Dev Diary (Week of July 22nd)

Post by Gunnerman21 »

O.O do you think FC that this also fixed the "animals drowning in walls" bug?? Cause of what you said about your narrow nether tunnel i got suspicious
Spoiler
Show
I am... THE TAXI MAN.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Gunnerman21 wrote:O.O do you think FC that this also fixed the "animals drowning in walls" bug?? Cause of what you said about your narrow nether tunnel i got suspicious
Maybe but I doubt it. However, there may be a number of subtle collision related bugs that this addresses. Let me know what you find out.
Folrig wrote: What kind of blocks make up the free standing, jagged looking, wall on the left?
Above all other threads, please don't off-topic my dev diary ones. Can you not find that info yourself and need to ask me about it directly?
User avatar
kjbrona
Posts: 135
Joined: Mon Mar 05, 2012 6:25 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by kjbrona »

FlowerChild wrote:You know that annoying glitch where you'll be walking through a narrow tunnel and Steve will momentarily get caught as if he's collided with an invisible block? Well, I believe that may be gone as a result of these changes.
I can definitely confirm that I am no longer getting caught in what I had previously named the "sticky hallway" leading to my mob trap.
Thank you!!!
Six
Posts: 599
Joined: Sat Jun 02, 2012 6:27 am

Re: Flower's Dev Diary (Week of July 22nd)

Post by Six »

If you have managed to stomp that well-hook bug, that is quite incredible. I had seen it several times just in the last week, both in my own play and in watching LPs. Every time it would pull me out of the game and leave me annoyed at the fact my game doesn't even know where I am. Thank you sir.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Woot! Good news then! I was hoping as I was working on this thing that it might get rid of that annoying glitch.

Yeah, like I said, this function was really at a low level in the code, governing a lot of different behavior, so we might get all kinds of unanticipated improvements out of it. Blocks sporadically going nonexistent here and there is a bit bad in a voxel game :)
User avatar
Zhil
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Flower's Dev Diary (Week of July 22nd)

Post by Zhil »

It also doesn't seem to cause new glitches to become obvious, which I was afraid of. Yeah, seems like a good fix man, good job there :)

Fixing bugs like that without altering the meta too much is gold.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Gilberreke wrote:It also doesn't seem to cause new glitches to become obvious, which I was afraid of. Yeah, seems like a good fix man, good job there :)

Fixing bugs like that without altering the meta too much is gold.
Well, it's essentially the same algorithm. I was careful to reverse engineer exactly how it was working and replicate it, just fixing the bugs, and precomputing a bunch of the variables used before the ray is traversed to minimize the number of computations and conditionals in the inner loop.

The issue it was running into before was that if a ray was oriented towards the negative on 2 axis, it was toggling back and forth advancing between them, resetting the progress on the other, whenever it hit the corner of a block along those axis. This would cause the trace to stall on that block, essentially remaining in the same place, and detecting no intersections, until the fail-safe count of traversing a max of 200 block boundaries occurred.

If you had an entity who was tracing line of sight sitting on the corner of a block to begin with (I suspect this was what was happening with the burrowing ghasts as I think they spawn aligned to block boundaries, and if they remain stuck in the same place...), this would mean their line of sight would immediately hang right in front of them when looking in certain directions (like the -x, -z quadrant). In cases like the player movement glitch, it would just randomly turn blocks transparent when the stars were properly aligned and the ray trace happened to intersect a block corner in certain directions.
User avatar
Zhil
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Flower's Dev Diary (Week of July 22nd)

Post by Zhil »

Oh wow, yeah, good catch. That must've taken some time to figure out.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Gilberreke wrote:Oh wow, yeah, good catch. That must've taken some time to figure out.
Hehe...yeah, maybe 3 hours to reverse engineer the code, turn it into something readable, and figure out what was going on late one night when it was preoccupying my mind for some reason, then maybe 3-4 the next morning to fix the problem, optimize, and test fully.

So I guess around a man-day total. That's why I generally avoid digging into that kind of code, as it can rapidly become a huge time sink, and I'd much prefer spending it working on my own stuff than on fixing someone else's bugs :P
User avatar
Zhil
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Flower's Dev Diary (Week of July 22nd)

Post by Zhil »

FlowerChild wrote:So I guess around a man-day total. That's why I generally avoid digging into that kind of code, as it can rapidly become a huge time sink, and I'd much prefer spending it working on my own stuff than on fixing someone else's bugs :P
I know the feeling :D. I had to finish someone else's code at work last week to render avatars.

Luckily I have a good team leader who just told me to rewrite it from scratch, so we didn't lose hours debugging old code.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
kjbrona
Posts: 135
Joined: Mon Mar 05, 2012 6:25 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by kjbrona »

Sadly the sticky wall glitch isn't completely gone. It is VASTLY reduced which is still great.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

kjbrona wrote:Sadly the sticky wall glitch isn't completely gone. It is VASTLY reduced which is still great.
Doh! Oh well, I doubt it has anything to do with the code in question now as I went over it with a fine tooth comb. There must be a secondary cause lurking somewhere in Minecraft.

I wasn't certain it would fix that aspect to begin with, so I'll take a substantial improvement :)
User avatar
Rob
Posts: 639
Joined: Mon Nov 26, 2012 10:23 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by Rob »

Does your improvement also fix animals falling through blocks when following the player? I don't know if it's a coincidence or just wishful thinking.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Doubtful as I strongly suspect that has more to do with client/server rounding errors than ray tracing. Also, I've seen it happen a number of times since I made the change.
User avatar
Sarudak
Site Admin
Posts: 2786
Joined: Thu Nov 24, 2011 7:59 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by Sarudak »

So I heard mention that you're going to be fixing the 'access to wood is not a problem issue'. I've been holding off on starting another world until you've finished your balancing but I have to say I'm super excited at the prospect of seeing all the pieces together! The care that you've put into shaping this game into something challenging, rewarding , and fun is impressive and has really paid off. :)
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Flower's Dev Diary (Week of July 22nd)

Post by FlowerChild »

Sarudak wrote:So I heard mention that you're going to be fixing the 'access to wood is not a problem issue'. I've been holding off on starting another world until you've finished your balancing but I have to say I'm super excited at the prospect of seeing all the pieces together! The care that you've put into shaping this game into something challenging, rewarding , and fun is impressive and has really paid off. :)
Thanks man! :)

Hehe...yeah, the tree thing has been eating at me awhile too in all honesty. My list of things left to resolve has grown exceedingly short, so that one has moved to the front of it in the absence of larger issues to take care of (like entire biomes acting as safe-zones :P ). With the exception of villagers, my balancing should be drawing to a close very very shortly.
Post Reply