Crusader games in ScummVM?

stauff

New member
Joined
Jun 7, 2020
Messages
12
Hi Crusader fans,

The Pentagram Ultima 8 engine was integrated into ScummVM recently, and I decided to work on some improvements for it. In the process I got interested in the Crusader games - the engines are based on the U8 one, and there was some early-stage support already in Pentagram.

I made some progress on adding more things, and here's where it's at:
* Shapes, sounds, and maps all load - Pentagram already had all this
* Music plays - AMF support was already out there in a few mod players, so it just needed adding to scummvm
* Movies work - luckily someone had worked out the movie encoder already: https://wiki.multimedia.cx/index.php/Origin_Flic_Codec
* The avatar can walk around (needed some hacks to the U8 animation system, speed still not right but it works)
* Some of the simplest game engine events work, so "using" a valve turns it and makes a squeaking noise

Put it all together it looks like this right now:

I'm now at the stage where I need to disassemble a game seriously to work out what the other game engine events are. I've started already (with No Remorse) and I'm making some progress, but it'll be a long journey.

I don't want to get any hopes up about a complete reimplementation, but I'm finding it an interesting project and will probably keep working on it until I've got a playable game, get stuck, or I get totally sick of it all :) If anyone here wants to help or is just interested then let me know and I'll get into more details.

Some trivia I've noticed so far (many of which you can notice by just looking at strings from the exe):
* The check for 15 megs of free disk space actually checks for 16,000,000 bytes free
* The `-laurie` option (which prints "No pity. No mercy. No remorse." on quit instead of "CRUSADER: No Remorse") is implemented as a series of character checks in the code rather than an option string (to obscure it?) .. but then there's a string that says "FART ...TRY... -laurie (Have fun, Jely)".. hmm..
* There's a memory manager called `YAMM`, which I presume stands for "Yet Another Memory Manager"
* There's only so many times you can see the Asylum Sound System functions (ASSInit, etc) without wondering about whether the name was just chosen for the acronym
* There's a built-in engine debugger, and I would really like to have one of the unk symbol files..
* 16 bit protected mode disassembles into a nightmare of high/low word handling for 32-bit pointers
 

Keenan

Administrator
Staff member
Joined
Sep 24, 2005
Messages
789
Glad to see you here! I'm excited to see how fellow fans react to this news!

The progress is crazy already. This is a major feat for the Crusader community. I can't express how grateful I am for your efforts.

Jason Ely was one of the main programmers of the games and he might be willing to help out. You can check on Facebook for him, and maybe some other places. There are very dedicated fans here that can probably help you out. Maybe @compelx and @JC Denton.

Curious to see how much of Crusader was actually built into Pentagram, since it plays pretty differently from Ultima 8.

For the future, if the project is at a point where most of the work is done, do you want issues to be tracked in the ScummVM Github? I'd be glad to debug and find anything that would need fixing and to submit pull requests.

I'll be putting this on the frontpage so people see the good news!
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
I've made some decent progress on this now, although the visible parts of the progress are fairly small. I've worked out a large number of the game engine functions. They're not exactly like the U8 versions though, so you can now have an array of amusingly broken interactions with the world:

Will keep posting here on my progress.

Didn't capture sound, but it's working like before. I'm using the cheat mover to get around faster for testing.
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
Quick update.. I managed to get enough of the usecode working that some nice things happen now:
1. The barrel rolls and explodes when it hits the avatar
2. The security camera triggers the alert when the avatar gets close (which you can clear with the keypad)
3. The guns follow the avatar around
4. Doors work properly
5. The elevator is kinda working

Still a long way to go but steady progress. I'd really like to get an NPC or two spawning next.


Also @Keenan I realised I never answered your question about bugs - I guess it's still much to early to put them in the ScummVM tracker, but I'd love to see pull requests from people, I can review and merge them.
 

Keenan

Administrator
Staff member
Joined
Sep 24, 2005
Messages
789
Great! When the time comes, I'll see if I can contribute anything of use.
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
Slow but steady progress.. latest updates:

* Spawned some NPCs - they basically just hang around and walk about at the moment. Worked out what some of their stats mean, some remain a mystery.
* Target reticle works - although it's currently always running (not just in combat mode)
* Inventory - Avatar can now collect items from boxes, the inventory display at the bottom is live and you can cycle through items. The ammo display needs a little more work.
* Computer and keypad gumps working - not perfect (no pagination or char-by-char display on the computer) but good enough to use
* Health and energy displays are live - I get injured in this video by the steam but there's no reaction animation


