Flower's Dev Diary (Week of July 22nd)
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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! :)
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! :)
- jorgebonafe
- Posts: 2714
- Joined: Mon Sep 19, 2011 3:22 am
- Location: Brasil
Re: Flower's Dev Diary (Week of July 22nd)
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?
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.
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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.jorgebonafe wrote:Any hint of what those other annoyances fixed are?
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 :)
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
Was just wrapping up my ghast changes/testing, and thought you guys might get a kick out of my testing environment:
It's like my own personal lamentation configuration ;)
Spoiler
Show
Re: Flower's Dev Diary (Week of July 22nd)
"I don't support creative" he says...FlowerChild wrote:Was just wrapping up my ghast changes/testing, and thought you guys might get a kick out of my testing environment:
It's like my own personal lamentation configuration ;)SpoilerShow
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.
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
I don't. I also don't consider any of the other debugging tools I use to represent valid gameplay.DocHussey wrote:"I don't support creative" he says...
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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 :)
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 :)
Re: Flower's Dev Diary (Week of July 22nd)
What kind of blocks make up the free standing, jagged looking, wall on the left?FlowerChild wrote:Was just wrapping up my ghast changes/testing, and thought you guys might get a kick out of my testing environment:
It's like my own personal lamentation configuration ;)SpoilerShow
This...all of this...is just...wonky!
Re: Flower's Dev Diary (Week of July 22nd)
Looks like it's all chiseled stone bricks?Folrig wrote:What kind of blocks make up the free standing, jagged looking, wall on the left?
Come join us at Vioki's Discord! discord.gg/fhMK5kx
- Gunnerman21
- Posts: 378
- Joined: Wed Aug 22, 2012 12:53 am
- Location: WA, USA
Re: Flower's Dev Diary (Week of July 22nd)
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.
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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.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
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?Folrig wrote: What kind of blocks make up the free standing, jagged looking, wall on the left?
Re: Flower's Dev Diary (Week of July 22nd)
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.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.
Thank you!!!
Rathan01
Let's Play BTW Playlist
Let's Play BTW Playlist
Re: Flower's Dev Diary (Week of July 22nd)
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.
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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 :)
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 :)
Re: Flower's Dev Diary (Week of July 22nd)
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.
Fixing bugs like that without altering the meta too much is gold.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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.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.
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.
Re: Flower's Dev Diary (Week of July 22nd)
Oh wow, yeah, good catch. That must've taken some time to figure out.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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.Gilberreke wrote:Oh wow, yeah, good catch. That must've taken some time to figure out.
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
Re: Flower's Dev Diary (Week of July 22nd)
I know the feeling :D. I had to finish someone else's code at work last week to render avatars.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
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
Re: Flower's Dev Diary (Week of July 22nd)
Sadly the sticky wall glitch isn't completely gone. It is VASTLY reduced which is still great.
Rathan01
Let's Play BTW Playlist
Let's Play BTW Playlist
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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.kjbrona wrote:Sadly the sticky wall glitch isn't completely gone. It is VASTLY reduced which is still great.
I wasn't certain it would fix that aspect to begin with, so I'll take a substantial improvement :)
Re: Flower's Dev Diary (Week of July 22nd)
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.
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
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.
Re: Flower's Dev Diary (Week of July 22nd)
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. :)
- FlowerChild
- Site Admin
- Posts: 18753
- Joined: Mon Jul 04, 2011 7:24 pm
Re: Flower's Dev Diary (Week of July 22nd)
Thanks man! :)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. :)
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.