Citadel Item Randomiser 0.4 (updated)

reminisce about classic bbc micro and acorn electron games here
Related forum: adventures


6502
Posts: 53
Joined: Sat Mar 17, 2018 1:04 pm
Location: London
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by 6502 »

Wow, great stuff. Citadel was one of my favourites. Breathes some new life into the old girl.
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

6502 wrote:Wow, great stuff. Citadel was one of my favourites. Breathes some new life into the old girl.
Cool. I had fun writing it, although all the testing took the shine off of playing it for me, unfortunately. Still, I've never written any 6502 assembler before (which I learned by disassembling the game in the first place), so that was interesting. I think I prefer instruction sets with multiply and divide though.

If I were to release another version I'd probably add an option to increase the game speed one notch (as in the Cheat It Again, Joe cheat). I think it might be more enjoyable if it were slightly more challenging -- if you know where you're going and how to negotiate all the enemy patterns, you usually end up completing it with a ton of energy. It would also make those arduous treks across the Wasteland and to and from the Temple a bit less tedious.

You can of course speed the game up in certain emulators with the existing 0.4 version.
Breadfi5h
Posts: 6
Joined: Sat Nov 04, 2017 7:34 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Breadfi5h »

Hello, just stumbled upon this randomiser version. Is there a version with infinite lives? Completed this as a boy some 30 years or so ago and want my 8-year-old to have a go.

The game is so damn hard to complete in one sitting when you're not used to keys.

Thanks
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by lurkio »

Breadfi5h wrote:Hello, just stumbled upon this randomiser version. Is there a version with infinite lives? Completed this as a boy some 30 years or so ago and want my 8-year-old to have a go. The game is so damn hard to complete in one sitting when you're not used to keys.
Try one of these:
:idea:
Breadfi5h
Posts: 6
Joined: Sat Nov 04, 2017 7:34 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Breadfi5h »

Cheers - this is naive I know but how do I use an SSD file with the game?
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

Breadfi5h wrote:Hello, just stumbled upon this randomiser version. Is there a version with infinite lives? Completed this as a boy some 30 years or so ago and want my 8-year-old to have a go.

The game is so damn hard to complete in one sitting when you're not used to keys.

Thanks
Currently there isn't, I'm afraid. Randomisers are traditionally played by people who have already mastered a game and are looking to find a way of prolonging it, so I suppose I felt a version with infinite energy kind of defeated the point.

There are of course cheats for the normal, unrandomised version available at Stairway to Hell, which might be a better place to start for a new player (as lurkio suggested).

The initial release of Citadel Randomiser (0.1, available upthread) used an on-disc patching scheme to modify the game before loading it. If you're playing on an emulator with disc writes enabled (AFAIK jsbeeb doesn't support this at this time), or on real hardware with a writeable disc (although using a retail master copy is not recommended), it may be possible to use the randomiser to pre-modify the game, and then subsequently load it using the Cheat it Again, Joe cheat loader, which should also be available at Stairway to Hell. You might be able to play with infinite energy this way, although I don't think I ever tested it. Randomiser version 0.1 does have a few limitations, though, and seeds from 0.1 won't be forwards compatible with 0.4 or future versions.

If none of these options are acceptable and you really want to play a randomiser with infinite energy, I can have a look at producing a new version that offers infinite energy as an option, although it might take me a while to get it done.
Breadfi5h
Posts: 6
Joined: Sat Nov 04, 2017 7:34 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Breadfi5h »

Thanks for this - really helpful. I would love it if you did make an immortal version... may even consider sponsoring!
Really want my boy to have a go and see it through but even I have problems staying alive for much longer than a good few screens.

I could have a go at trying to patch it through with what you've suggested but I normally just play it off the http://bbcmicro.co.uk/ site.

It possible to merge the cheats with the files on there? #novice

Thanks
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

If you have .SSD files (disc images), which are how most BBC software is distributed these days, you can load them into jsbeeb (which is the in-browser emulator used by the games on bbcmicro.co.uk). The main jsbeeb site is here:

https://bbc.godbolt.org/

If you click on Discs at the top, select "From examples or local", you should be able to upload the SSD of the disc you want to load into the emulator, and play it that way.

It's not currently possible to merge the cheats with the 0.4 randomiser because of the way its loader works, but I will look into adding infinite energy capability to the next version.
Breadfi5h
Posts: 6
Joined: Sat Nov 04, 2017 7:34 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Breadfi5h »

Thanks all, great help :D
User avatar
billcarr2005
Posts: 1840
Joined: Fri Sep 09, 2005 4:01 pm
Location: UK
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by billcarr2005 »