Next things (random thoughts rather than a real plan..):
* Work out why some engine events don't work - eg, turning the initial valve should spray some fire but it doesn't do anything. The healing booth doesn't get triggered when I walk into it either.
* Do some work on the palette cycling - eg, the red color in the alert buttons is supposed to cycle all the time
* Work out why I can't step onto elevators.. I should be able to walk through most of the first level if I fix that

Things that I know will be a lot of work:
* Adding control for remotely controlling things (eg, Thermatron)
* Fully implementing the combat AI system - it's a small language in itself inside the COMBAT.DAT file
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
Progress update for the last week. Pretty happy with the progress this week:
  • Added palette cycling so things flash and pulse like expected
  • Camera "snap" is now working, so the camera snaps to the defined points rather than following the avatar (except when I'm using the cheat mover as you can see in the video)
  • Item selection sprite and operation now works like the original (via S and Return keys)
  • Fixed things so that using inventory items works (eg, medikits), and added the right video player intrinsic so that the datalink can be used to view the mission objectives
  • Fixed the initial teleport so it gets the right sound and animation
  • Fixed the game engine bug so the initial valve now triggers the flame
  • Added the game engine features needed for the remote cameras to work properly
  • Put in a hack so I can step onto the elevators, but it's not great

Put it all together and it looks like this (it's set to skip opening video and not play music, but they are working fine, just disabled to make testing easier):

Obvious bugs in this video:
  • The avatar warps in with no active frame, so he's invisible until he moves.
  • The initial chemsuit guy doesn't walk around - although he does all the right operations in place (turns, activates alert, surrenders) so the script is sorta working.
  • Moving around still is pretty flakey, as I run into a bunch of things and fall back.
My next step is probably to spend more time on disassembling the "fire" code and work out how to make it possible to shoot things. Then it might be more like a game :)
 

Keenan

Administrator
Staff member
Joined
Sep 24, 2005
Messages
789
That is huge progress. The pieces are falling into place now—I'm very excited. I'll get around to publishing a story on the frontpage.
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
A while since I posted an update, there was a heap of stuff all tied together. I now have a minimal (and still kinda buggy) version of weapon firing working!


This also required a lot of work on how items receive damage, so they all blow up correctly - there is an entire data file (damage.dat) devoted to how things should blow up. You can also get shot by the wall-mounted machine guns.

Smaller fixes
  • 'Z' key to centre camera on Silencer
  • Small usecode fix, so the elevator switch works correctly now!

Obvious remaining bugs
  • All the bugs I mentioned in the last video :)
  • Ultima8 only has 8 directions, and crusader has 16 for combat mode. Currently, I hacked in using the 8 dir version, but that means the combat animations are all facing the wrong direction as you can see.
  • The Silencer's weapon is hard-coded and faked into the "fire" operation - you may notice he's not actually holding one.
  • Some items don't seem to take damage correctly - eg, the wall-mounted machine guns are currently annoying indestructible.

Up next
I have started the (kinda tricky) process of teasing out the 8-direction assumption from the engine code so we can have all 16 directions supported.

As a side note, unfortunately, this is my last week of "high intensity" work on this project. I start a new job next week and will have to focus on that for a while. I'll still try to take a bit of time here and there to keep it moving, but progress will definitely slow down from next week.
 

Keenan

Administrator
Staff member
Joined
Sep 24, 2005
Messages
789
My favorite update so far. Looks outstanding.

