Remade: The Apprentice for PC

Anything relating to CD-i can be discussed in this forum. From the multiple hardware iterations of the system to the sofware including games, reference, music and Video CDs. Maybe you hold an interest in Philips Media and the many development houses set up to cater for CD-i if so then this is the forum.
Post Reply
User avatar
Shikotei
Burn:Cycle Activated
Posts: 33
Joined: Mon Mar 01, 2010 5:01 pm
Location: Netherlands
Contact:

Remade: The Apprentice for PC

Post by Shikotei » Fri Mar 23, 2018 12:28 pm

Throughout the years I've had a pet project going on a slow pace. Sometime during 2010-2011 I started working on it.
As with most hobby projects, they either take a long time to get anywhere, or simply never see completion.

I've hinted at having most of the CLUT images, but wanting to get every sprite too here (2012).
And here (2016) once again.
I've shown extensive knowledge on the composition of the level data here (2017).
And (for the first time) stated my goal (2017) here.

As you can see, there've been gaps of several years in which I did nothing or very little.

Early 2017 I got a major breakthrough when the core engine finally became stable enough (and bug-free) that I could actually continue.
The core engine is the part where the level data is read and processed to a list of platforms (and slopes, walls, ceilings) and where Marvin (then just a white square with a black outline) can walk along and jump on.
I've rebuilt this particular section several times before I got it to work the way I needed it to.
Weeks later an unfortunate event happened and I couldn't do much the next half a year.
In august I continued once again (hence the audio decoding thread). Over the course of half a year (then until now) I've been adding, expanding, debugging (a LOT of it) lots of functionality.

Just in case it wasn't clear: me making this post means I have an operational build ready to show the world.
It's not the complete game, but the framework is there.
The game has no menu and jumps straight into the loading screen of The Medieval Tower, Stage 1.
It can be played up until entering the bonus stage.
There is no 'game over' screen, so you won't have to be too careful with lives.
There's also no audio.
This means that:
- The loading screen (overworld map) is implemented
- Stages 1, 2, and 3 can be fully played
- The treasure screen (after each stage) is implemented (yay bonus points!)
- The Medieval Knight (first boss) is fully implemented

