Norman Sword Posted January 12, 2019 Author Report Share Posted January 12, 2019 One of the differences between JSW and JSW2 is the method of screen updates. JSW2 uses XOR for all sprite updates. This does introduce a visual change to the game. One that is easy to spot.To implement XOR you basically run the game drawing routines twice in every loop. So movement and drawing are completely separated. jetsetdanny, Spider and IRF 3 Quote Link to comment Share on other sites More sharing options...
jetsetdanny Posted January 12, 2019 Report Share Posted January 12, 2019 Thanks a lot for creating and sharing these files and explaining what you've done with them, Norman Sword! :) They are extremely impressive in the sense of what you've been able to do with the code! :thumbsup: IRF and Spider 2 Quote Link to comment Share on other sites More sharing options...
Norman Sword Posted January 14, 2019 Author Report Share Posted January 14, 2019 Using XOR in the game JSWThe present layout of JSW would need a lot of changes in its code. The separation of movement and drawing brings up two immediate problems.1) The arrow routine draws and moves in one routine. This would need to be split into move and draw. Since the original arrow code is small, I would think that splitting the arrow code into two parts would not expand the routine a great deal.2) The rope has embedded in its drawing routine the ability to move willies position. This would need heavily modifying.The game engine would need tweaking to rearrange the flowMove willymove spritesdraw sprites+willy (xor on)copy screensdraw sprites+willy (xor off)loopPossible to do, yet I have shown that it is not needed.---------------------------------------------------------------------JSW2 uses XOR for its drawing. JSW uses a pixel based collision detection, which makes all sprite drawing check each pixel for collision. The arrows only check the main shaft for collision and not the line above or below (Sidetrack here: I do not think it would be possible to be in a square with the arrow parts above and below the shaft, because of the method of drawing the arrow. It assumes the arrow parts are within a character block. If they are drawn either above or below a character then other design flaws come into play)JSW2 does not do any collision detection on sprite movement, and this includes the arrows. Yet it will detect collision from anything on the screen that moves into its path.The above may seem to be a contradiction, when looking at the game engine for JSW. This is busy checking sprites and Matthew wrote into his sprite routine a switch that permits the collision part to be turned off. Needed for simple things like the boot crushing willy on the game over plinth. If that switch to turn off collision and change the drawing mode was not present, then the boot would be flagging willies death on collision with the boot. JSW2 has no collision detection in its normal sprite drawing routines. This is why it is possible for the sprites to go wherever they want. The Birds in JSW2+ are permitted to fly over the background in the secret lab. In JSW2 the eggs in eggoids collide with each other and no collision is detected. These collisions would prove to be a major problem in JSW. **** NOTE ****The Amstrad version does not use this method- This method is used only on the spectrum.So how can it detect a collision?MAGIC - Monitored Active Graphic Image CollisionEvery time Willy is drawn on the screen the local area behind Willy is modified. The game looks up the graphics that are defined behind willy and erases them. It then draws Willy to the screen. The drawing of willy is the only sprite draw that checks for collision. Since the graphics have been erased, the only graphics left in the area behind willy must be the other sprites drawn on the screen. So a pixel collision here indicates a sprite collision with willy. (or a rope- I am not widening the scope to include the ropes here) After willy is drawn the graphics are replaced in the area behind willy. This means that only one of a possible 16 sprites (jsw2+) needs to check for collision. The other sprites are drawn using a very simple drawing loop. The above is the idealised image of collision detection in jsw2 which uses XOR for drawing. Spider, IRF and jetsetdanny 3 Quote Link to comment Share on other sites More sharing options...
IRF Posted January 14, 2019 Report Share Posted January 14, 2019 (edited) Thanks for the explanation, Norman. One of the differences between JSW and JSW2 is the method of screen updates. JSW2 uses XOR for all sprite updates. This does introduce a visual change to the game. One that is easy to spot. Based on your most recent post, which tells us that Willy is drawn after the guardians, I believe that the visual change you refer to in the quote above is that: - Whereas in JSW, Willy's which INK can be partially overshadowed by a guardian's INK colour, when they come into close proximity with each other; - In JSW2, a (non-white) guardian will be partially overshadowed by Willy's white INK, when they come into close proximity with each other? Edited January 14, 2019 by IRF Quote Link to comment Share on other sites More sharing options...
Norman Sword Posted January 14, 2019 Author Report Share Posted January 14, 2019 (edited) The colouring is just another product of the game design.Four pictures . 1 and 3 use "OR" for sprite draw. pictures 2 and 4 use "XOR"We are looking at the pixels and not the colours. In picture 1 ("OR") Willies head is merged into the background, and the pixel pattern of the background is lost beneath his head. In picture 2("XOR") Willies head now exhibits the pixels of the background beneath the outline of his head.The differences in picture 3 and 4 have been lost due to the collouring changes. But the black shape of Willies lower body in picture 4("XOR") is a classic look due to "XOR" on the screen. The area of note here is the conveyor as it passes through the body of willy. The conveyor "Xor"s his body. In the "OR" version we can not see the conveyor beneath his body outline.I will find some better examplesADDED pictures. again in groups of two. Pictures 5 and 7 use "OR" and pictures 6 and 8 use "XOR"Notice the difference in First Landing (pictures 7 and 8) using "OR" the stair merges into the form of Willy. In the usage of "XOR" the stair can be clearly seenAgain the differences in pixels in "Ballroom West" (pictures 5 and 6) the rabbit platform merges into the outline of Willy with "OR" picture 5. In picture 6 "XOR" the outline and Willies shape are now undetermined. Edited January 14, 2019 by Norman Sword Spider, IRF and jetsetdanny 3 Quote Link to comment Share on other sites More sharing options...
IRF Posted January 16, 2019 Report Share Posted January 16, 2019 I've just noticed the screenshots of the new rooms (and several title screens) which have been added to the first post in this thread. Is there one missing? By my count, there are 67 new rooms shown, which when added to the original 60 gives 127. Spider 1 Quote Link to comment Share on other sites More sharing options...
Norman Sword Posted January 16, 2019 Author Report Share Posted January 16, 2019 (edited) The missing room was room 47. ( was that the original "]" room ? )The file has again been updated with the whole 128 rooms. I suppose I should delete the game file and update that as well (not done) Edited January 16, 2019 by Norman Sword IRF, Spider and jetsetdanny 3 Quote Link to comment Share on other sites More sharing options...
IRF Posted January 16, 2019 Report Share Posted January 16, 2019 (edited) The missing room was room 47. ( was that the original "]" room ? ) Yes, it's the next room numerically after Tree Root. Actually, it was called "[". ("]" appears in JSW2!) Edited January 16, 2019 by IRF Spider and jetsetdanny 2 Quote Link to comment Share on other sites More sharing options...
Spider Posted January 16, 2019 Report Share Posted January 16, 2019 Thank you for the update, appreciated. :) Regarding updates you should not have any issue 'editing' your existing download submission here if you wished to place it there instead of into this thread. Quote Link to comment Share on other sites More sharing options...
jetsetdanny Posted January 25, 2019 Report Share Posted January 25, 2019 The missing room was room 47. ( was that the original "]" room ? ) The file has again been updated with the whole 128 rooms. I suppose I should delete the game file and update that as well (not done) Which file is it exactly? The JSW VL5 DEMO revision3b.tap file on page 1 of this thread, or something else? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.