Author | Message |
---|---|
Namor |
Subject: Elite Moray ship Dear Mark,
I was wondering if you might remember a particular issue in the code: it looks to me as if Moray type spaceship is never spawned in any of the versions documented on your site (apart from Elite-A). My theory is that a particular portion of the code where it is supposed to be spawned is the Main loop part 4 of 6 (see copypaste below), but the the carry flag is actually supposed to be 1 instead of 0, e.g. BCC instead of BCS should be used. That would make the potential list of bounty hounters: Asp Mk II, Python (pirate), Fer-de-lance or Moray. Somehow this misprint in the code was repeated in every single version of the game. Would you be able to confirm my suspicion? CMP #100 \ If the random number in A >= 100 (61% chance), jump
INC EV \ Increase the extra vessels spawning counter, to
AND #3 \ Set A = random number in the range 0-3, which we
ADC #CYL2 \ Add A to #CYL2 (we know the C flag is clear as we
|
Namor |
Subject: Elite Moray ship I am sorry, I have forgotten to include a link to the code.
|
Mark Moxon |
Subject: The Moray does not spawn Hello Namor. You know what, I think you are right! I hadn't realised that the Moray never gets spawned, but your analysis looks totally correct to me. That's fascinating! It could easily be added to the list of spawning pirate ships with the addition of a single LSR A instruction just before the AND #3, which would set the C flag randomly and increase the range of A to 0-4, thus including ship #28. And as you say, Elite-A does spawn the Moray, as the ship files are organised differently. Brilliant! I will add this to my commentary, and might even roll the fix into my Compendium versions - I think there might be room for one more byte of code. 😀 I will also credit you with this discovery on the acknowledgements page, if that's OK. Well spotted! Mark |
Roman |
Subject: Elite ramdom events Hi, Mark!
These little things are actually what partly makes digital archaeology interesting: given the asteroids bug in the released version and ships position problem, we certainly have the impression that random events where nightmarish to debug for Ian and David. "LSR A" instruction certainly fixes the problem, but it gives ships #25-27 a higher probability of spawning. Looks fine to me though, since we will never know the original developer's intention. Most probably they won't remember this after 40 years. Feel free to update the commentary with or without acknowledgement -- both options are completely fine with me. Roman is my actual name. |
Mark Moxon |
Subject: Spawning code Hi Roman! Thank you so much, I have added your observation to the commentary and have given you a well-deserved credit on the acknowledgements page: https://www.bbcelite.com/about_site/acknowledgements.html Thank you! A couple of interesting points spring to mind. 1. You said "LSR A instruction certainly fixes the problem, but it gives ships #25-27 a higher probability of spawning." I'm not sure this is true; an ASL A would indeed give #25-27 a higher probability of spawning, as bit #7 of A is more likely to be set following the CMP, but I don't think an LSR A would change the probability, as bits 0-3 of A are all still random at that point. I think this is right, anyway... 2. Looking at the code, I suspect that a SEC before the ADC might be my preferred solution, anyway. * SEC would change the range to 25 to 28, which would cover the Asp Mk II, Python (pirate), Fer-de-lance and Moray. * LSR A would give a range of 24 to 28, which would cover the Cobra Mk III (pirate), Asp Mk II, Python (pirate), Fer-de-lance and Moray. It's hard to know what the authors' original intent was, but the Cobra Mk III (pirate) can already be spawned as part of a group of pirates, so I suspect the first fix might be the correct one, as then there is no overlap between pirates and bounty hunters. It's a guess, though! They might have wanted the iconic Cobra to be spawned as both a pirate and a bounty hunter, of course. It's very interesting stuff - thanks for getting in touch! Mark |
Roman |
Subject: Probabilities Hi, Mark!
I would like to share some thoughts about options 1 and 2. 1) LSR A
Or to put it the other way: carry bit has equal probabilities of 0 and 1 after the "LSR A", while the A register has equal probabilities of 0-3 after the "And #3" instruction. Thus the probability of their sum would be larger to be #1-3 than to be #0 or #4. Anyway, that actually makes some sense. I looked up the "Dark wheel" novel that was published with the game and Moray ship is mentioned as being very rare. That may refer to the fact of Moray being present in a single blueprint file though. Having lower probability of Cobra III makes sense too -- since it is already spawned as pack hunter. 2)SEC might actually be a waste of a precious byte in my opinion.
to the following:
My guess is that this may be what actually happened during the development, it is very easy to erroneously print BCS instead of BCC. 3) As a side-note -- I want to mention that your reference to the Minsky cycles is very educative. It never occurred to me the the simplest way to draw a circle would result in a spiral instead. These tricks were probably not very relevant for a while -- we could calculate sin/cos instead without much trouble. But some of these are getting useful once again, since we are about to have a simple computer in every utensil today. |
Mark Moxon |
Subject: Moray options Hi Roman. 1. Good point! You are absolutely right, of course - and it's a great example of the complexity that comes from just one simple instruction. I really like the way this approach makes the Moray much rarer than the others, while still keeping the Cobra in the running, just like the original. Great explanation, thank you. 😀 2. Very nice, that would be a much more efficient way of doing it (and every byte counts in this game!). I still think I prefer option 1 for my bug fix version, but this is very neat. 3. I have to thank Rich Talbot-Watkins on Stardot for mentioning Minsky in this context, or I might not have spotted it! It's extremely clever stuff - it makes my mind bend, in a good way. Thanks for sharing your thoughts, really appreciate it! Mark |