Wednesday, 9 December 2015

Don't believe everything you see!

Whilst things are progressing, it hasn't perhaps been as quickly as I'd like because I've been chasing down a couple of 'bugs' in my C implementation. I won't bore you with too many details, but I was testing the animation of the moving blocks when I came across room #29.

Whilst I hadn't noticed any issues with the room rendering prior to this, room #29 was obviously completely wrong...



This can't be right!?!

Spectrum Original













After spending a few hours chasing down this issue, including painstakingly comparing the graphics object table between the original (memory dump in MESS) and my C code, I couldn't see any differences at all.  And then it hit me...

Because I haven't implemented the Z-order logic yet, the rendering of objects is done in arbitrary order (more correctly, the order in which they are defined in the location table). Of course I realised this - what I didn't realise though, is that it could create the type of optical illusion you see above! If you follow the outline of the block structure with your eyes, it is actually correct.

Lesson learned, I'm continuing to work my way through the object handler routines. In fact, player, guards and wizard aside, I've finished most of the simpler objects. What I haven't done, though, is the low-level object collision/interaction routine, so atm (movable) objects fall through other objects to the floor, and pass through them when moving around. But they do move in the manner intended and are confined by the physical boundaries of the room.

Fun fact #34: spiked balls don't drop immediately in rooms with odd-numbered location ID!


No comments:

Post a Comment