Breadfi5h wrote:Is there a version with infinite lives? Completed this as a boy some 30 years or so ago and want my 8-year-old to have a go.
Here's the PIAS version with the Immortality cheat implemented (CITAX, &451B=&60)
Works with the Randomiser :)
Attachments
CITADEL (PIAS1 - IMMORTAL).zip
(15.54 KiB) Downloaded 107 times
Breadfi5h
Posts: 6
Joined: Sat Nov 04, 2017 7:34 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Breadfi5h »

Awesome - cheers
triaxisaworm
Posts: 9
Joined: Tue Dec 11, 2012 10:07 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by triaxisaworm »

Many thanks for sharing this randomiser - its breathed a whole new life into the game for me and makes me realize why I always thought this was the best game ever made for the Beeb - much as I love Exile and appreciate Elite. I didn't realize how non-linear the game layout was until you play it like this. It probably wouldn't work with other games like Palace of Magic as they need most of the puzzles solved in order to open up the next part of the game.

Many thanks again, I love playing it on double speed on Beebem - much quicker getting across the Wasteland and to the Island, but it takes some practice shooting the monks and getting round all the other baddies at this speed! Its a miracle how the author ever crammed it all into Mode 2.
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

triaxisaworm wrote:I didn't realize how non-linear the game layout was until you play it like this.
From memory, I think it turns out that something like 10% of all possible permutations can be completed for the full 99 points, which is higher than I expected. I agree that it's a different experience to how it would be playing it normally. It's easy to forget for example that you can grab the first item in The Pyramid with nothing other than the magenta-and-white key to open The Wasteland.
Many thanks again, I love playing it on double speed on Beebem - much quicker getting across the Wasteland and to the Island, but it takes some practice shooting the monks and getting round all the other baddies at this speed! Its a miracle how the author ever crammed it all into Mode 2.
No problem, I'm glad you're enjoying it.
avengahM
Posts: 8
Joined: Mon May 28, 2018 5:07 am
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by avengahM »

I was just going through the code for the randomiser and reading the comments, and I noticed that you only took the barrel into account for the Witch's House. It can also be used to get into the Cellar crown room. (But not the Prison; that and the trampoline warp are the only two places the barrel can't be used instead.)

Just for clarification,"Trampoline warp not needed" is unclear so if I say "Y", does that mean the warp is not needed and if I say "N" it is or may be needed?

I just completed a seed where I picked "Y" and it wasn't needed.

Great work, thanks!
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

avengahM wrote: Tue Jun 11, 2019 11:48 pm I was just going through the code for the randomiser and reading the comments, and I noticed that you only took the barrel into account for the Witch's House. It can also be used to get into the Cellar crown room. (But not the Prison; that and the trampoline warp are the only two places the barrel can't be used instead.)
I actually thought the jump off the barrel to the crown tunnel was impossible. I think it's because if you try it, your character's head only touches the ceiling and doesn't actually stick into it. But I've just tried it and you're right. So that's an oversight, yes.
Just for clarification,"Trampoline warp not needed" is unclear so if I say "Y", does that mean the warp is not needed and if I say "N" it is or may be needed?

I just completed a seed where I picked "Y" and it wasn't needed.

Great work, thanks!
I was aware when I came up with that question that it is a bit stupid.

The idea was that just mindlessly answering 'Y' to all the questions should give you a sensible set of default options for a newbie player. What is really being asked is "Are you familiar with the trampoline warp?", but that would require you to answer N if you don't know the trick, and I wanted to avoid that.

So (IIRC) answering Y guarantees you a scenario in which the warp definitely won't be needed. Answering N means maybe it will be needed and maybe it won't. AFAIR there's no way to demand a game where the warp is absolutely needed.

Thanks, I'll bear these issues in mind if I ever get round to doing another release.
User avatar
morphenniel
Posts: 5
Joined: Sun Feb 25, 2024 2:00 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by morphenniel »

Diminished wrote: Wed Jun 12, 2019 8:42 pm Thanks, I'll bear these issues in mind if I ever get round to doing another release.
First of all, thanks very very much for the randomiser (and the source code too)! Citadel is one of my favourite games ever and the randomised version is the only one I play now.

