01 August 2011, 02:50 | #1 |
Registered User
Join Date: Apr 2009
Location: France
Age: 46
Posts: 117
|
Captain Blood reverse engineering
Hello all,
Some days ago, i've launched in Steem a game i've played a lot 20 years ago. This game, Captain Blood, has a very captivating atmosphere and talking with the aliens is very entertaining: After some long nights, i've finally recovered all my life fluids, thanks to the duplicates. On top of that, a nice girl on my dashboard. But... I hadn't the feeling of accomplishment. Some aliens i encountered were still shrouded in mystery. And I found intriguing the way the game handled the conversation between Blood and the aliens. So i started disassembling the game and i found a script interpreter. It uses an input (Blood symbols), some local and global variables and produces an output (the alien symbol). I've developped a tool which exctracts the alien's script to something readable (for someone expert with the game). You can find the result (>1mb) on my site: http://bringerp.free.fr/RE/ (direct link: http://bringerp.free.fr/RE/CaptainBlood/main.php5) Be aware: it contains major spoilers! If you haven't finished the game and you mind playing it, stay away! You may have some difficulties to understand how to interpret the script. I willl add some hints tomorrow about this. Have fun! ***** UPDATE 07/03/2016 ***** The fractal engine used in the game along the raytraced landscape (when pressing a key) always fascinated me. Then, even if i'm afraid of heavily optimized 68k code, i started reverse engineering the fractal engine in C# to understand how it was implemented. Even if the asm code is not that bad to read, it's still massively optimized to efficiently draw the curves and to minimize the memory usage while having a feeling of an infinite landscape. The fractal engine is a classic real-time midpoint displacement method using specific random number generator to give different landscape. The canyon part is done by forcing some points in the curve, then applying the subdivision. The raytracer uses the computed fractal during flight, computes another layer of fractal between the "blue lines" then colorize with shadow the landscape. And... Some days ago, i had a crazy idea... The thing that is totally useless... but well, you know, doing it only to see if it can be done. "And if i put the raytracer in place of the simple renderer during flight ??" You can see the result in the following video (look at 0:33): [ Show youtube player ] PS: i know the term raytracer is not perfect because the engine does not cast rays like a real raytracer, but it still computes shadows. Download link: http://bringerp.free.fr/RE/CaptainBlood/main.php5 Instructions: - Left mouse button while dragging the mouse to change the horizontal and vertical motion of the Oorxx. - 'V' key to stop any horizontal and vertical motion. - Right mouse button while dragging the mouse forward/backward to speed up/down the Oorxx. - <Spacebar> to toggle between classic and raytracer mode. - 'B' key to toggle wireframe while in raytracer mode. Last edited by Kroah; 08 March 2016 at 21:21. Reason: Fractal Engine update |
01 August 2011, 11:06 | #2 |
Registered User
Join Date: Apr 2009
Location: France
Age: 46
Posts: 117
|
Some explanations about the scripts:
- there are 64 aliens split in 16 races (4 aliens for each race) - there are 64 inhabited planets (1 for each alien) - variables are 1 bit length (0 or 1) - UpCom variables are initialized to 0 when the UpCom appears - UpCom_RandomUnk_ButtonLeftHiddenBchg is a special variable, its value changes every seconds - there are 16 scripts (1 for each race): every aliens of the same race share the same script - orange color: conditional instructions - yellow color: assignment instructions - white color: conversation (& conditioned) instructions Some variables meaning: - UpCom_IsAlien#X: 1=you are talking to the Xth (up to 4) alien of the script race - #A_RACE_#B_NAME.IsAlive: 0= the alien #A has been disintegrated or destructed with his planet - #A_RACE_#B_NAME.IsNotDestructed: 0= the alien #A has been blown up with his planet - #A_RACE_#B_NAME.IsAtWantedPlanet: 1= the alien #A (up to 64) is at his wanted planet - #A_RACE_#B_NAME.IsThere: 0= the alien #A will not show up in the UpCom (he is hidden) - <=4PlanetsDestroyed: 1= the player has destructed less than 5 planets The interpreter: - when Blood enters a list of symbols, the interpreter executes the script of the race from the beginning - if a conversation instruction (=sentence) is "accepted", the alien replies with the sentence and the script will execute the remaining instructions when Blood will click on the mouth - a sentence is accepted depending on its words: - if no word is underlined the sentence is always accepted- if a sentence is accepted the next assignment instructions are executed, otherwise they are ignored - grayed out words are not shown in the reply (those words are only used for matching purpose) - if all words are grayed out, the reply is empty and the mouth is automatically clicked - [1x] means the sentence will be said only 1 time (reset when UpCom is initialized) - [%] means the instruction is randomly ignored - the interpreter stops when the script reaches the end, waiting for another input Last edited by Kroah; 01 August 2011 at 14:21. |
01 August 2011, 15:47 | #3 |
Registered User
Join Date: Nov 2006
Location: Amigaville
Age: 46
Posts: 3,337
|
|
01 August 2011, 16:52 | #4 |
Registered User
Join Date: Apr 2009
Location: France
Age: 46
Posts: 117
|
|
02 August 2011, 19:14 | #5 |
Registered User
Join Date: Jul 2005
Location: -
Posts: 1,698
|
I restarted this game few yrs ago. I decided to follow a walk-thru to save time, but ended up going to some planet not on the walk-thru and met an ondoyante girl that was too happy to please. I stopped at this point as I wasn't sure if I wanted to continue on the original path or continue with the ondoyante and see how the game's ending would change. Never found the time to continue.
|
07 August 2011, 19:37 | #6 |
Registered User
Join Date: Apr 2009
Location: France
Age: 46
Posts: 117
|
If anyone interested, I have added some information about:
- the wireframe fractal engine - the aliens digitized speech |
31 August 2011, 23:01 | #7 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,835
|
He's back http://captainbloodlegacy.blogspot.com/
Kamel |
07 March 2016, 01:14 | #8 |
Registered User
Join Date: Apr 2009
Location: France
Age: 46
Posts: 117
|
Updated my first post with the fractal engine, check it out !
|
07 March 2016, 01:34 | #9 |
Registered User
Join Date: Nov 2014
Location: Norway
Posts: 388
|
Looks very nice!
Loved the game back in the days, and its one of those few gems that have that special atmosphere. The menu graphics and music really captivated me. |
07 March 2016, 13:47 | #10 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,835
|
Awesome, can you make it at 50/60 fps?
Kamelito |
07 March 2016, 15:25 | #11 |
Registered User
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 2,076
|
Any chance we could see the source for this? I'd love to mess around with it
D. |
07 March 2016, 16:44 | #12 |
Gentleman
Join Date: Dec 2015
Location: The Fortesque Mansion
Posts: 254
|
That's fantastic! I always loved the aesthetic of the Captain Blood fractals, just never really got into the game - seeing it in motion is really cool
|
07 March 2016, 22:44 | #13 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,835
|
This remind me of MasterBlazer fractal demo done by Achim Moller on Amiga. I thought back then that this was the sign of an upcoming Rescue on Fractalus release for the Amiga.
Start at around 2min. [ Show youtube player ] Kamelito |
08 March 2016, 00:10 | #14 | ||
Registered User
Join Date: Apr 2009
Location: France
Age: 46
Posts: 117
|
Quote:
Be aware my coding skills are as high as the number of comments in the source code . Quote:
It really seems the intro has been made from the disassembly of Rescue on Fractalus. Too much similarities to be made from scratch imho. Thanks for the heads-up! Well, the viewer is a C# program running on a PC, you can put whatever fps you want (and recompile) if your PC can handle it, and my old PC can run it at 60 fps easily. |
||
08 March 2016, 21:22 | #15 |
Registered User
Join Date: Apr 2009
Location: France
Age: 46
Posts: 117
|
Sorry, but totally forgot to put the instructions for the Fractal Viewer:
- Left mouse button while dragging the mouse to change the horizontal and vertical motion of the Oorxx. - 'V' key to stop any horizontal and vertical motion. - Right mouse button while dragging the mouse forward/backward to speed up/down the Oorxx. - <Spacebar> to toggle between classic and raytracer mode. - 'B' key to toggle wireframe while in raytracer mode. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Speedball 2 reverse engineering & remake | Kroah | Retrogaming General Discussion | 26 | 08 February 2024 15:08 |
Gods reverse engineering | Kroah | Retrogaming General Discussion | 127 | 27 February 2023 14:46 |
Reverse engineering wiki | copse | Coders. General | 10 | 02 March 2020 09:48 |
Cadaver reverse engineering | Kroah | Retrogaming General Discussion | 8 | 11 November 2011 09:35 |
|
|