Intro sequence - stray pixels
Maroc's astral projection descends to the Gatehouse Level in the short intro sequence at the start of a new game.
There are a few stray pixels which create 'holes' in the silhouetted landscape. As a result the lightning flashes are visible through the silhouetted backdrop.
Stray pixels in intro sequence
These are caused by Maroc's graphic - or more specifically, the top pixels of his hat and staff - having a starting position a bit too high up on the screen.
Fix with POKE 49219,81 (or any number a little above 80) to lower Maroc's starting position.
Intro sequence - lightning effect colour bleeds into border
In the intro sequence, there's some colour bleed in the left hand border with the lightning effect:
lightning effect in intro sequence
This is because the left and right borders are included in the blanket screen colour changes in the 'lightning flash' routine (58896) is run.
Instructions at 58921 and 58931 check/set screen attributes that are INK 0, PAPER 6 when flashing from yellow to blue. This includes a bit of the left border.
A simple fix is to change the colour to one not used in the border, e.g. POKE 58928,56; POKE 58932,56 for white.
fixed lightning effect in intro sequence
Attribute bleed on left of screen
Avalon has some colour clash, as coloured graphics are drawn over other graphics.
We all know this is difficult to avoid on the Spectrum. But having different colour graphics in the game, rather than single-attribute-colour screens, brings Avalon to life.
However, there is some avoidable clash. Occasionally the colour of a creature or item may bleed into the left of the playing area:
attribute bleed on left of screen
(Note the cyan tinge on the left hand door from the goblin warrior)
The routine at 58365 calculates the screen attribute address position from each graphic's vertical/horizontal pixel position when it is erased/drawn.
At 58380 the ADD A,9 adds 9 to the pixel position (in the character square) before dividing by 8 using RRA x 3.
This would be fine if the horizontal pixel position was 1-8, but it's 0-7. So if graphics land in certain, very specific screen positions, this will miscalculate the attribute display address.
The instruction can be fixed by using ADD A,8 instead. Fix with POKE 58381,8.
Stray pixels - Door
The bottom of the side walls door has a stray pixel which means it isn't quite parallel to the top of the door (though this may be deliberate!).
door graphics issue door graphics issue fixed
Fix with POKE 40338,48; POKE 40339,12
Switching between 'effect' spells doesn't reduce a spell's charges
shield spell active effect
The player deactivates an active 'effect' spell - such as SHIELD or UNSEEN - by casting the same spell again.
These types of spell slowly, but constantly, drain Maroc's energy. So the player will need to deactivate the spell after a short time.
Unlike other types of spell, 'effect' spell charges aren't reduced when the spell is activated. Instead they're reduced on the second casting that removes/deactivates the effect.
This means the player can toggle between different effect spells (e.g. SHIELD --> UNSEEN --> SHIELD) without losing any spell charges for these spells.
...But surely you'll have to deactivate ONE of those spells eventually, and lose a charge, right? After all, these sorts of spell drain energy so can't be permanently active.
Fortunately, there are effect spells with unlimited charges, such as WRAITHBANE and AMULET.
This means you can cast SHIELD - then once you're finished with it, instead of casting SHIELD again to deactivate it (and lose a charge), cast WRAITHBANE, then immediately cast WRAITHBANE again (to deactivate it).
You'll have used your SHIELD spell without depleting any spell charges.
Typos in spell messages
There are a couple of typos in the messages at 28604 that are displayed when spells are cast.
typo in spell message for unseen spell
UNSEEN spell - "TO GO UNOTICED" (difficult to correct with a POKE as there's no space to insert an extra byte!)
DISPEL spell - "UNBEWITCHMEMT" (POKE 28928,13 to correct)
Locked door on Gatehouse Level
In room 4 on the Gatehouse Level (containing two goblins) there is a locked door.
You can't open this door during the game, but it causes a crash if Maroc goes through it.
The connecting room number for this door (stored at 26552) is set to 0, which isn't valid. The game crashes while trying to read the indecipherable room data.
room glitch on gatehouse level
Additionally, if Maroc waits in room 4 for long enough, a WRAITH will enter - through the locked door..!
Periodic checks are made for creatures in adjacent rooms, and they'll wander into Maroc's room after a while, though it takes much longer than when they follow him out of a room.
The byte holding the creature room data is added to the creature room table at 27532. However, room 0 doesn't exist.
As room 1 was intended to be the first entry, to create an address offset, this byte is decremented at the start of the check at 51517.
This results in 27532 + 255 = 27787. This address is way past all the standard creature room data at 27532. So the routine ends up looking for creature information at 27787, well into the warlock data tables at 27772.
The byte at 27787 contains a value of 2. At 27532 you can see that this represents 2 wraiths.
To change how this door works:
POKE 26555,0 - to unlock the door
POKE 26553,n - where n is the destination room
The spider and the floating scroll
When Maroc kills the spider in room 142 (Goblin Warrens) a scroll is revealed, which then floats off screen in the last direction in which the spider was moving.
The scroll's spell is undefined, and the scroll itself is uncollectable regardless, as it's not defined as magic.
bug with uncollectable scroll in room 142
Strangely, this spider doesn't cause any damage to Maroc, so its intention is unclear.
To create a collectable spell after killing the spider:
POKE 30639,64
POKE 30632,spell number (from table at 28156, e.g. 9 for UNSEEN)
Hijinks with the WAYSTONE spell
When Maroc casts the WAYSTONE spell, he instantly teleports to an adjacent room. In fact, this is his current room number +1. This can get him out of some scrapes if he's being chased while scrolling in his spell list.
Normally the player wouldn't know what room number they're in, though if they do, they can use it to pass through locked doors, and even jump between levels.
One particular occasion where WAYSTONE can be used to interesting effect:
THE PORTAL ROOM
Room 82 contains a floor marking - Maroc needs to put the 4 elemental symbols onto this to create the portal that will take him to the High Temple of Chaos.
The room this portal leads to is room number 83. So Maroc doesn't need to bother looking for the elemental symbols - he can just cast WAYSTONE to take him there.
casting waystone to reach the high temple of chaos
This means that as soon as Maroc obtains Caliburn, he's able to go and finish the game.
Too many creatures in a room
The table at 27532 holds the number of creatures in each room, with the type and number of creatures being stored in a single byte.
This means that the room (in theory) could hold 3 of each type of creature (= 12 creatures). However, there is a limit of THREE creatures in a room at any one time. This is possibly for performance reasons but it also prevents Maroc from gaining an entourage of pursuing creatures in a single screen..!
So if Maroc exits a room containing 2 creatures into another room with 2 creatures, only one creature will pursue him into the room. If Maroc subsequently destroys one of the three creatures in the room, another one can then enter.
However, the data for rooms 144 and 211 puts too many creatures in the room to begin with, so not all of them appear.
One upshot of this is that as there are too many creatures in room 211 (in the High Temple of Chaos), the demon that would normally appear in that room cannot materialize, unless Maroc destroys at least one of the creatures present (goblins warrior, missile thrower or guardian of chaos).
Teleport spells
When Maroc casts a teleport spell such as PORTAL, WAYSTONE or SUMMON, his new room number (60080) is immediately calculated at the point of casting (55502).
This change to his room number is picked up at 55857 and his new X/Y room co-ordinates set.
Maroc appears in the top left of the room, at the position of the left wall/floor vertical connector.
Maroc's position after teleporting to another room
Although his horizontal positioning in the room is fine, it may be that his viewport/room vertical positions have been mixed up.
To place Maroc 'properly' within the new room after a teleport:
POKE 55869,48
Maroc's position after teleporting to another room
Frozen creatures can follow Maroc between rooms
Maroc can stop creatures from moving by casting the FREEZE spell, to give him breathing space.
However, frozen creatures are still able to somehow follow him from room to room, as there's no check in place for the FREEZE spell.
Creatures can pursue Maroc even when affected by the freeze spell
...While you might accept that a frozen creature could see Maroc exiting a room, they shouldn't really be able to follow him through multiple rooms whilst not being able to move.
Similarly, casting UNSEEN does not stop creatures from pursuing Maroc.
To stop creatures following Maroc between rooms when the FREEZE spell is active:
POKE 51494,156; POKE 51495,236; POKE 51497,0; POKE 51498,32
Or, to stop creatures following Maroc between rooms when the UNSEEN spell is active:
POKE 51494,233; POKE 51595,234; POKE 51497,9; POKE 51498,40
Certain room positions make Maroc untouchable
It's possible for Maroc to get himself into positions (e.g. the corners of rooms) where chasing creatures can't quite get to him to do him damage.
This is because Maroc has a slightly greater movement speed precision (i.e. he has the ability to move in smaller speed increments) than some creatures.
On the whole creature speed needs to be set quite high, otherwise the creatures wouldn't be able to chase Maroc very well. However, a side effect of this is that it lets Maroc squeeze closer to room boundaries than creatures can get to.
Maroc avoiding a scorpion by moving to the corner of a room
In the above animated image, the routine at 57447 triggers a boundary breach for the scorpion moving left against the side wall. It's not quite able to creep any further to the left without bouncing off it.
You can also see how, shortly afterwards, the scorpion gets destroyed by the warlock's missile, which also fails to reach Maroc's position..!
The issue mainly affects creatures and items (like the warlock's bolt) that are calculated to head straight towards Maroc's position. Other creatures, that have a random aspect to their movement, may be able to eventually reach him.
Throw me a bone! Warlock stealing and transforming room items
In room 38 in the Great Halls of the Deep, there's a BONE - it's an illusion. Maroc can cast DISPEL on it to obtain a key.
However, there's a warlock on this level too. Because the bone appears on a wall, if the warlock appears in this room, there's a chance it might move over the object and take it.
This isn't too surprising - the servant doesn't need to be involved for a trade event check, as the event/collision is between the object and the warlock. For example, the servant can throw/drop an object on the warlock and the event trigger is flagged as positive.
warlock transforming and teleporting the bone/key
Warlocks teleport unwanted objects to the current room number +3.
If Maroc follows where the item has gone - in the animated image this is by use of WAYSTONE x3 - he finds it's been transformed into the key.
So what's going on?
So although it happens too fast to see during the game, two positive event/collision checks actually occur - the first (as above) transforms the key, due to an unlikely match with the very specific DISPEL spell value.
The second is the warlock trade event check - the key isn't of value to the warlock, which teleports it 3 rooms away.
This scenario highlights the fluid, interesting, and - at times - unpredictable nature of the event/transform system in Avalon.
A similar event/collision check can cause an open door to be slammed shut if a creature missile hits one after rebounding off Maroc's active shield/barrier spell.