Good luck and best wishes for the new job!
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
Another quick update, since I fixed a bunch of small things and I'm happy about them:


  • 16-direction combat stance now works
  • weapon overlay works, so you can see the silencer's gun and firing
  • Added the "fade from grey" at the start (although it's a bit short, probably need to make it longer to match the game)
  • Fixed the silencer's teleport-in animation at the start
  • Fixed the engine execution speed so that the machine gun doors slide down at the correct rate (and all the other timed things now happen at the right speed)
It's starting to look like a game!
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
It's been a while since my last update. New job is going well, but I still find time do bits and pieces. Here's what I've done since the last update (more fine-grained than most of the previous updates):
  • Add "egg unhatch" game engine event (used sometimes in game "usecode" scripts)
  • Adjust item selection behavior to match game better
  • Fixed z bug in 'isCentreOn' so now sometimes teleporters even work
  • Remember what type of shield silencer has so it can be upgraded/saved/etc
  • Added detection entries for other versions (Spanish, Japanese, German) - most still don't work though.
  • Started disassembling No Regret - matched up all the engine functions so it works at a similar level to No Remorse (so, excluding the parts I still don't understand in No Remorse)
  • Added a couple of palette cycle intrinsic functions
  • Fixed music order for both games to match original, so music events should play the right tunes
  • Implemented "Pace" NPC behavior (walk forward, turn around, attack silencer if seen)
  • Support loading "volume" attribute of items (comes from U8 engine, seems mostly unused in Crusader but it's there anyway?)
  • Support parameter in "unequip" game engine events (not sure what it's used for, but it's supported now!)
None of this gives much to show in a video (except maybe the No Regret engine working) so I'll capture another one once I have something worth showing off :)
 

IGTC

New member
Joined
Apr 21, 2017
Messages
4
Hey this is just awesome! Like famine to feast in no time. :D

Happy happy, joy joy!
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
Another update.. still plugging away at it. Since the last time a few things that make a big difference to how the game plays:

* Mostly implemented AttackProcess, crusader-style AI using the combat.dat file (was using the U8 AI until now)
* Corrected "unk egg" ids, meaning a lot more game triggers work (eg, robot is now in first room, elevator auto-triggers)
* Corrected order of shift operator arguments in engine usecode, fixes a few engine events
* Fixed "got hit" arguments, so now cameras and wall guns can all be destroyed, as well as a bunch of other boxes etc
* Fixed weapon overlays and animations for larger weapons - I gave the silencer a large weapon to start to show this
* Added function to play intro videos like the one at the start of first mission (not shown in video, but it works)

A longer video today so you can see just how buggy it still is :), and how much progress has been made.. now some more NPCs spawn and the elevator comes down for me, etc.


And as a bonus, the considerably more broken at the moment No Regret:


there are more things working than I showed in the video, but you get the idea.

Some obvious bugs:
* Dead people don't fall over all the time..
* Teleport pad works but the animations are kinda broken
* The flame at the start doesn't animate right
* Movement is still really nasty
* Things bounce around too much as they get damaged
* Passcode is "0"
* etc
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
Hey this is just awesome! Like famine to feast in no time. :D

Happy happy, joy joy!
Thanks! Good to know there are a few people out there who care about this game, makes it more fun to keep at it!
 

Keenan

Administrator
Staff member
Joined
Sep 24, 2005
Messages
789
Another update.. still plugging away at it. Since the last time a few things that make a big difference to how the game plays:

* Mostly implemented AttackProcess, crusader-style AI using the combat.dat file (was using the U8 AI until now)
* Corrected "unk egg" ids, meaning a lot more game triggers work (eg, robot is now in first room, elevator auto-triggers)
* Corrected order of shift operator arguments in engine usecode, fixes a few engine events
* Fixed "got hit" arguments, so now cameras and wall guns can all be destroyed, as well as a bunch of other boxes etc
* Fixed weapon overlays and animations for larger weapons - I gave the silencer a large weapon to start to show this
* Added function to play intro videos like the one at the start of first mission (not shown in video, but it works)

A longer video today so you can see just how buggy it still is :), and how much progress has been made.. now some more NPCs spawn and the elevator comes down for me, etc.


And as a bonus, the considerably more broken at the moment No Regret:


there are more things working than I showed in the video, but you get the idea.

Some obvious bugs:
* Dead people don't fall over all the time..
* Teleport pad works but the animations are kinda broken
* The flame at the start doesn't animate right
* Movement is still really nasty
* Things bounce around too much as they get damaged
* Passcode is "0"
* etc
Giddy with excitement. The persistent alarm in No Regret gave me a good belly laugh.

It's really showing me the logic of how the game operates. Fascinating after 25 years of just kinda assuming what it's doing.
 

IGTC

New member
Joined
Apr 21, 2017
Messages
4
Question here. Will the game be open to modding? Not asking you to write an editor!!

Just wondering if modding might be a thing like with OpenXCom and other remakes.
 

stauff

New member
Joined
Jun 7, 2020
Messages
12
Question here. Will the game be open to modding? Not asking you to write an editor!!

Just wondering if modding might be a thing like with OpenXCom and other remakes.

I'm not planning on doing any modding support specifically, but because it's open source it will be pretty easy to change and add new assets or animations - if someone is willing to put in the work!
 
Top Bottom