I had one suggestion for something that could be randomised or customised (if it's possible — I'm not familiar with the source code and didn't find it at a glance). That is, the amount of time after which the player automatically loses one point of energy. For experienced players, it's fairly easy to complete the game regardless of where the randomised items are, but if the player lost energy faster, or after a randomly different interval each time, it would become more challenging and make efficient routes or accurate jumping more important.

Perhaps this is straightforward and perhaps not. Anyway, once again, thanks!
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

morphenniel wrote: Fri Mar 01, 2024 12:03 pm
Diminished wrote: Wed Jun 12, 2019 8:42 pm Thanks, I'll bear these issues in mind if I ever get round to doing another release.
First of all, thanks very very much for the randomiser! Citadel is one of my favourite games ever and the randomised version is the only one I play now.
The number of people to whom the randomiser might appeal is almost certainly no greater than double figures (if that), so I'm glad you're getting something out of it.
(and the source code too)
Most of the credit for providing this goes to Chris, Mark and Michael Jakobsen I think. I'm just the numpty who wrote the report.
I had one suggestion for something that could be randomised or customised (if it's possible — I'm not familiar with the source code and didn't find it at a glance). That is, the amount of time after which the player automatically loses one point of energy. For experienced players, it's fairly easy to complete the game regardless of where the randomised items are, but if the player lost energy faster, or after a randomly different interval each time, it would become more challenging and make efficient routes or accurate jumping more important.

Perhaps this is straightforward and perhaps not. Anyway, once again, thanks!
This should be easy enough (if not completely trivial). From the reassembly:

Code: Select all

                    ; wait for VSYNC:
.L4394              lda #C_OSBYTE_WAIT_VSYNC ; #&13
                    jsr OSBYTE
                         
                    jsr update_player
                         
                    dec ticks_til_e_loss
                    bne L43ad
                    ; apply radiation damage
                    lda #C_E_DMG_RADIATION ;#&01
                    jsr add_remove_energy_e
                    lda #C_SND_A_RADIATION ;#&c1
                    ldx #C_SND_X_RADIATION ;#&49
                    jsr play_sound_b
                         
.L43ad              jsr handle_spells

                    ; ...
The ticks_til_e_loss variable (held at &12c) is decremented every frame; when it reaches zero, one point of radiation damage is applied. After applying the damage, the variable is never actually re-initialised, so it rolls back over to 255 and counts down again.

In order to decrease the number of frames per point of damage, the game would need to re-initialise the variable to something smaller than 255 after the call to add_remove_energy_e. This would mean somehow inserting a couple of extra instructions into the code like LDA #200:STA &12c.

Lacking another full version of the randomiser, one could hack the above change into an existing build of the game by borrowing the unused 24-byte region at &43e8. Or one could use the Citadel reassembly I published years ago (plus beebasm) to make a custom build of the game binary, although I don't think I ever tested the randomiser against any reassembled versions. Also, the reassembly doesn't incorporate the fixes for the Master 128, which are included with the randomiser as shipped, so this solution would exclude the Master 128. I don't see any reason why a custom reassembled build shouldn't work with the rando on a Model B, though.
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

morphenniel wrote: Fri Mar 01, 2024 12:03 pmcustomised
I had a quick go at this.

Attached is a randomiser disc image that has been hacked to insert some extra code at &43E8.

The first radiation loss will take the usual 256 frames. However, after this, a point of energy is lost once every 16 frames (which is ridiculous, but a convincing demonstration).

Using a PC hex editor, you can hack the enclosed SSD disc image file directly, editing the byte value at offset 0x48EE. This is currently set at 0xF but you can increase it, probably to a number over 200 or so (i.e. > 0xCX).

It's completely untested, so buyer beware.

If you have any luck with this, it might be helpful to publish what sort of values are useful here.
Attachments
citrando-0.4-RADPATCH-1-HEXEDIT-48EE.ssd
(37.5 KiB) Downloaded 5 times
User avatar
morphenniel
Posts: 5
Joined: Sun Feb 25, 2024 2:00 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by morphenniel »

Diminished wrote: Sat Mar 02, 2024 5:10 pm If you have any luck with this, it might be helpful to publish what sort of values are useful here.
First of all, it works for me! (I'm using b2 on Mac as the emulator and File Dump as the hex editor).

Second, I tried halving the number of frames to 128 (0x80) (as in the attached SSD image). That has worked well for me. It's not impossible to win if you're careful, but it's hard and you definitely risk running out of energy.

Thanks again! :D
Attachments
citrando-0.4-RADPATCH-1-HEXEDIT-48EE v2.ssd
(37.5 KiB) Downloaded 5 times
User avatar
Diminished
Posts: 1235
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Citadel Item Randomiser 0.4 (updated)

Post by Diminished »

morphenniel wrote: Thu Mar 07, 2024 10:17 am Second, I tried halving the number of frames to 128 (0x80) (as in the attached SSD image). That has worked well for me. It's not impossible to win if you're careful, but it's hard and you definitely risk running out of energy.
Completing randos at double radiation loss is pretty impressive. Remind me not to attempt to race you at any point.
Post Reply

Return to “8-bit acorn software: classic games”