Once you enter the bonus stage (Marvin's dream), you can walk and jump. There's no animation or any functionality beyond basic platforms.
Attacking will result in being stuck.


Regarding copyright, I'm quite certain I'm breaking some rules.. but:
Game: The Apprentice is from 1994 (24 years ago)
Developers: The Vision Factory/SPC/SPC Vision went bankrupt in 2002 (16 years ago)
Publisher: Philips Interactive Media International... might exist? Not much info could be easily found. Have they released anything since 1996?
Console: The CD-i has been discontinued in 1998 (20 years ago)

So.. I'd assume there's no-one thinking of suing me (in which case I'll probably cease and desist) or planning to still make a profit from SPC's The Apprentice.
If it's okay with the mods and admins of the forum, I'd like to post the link to the game and upgrade this thread to a dev's log.

goldenband
Burn:Cycle Activated
Posts: 11
Joined: Thu May 21, 2015 3:47 am

Re: Remade: The Apprentice for PC

Post by goldenband » Sun Mar 25, 2018 5:54 pm

Just wanted to say that this is an awesome project! :D I probably won't be playtesting since I'm a Mac user and own the original game anyway, but I love it when the standout titles for systems are ported to modern platform. Something similar happened with Dungeons of Daggorath for the Tandy Color Computer, one of my all-time favorite games, though there they at least had source code.

I look forward to future updates!

User avatar
Shikotei
Burn:Cycle Activated
Posts: 33
Joined: Mon Mar 01, 2010 5:01 pm
Location: Netherlands
Contact:

Re: Remade: The Apprentice for PC

Post by Shikotei » Fri Apr 13, 2018 11:01 am

As of just a few minutes ago, the following video is available:
https://www.youtube.com/watch?v=VrpRuvi8FPs

The recording is from last evening, but I've had to do some post-processing. All that really entails is the concatenation of a second video and the removal of some desktop icons.

I'm planning on playing the original game more now that I've hooked everything up for recording high-def. It'll give me the high quality reference material that's apparently nowhere on the internet. I've already noticed that the jump mechanics are way more 'floaty' than what I made.

For now the plan is to get as close as possible to the original source before moving to the next level (even though I've already started a bit with The Well).

User avatar
cdifan
CD-i Emulator Author
Posts: 904
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Re: Remade: The Apprentice for PC

Post by cdifan » Fri Apr 13, 2018 7:07 pm

Just watched the entire video... really *really* good work! :) :)

We know it here, but perhaps you should add to the YouTube description that everything is based on the original sprites, graphics, sound effects, music and level maps? Still an awesome piece of work, in particular knowing as I do that you did almost no reverse engineering on the game programming code...

It even seems much faster than the original, in particular no loading screens :lol:

User avatar
omegalfa
Le Monde Du CD-i Team
Posts: 38
Joined: Mon Jun 27, 2005 1:26 am
Location: Lisbon, Portugal

Re: Remade: The Apprentice for PC

Post by omegalfa » Mon Apr 16, 2018 1:29 am

S spectacular piece of work!
Congratulations!
_____________________________________
omegalfa
The World of CD-i / Le Monde du CD-i
The World is Interactive!
http://www.theworldofcdi.com

User avatar
Shikotei
Burn:Cycle Activated
Posts: 33
Joined: Mon Mar 01, 2010 5:01 pm
Location: Netherlands
Contact:

Re: Remade: The Apprentice for PC

Post by Shikotei » Sat May 05, 2018 3:19 pm

I've posted a new video!
https://www.youtube.com/watch?v=D2MvVbLBnHU

The recording is last week's, but there's been little progress since that point.

The changes that were made after the previous video:
- Adjusted jumping physics and animation timing
- Adjusted walking speed
- Adjusted monster animation timing and movement speed
- Adjusted various item animation timing
- Changed behavior for off-screen moving platforms (no longer resets)

As I said last time, I didn't have high quality video to compare my game with, but that's changed now. If you've watched the Let's Play by Seb (HalfBlindGamer) and compared it with the first video, well.. let's just say I wasn't even close :lol:
The new video is much much closer to the real deal. And much better on the eyes too, being less jerky.
If there's one thing I should do ASAP, it's making intros skippable :roll:

The error at the end was introduced when I changed the animation of the flags (in particularly its timing and position). I found the cause some 10-15 minutes later (missing 3rd parameter), so it's fixed now.
There's 3 'flags':
- starting point
- checkpoint
- final flag
I had adjusted the first two (in-game they're the same block of code), but I forgot the final flag, which still used the older method. Their non-compatibility caused a script error.

As for the ongoing issue of legality: I'm working on a 'grey-area' solution.
In simple terms the game will need an image (ISO of some sorts) of the game. One you can easily make of your own copy of the game with Clone CD or perhaps ISObuster.
This is similar to the requirement of the emulator by CDi-fan. It requires a ROM file of an actual CD-i.
The 'copy for private use' should be considered legal (or at least not illegal).

My game would become nothing more than an interface to this file; useless without it!

This file will be opened by the game and all required sprites, sound effects, and music will be extracted.
At this point I have made several attempts at doing this using the same program as the game (MacroMedia Director), but all its functionality for reading large files are.. inadequate.
They either can't open files larger than 500MB (my ISO is 650-ish), are super slow (take 1 minute to write 10MB), or can't even read part of a file...

So.. I'm building it in C#.

I've already built:
- (partial) file reader (keeps RAM usage low)
- table-of-contents builder
- game-file extractor (including a block-reader)
- implemented my M68K emulator (for compiled sprites)
- CLUT-decoder (for basic images and decompiled sprites)
- CDA extractor (for WAV music)
- Compressed ADPCM to ADPCM (for sound effects)

I still need:
- ADPCM decoder
- image combiner (for images that are built up of smaller ones)
- the importer script for the game..

Right now I can extract over 12000 images in 30 seconds. Extracting the full music (some 460MB) takes mere seconds.
I'm still working on the sound effects (they're stored as compressed ADPCM), but I should have that working in the next week.
Most of the code I had already written in different languages, so it's just a matter of translating it.

The challenge that this (extracting all required assets on-the-fly) brings is that any and ALL adjustments to the sprites will also have to be done by the program.
The level tiles in particular are all built up with 3 or 4 smaller tiles. Each normal tile is 20x20 pixels, while the tiles are stored as 4 images of 20x4 pixels...
Many other sprites (monsters, bosses) are split up into smaller images and need to be combined before I can use them in the current setup.

I want the importer script to only extract and import sprites on a need-to-have basis to keep the start up time low.

It sounds like a lot, but on the bright side: it's not hard or anywhere near impossible, it just needs to be done.
I only see challenges.

User avatar
omegalfa
Le Monde Du CD-i Team
Posts: 38
Joined: Mon Jun 27, 2005 1:26 am
Location: Lisbon, Portugal

Re: Remade: The Apprentice for PC

Post by omegalfa » Sat May 12, 2018 12:00 pm

Man, I still haven't words for your work...

Congratulations!
_____________________________________
omegalfa
The World of CD-i / Le Monde du CD-i
The World is Interactive!
http://www.theworldofcdi.com

User avatar
Shikotei
Burn:Cycle Activated
Posts: 33
Joined: Mon Mar 01, 2010 5:01 pm
Location: Netherlands
Contact:

Re: Remade: The Apprentice for PC

Post by Shikotei » Wed Sep 26, 2018 6:25 pm

It may just be a small update in terms of gameplay progress (no progress since last time), but this packs a punch:
It's nearly done!

The file extractor is capable of the following:
- Read part of a file (as small as a single sector)
- Find and build table of contents
- Extract contents of a single file (ie: "level1.dat")
- Build a block-based table of contents
- Completed M68K emulation for purpose of decompiling compiled sprites
- CLUT decoding (basically all images require this)
- CDA extracting (WAV audio)
- Compressed ADPCM decoding to ADPCM (all sound effects are Compressed ADPCM)
- ADPCM decoding to WAV

And now the more complex abilities:
- Resizing of single image (adding empty space to make alignment easy)
- Skipping non-required images (trust me, there's quite the amount of junk files when you decompile sprites without regard to JMP and RTS operations)
- Concatenation of multiple CLUT-stored (and decompiled) images (before they're turned into BMP data)

At this point there's still some challenges left, like the Door sprites.
They're an combination of 3 sprites, of which 2 can be vertically concatenated, but the 3rd has to be overlayed somewhere in the middle.
It's the top half of the door, the bottom half, and the colored lock.
Level1-Doors.png
Level1-Doors.png (7.52 KiB) Viewed 85 times
Sounds easy, right? Not when a program has to do this automatically.

The biggest leap forward came a week or 2 ago, when I actually started building the integration and replaced my processed sprites with the on-demand extracted sprites.
Because the new sprites aren't PNG with transparency, I had to make adjustments to the code that handles the sprites.
They had to get a background color (and background transparent blending). All decompiled sprites have this fluorescent-green color, while most of the CLUT images have pitch-black as background.

Anyways, it works as follows:
- Determine which files need to be extracted (ie: for the first intro: intro1.dat, track3.cda)
- Check if the required sprites are present (if they all are, do not extract)
- Start the extraction process, and regularly check if it's done
- When it's done, import all the sprites
- Mark import as complete and resume the game

The extraction process:
- Create batch file with the required arguments for the file extractor executable
- Open batch file
- Extractor will write a file that marks it is completed
- Delete batch file and marker file

The whole process takes up to a second or two on my system. Depending on the amount of files to be extracted. Some are done in a flash.
I'll probably make a video later today, or tomorrow.


TL:DR:
- Have a nearly-completed extractor.
- Can import nearly all sprites.
- It's super fast
- Playable demo is at 98% (arbitrary

User avatar
Shikotei
Burn:Cycle Activated
Posts: 33
Joined: Mon Mar 01, 2010 5:01 pm
Location: Netherlands
Contact:

Re: Remade: The Apprentice for PC

Post by Shikotei » Fri Sep 28, 2018 7:53 pm

Small post, but still important:

Part 1: Principle - https://www.youtube.com/watch?v=wyI86mDK_-A
Part 2: Gameplay - https://www.youtube.com/watch?v=oeND_azeqSI

Both are unedited recordings.
Kinda proud of myself right now ^-^

User avatar
cdifan
CD-i Emulator Author
Posts: 904
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Re: Remade: The Apprentice for PC

Post by cdifan » Sat Sep 29, 2018 12:56 am

Shikotei wrote:
Fri Sep 28, 2018 7:53 pm
Kinda proud of myself right now ^-^
And you have every right to be! Very good work, and what perseverance...

Post Reply