Go Back   the Magicball Network > Forums > LBA Modifications > LBA Modifications - General
Buy LBA1/Relentless from GOG.com Buy LBA1/Relentless from DotEmu Buy LBA2/Twinsen's Odyssey from DotEmu Buy LBA2/Twinsen's Odyssey from GOG.com Buy Little big Adventure from GOG.com or DotEmu Buy Little big Adventure 2 from DotEmu or GOG.com

Welcome to the Magicball Network.

You are currently viewing our site as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Reply
 
Thread Tools
  #1  
Old 2017-08-20, 12:00
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Alone in the Dark PAK Editor

Hi there!
I'm currently working on Free in the Dark and in order to understand the file format, I'm creating a PAK editor.

A windows binary of the first version of the editor (0.01) is there :
http://jmimu.free.fr/AITD_PakEdit/AI..._win_v0.01.zip
For now, only text and background images are implemented.

I'd be glad to have your comments and help!



Getting Started
---------------
Make a copy of your original PAK files.
Run AITD_PakEdit.
Open a database corresponding to the game (AITD1_PAK_DB.json for AITD1).
Open a PAK.
You see every file in the PAK, with there description and type from the database.
You can modify them and overwrite database (and send it to me for next release!).
When selecting a file, you can export it depending of its type.
For now only pictures and texts can be exported.
You can then modify the exported files, and re-import them.
Overwrite the PAK file (a .PAK.BAK file will be created to save previous version).
Run the game with the new PAK.

DO NOT distribute PAK files!

The sources of FITD and the editor (AITD_PakEdit) are there :
http://https://github.com/jmimu/FITD
Reply With Quote
  #2  
Old 2017-08-22, 06:46
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
I've been waiting a long time for a program like this! I'm not sure if you noticed, but awhile ago I tried finding out the file format for the models from the game. Seeing as I've only been able to edit uncompressed data - it didn't work very well. On the other hand, you've nailed the decompression part!

I'm very impressed - keep it up! Although you can only edit images and text, it's better than nothing. This means good things for the future.

So, how do those images work? Can you take a bitmap and plug it back into the PAK file? Or do you need to figure out the hex-code for the image? Either way, I'm sure if I can decipher the data (unless you have, which already sounds like), I'd be able to make a program that lets you load an image from the game, or you can make one and put it back in.

Great stuff Jmimu!

Glad to have you on the forums, though it doesn't look like you're on much.

Edit: My computer says the program might put my computer at risk, I assume this is false? I don't want malware.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #3  
Old 2017-08-22, 09:17
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Hi, thank you.
Yes I saw your work. You played with compressed data?
I hope it will be useful for model extraction.

I just used Free in the Dark uncompression functions, yaz0r did all the hard work!

You can extract a bmp file form a PAK, modify it with any soft that will respect the palette (like GIMP), import it back into the PAK, overwrite the PAK and play.

I don't know about the exe risk, I don't use windows.
But you can compile it yourself and be up-to-date.
Reply With Quote
  #4  
Old 2017-08-22, 20:26
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by jmimu View Post
Hi, thank you.
Yes I saw your work. You played with compressed data?
I hope it will be useful for model extraction.

I just used Free in the Dark uncompression functions, yaz0r did all the hard work!

You can extract a bmp file form a PAK, modify it with any soft that will respect the palette (like GIMP), import it back into the PAK, overwrite the PAK and play.

I don't know about the exe risk, I don't use windows.
But you can compile it yourself and be up-to-date.
It's more difficult to work with compressed data, because most of the time you mess something up - becomes unplayable.
Me too, but I doubt I'll be able to get models working - you seem to have a better advantage with the decompression functions.

Oh, yes. I've heard about yaz0r, but it's been a few years.

Do you know if Photoshop will work with the images? I'm pretty certain it will as it uses color palletes also if the user decides to use them.

I assume your program has no viruses, so it should be fine.

What I'd like to try and do with is model the entire game rooms in 3ds Max, and render those at the right resolution for AITD so the lighting will look even more real. Of course, one of the many charms of AITD was the hand drawn backgrounds. But, I bet it'd look even more crisp with renders.

Edit: I've backed up a lot of my computer files just in case. Yup, your program looks fine. I like the Cthulu icon for it also. I have yet to use it, but it looks like it'll be fun. Jmimu, you're awesome!
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2017-08-22 at 20:44.
Reply With Quote
  #5  
Old 2017-08-22, 23:58
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Alright, I've tried it a little. But when my image shows up on screen, part of it is cropped (and there are some garbage pixels in the corner), and when the camera tries to change to another view the game softlocks...

Could that just be a problem with using it on Windows? You said you're using a Mac, right? The image looks fine in your example.

A different topic now... Your program loads sounds too. If you open LISTSAMP.PAK you can extract the audio, and open it up in a sound program like Audacity. They're *.DAT files and they work. There are exactly 100 sound effects in the game, and I didn't even know there were that many.

I'm sure LISTMUS.PAK is the music, but I haven't tried that out yet. You can even load the LISTANI2.PAK, but the LISTANIM.PAK just seems to crash the program.

Your program may be more capable thank you think.
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2017-08-23 at 00:05.
Reply With Quote
  #6  
Old 2017-08-23, 23:19
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Wah! It's great!
I didn't look at sound files, I'm working on the rooms and cameras for now, but it's a good surprise, thank you!

For the picture problem, it may be a bug. Can you tell me the size of your BMP file? It should be around 65.1 kB.
I use Linux, and I have no problem, even with the windows version in wine.
Reply With Quote
  #7  
Old 2017-08-24, 04:35
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by jmimu View Post
Wah! It's great!
I didn't look at sound files, I'm working on the rooms and cameras for now, but it's a good surprise, thank you!

For the picture problem, it may be a bug. Can you tell me the size of your BMP file? It should be around 65.1 kB.
I use Linux, and I have no problem, even with the windows version in wine.
Aaahh... Ok, so I checked the file size and it was below 65.1 kb. I tried again, and got around 65.1kb. But, I still received the same problem.

Yup, I think it's a bug. Whenever I import a picture into your program the image compression sets to 0 (all of the other entries are 1) and the diskSize and realSize values become fa00 which is 64,000 in decimal notation.

Maybe it will change if I don't use Photoshop? Would it help to export the PAK uncompressed at all?
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #8  
Old 2017-08-24, 08:56
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Compression set to 0 and disk and real size to fa00 is perfect.
Can you send me your modified picture by PM?

You can try to import a picture you just exported, without modification...
Reply With Quote
  #9  
Old 2017-08-24, 22:11
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by jmimu View Post
Compression set to 0 and disk and real size to fa00 is perfect.
Can you send me your modified picture by PM?

You can try to import a picture you just exported, without modification...
Oh... Alright, so it should work fine then.

Actually, I just tried what you did, and it still didn't work... I'm boggled.

Look at the right side of the screen and the bottom right corner, it's messed up.



Turns out the intro doesn't like it when the image is changed because it has trouble going to the next views, but when I move around in the loft scene the camera changes views just fine, but all other images in the scene have been shifted as well.

Apparently the intro backgrounds are located in the CAMERA07.PAK as well as the ITD_RESS.PAK - so that may have caused the softlock to happen before.

How do you save your images? In Photoshop I save them as *.BMP in 8-bits. Something I've noticed (maybe this will help), the images I export are about 64.0 kb anyways. So, how'd you get that extra 1.5 kb?
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2017-08-24 at 22:17.
Reply With Quote
  #10  
Old 2017-08-24, 22:13
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Hey, I managed to make a list of the sounds in the game. I miscounted, there are 101, I didn't think about the number 0.

Here it is:

0 - Open Cupboard (1)
1 - Vase Shatter
2 - Window Shatter
3 - Unlock Chest / Door
4 - Door Open / Close
5 - Slide Furniture
6 - Thunder
7 - Rifle (Fire)
8 - Rifle (Cock)
9 - Rifle (Click)
10 - Edward (Flask)
11 - Emily (Flask)
12 - Edward (Cough)
13 - Emily (Cough)
14 - Slap (1)
15 - Slap (2)
16 - Edward (Attack 1)
17 - Emily (Attack 1)
18 - Edward (Attack 2)
19 - Emily (Attack 2)
20 - Edward (Attack 3)
21 - Emily (Attack 3)
22 - Edward (Jump)
23 - Emily (Jump)
24 - Edward (Land)
25 - Emily (Land)
26 - Edward (Pain)
27 - Emily (Pain)
28 - Window Monster (Attack)
29 - Zombie
30 - Step (Wood 1)
31 - Step (Wood 2)
32 - Step (Stone 1)
33 - Step (Stone 2)
34 - Edward (Die)
35 - Emily (Die)
36 - Trapdoor / Door Slam
37 - Chest Open
38 - Edward (Trap Door)
39 - Emily (Trap Door)
40 - Edward (Fall)
41 - Emily (Fall)
42 - Window Monster (Hop) / Object Fallen
43 - Window Monster (Hop) / Object Fallen
44 - Cthulu Monster (Pain)
45 - Cthulu Monster (Die)
46 - Step (Carpet 1)
47 - Step (Carpet 2)
48 - Object (Swing)
49 - Page
50 - Object (Break)
51 - Step (Cave 1)
52 - Step (Cave 2)
53 - Drop In Cave 1
54 - Drop In Cave 2
55 - Drop In Cave 3
56 - Step (Cave 3)
57 - Step (Cave 4)
58 - Shrieking Manor Ambience
59 - Dog / Wolf Howl
60 - Shotgun (Fire)
61 - Drink Flask
62 - Secret Passage
63 - Window Monster (Breathing)
64 - Bathtub Monster?
65 - Object (Throw 1)
66 - Pirate (Laugh 1)
67 - Stair Laugh
68 - Pirate (Laugh 2)
69 - Open Cupboard (2)
70 - Step (Water 1)
71 - Step (Water 2)
72 - Water Splash
73 - Rat Screech
74 - Car (Engine Idle)
75 - Car (Coming By)
76 - Cricket And Frog Ambience
77 - Car (Frog And Going Past)
78 - Car (Pull Up)
79 - Car (Door Open)
80 - Car (Getting Out And Closing)
81 - Step (Dirt 1)
82 - Step (Dirt 2)
83 - Bat Howl?
84 - Bathtub Monster (Attack)
85 - Door Monster (Attack)
86 - Sea Monster
87 - Rainbow Spinning Spheres
88 - Whistle
89 - Talisman Jingles
90 - Bubbling
91 - Knight Falls
92 - Sea Monster (Attack)?
93 - Giant Worm Monster
94 - Being Lifted In Air
95 - Bird Chirping Ambience
96 - Skeleton Laugh (In Car)
97 - Object (Throw 2)
98 - Library Monster (Attack)
99 - Fireball (Explode)
100 - Fireball (Fire)

Now, your work for the sound effects is finished.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #11  
Old 2017-08-26, 09:34
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Thanks for the sound names!

It seems your picture has an offset of 40 bytes/pixels. I use Qt picture functions, so it should be read correctly even if the format is not exactly the one expected.
The BMP I export have 14 bytes of file header, 40 bytes image of header, 1024 bytes of palette and 64000 bytes of pixels.
Your offset seems as big as the image of header, strange!

And I think you see 64 kibi-bytes, that is 65 kilo-bytes.
Reply With Quote
  #12  
Old 2017-08-27, 00:03
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by jmimu View Post
Thanks for the sound names!

It seems your picture has an offset of 40 bytes/pixels. I use Qt picture functions, so it should be read correctly even if the format is not exactly the one expected.
The BMP I export have 14 bytes of file header, 40 bytes image of header, 1024 bytes of palette and 64000 bytes of pixels.
Your offset seems as big as the image of header, strange!

And I think you see 64 kibi-bytes, that is 65 kilo-bytes.
May I ask going about how you got those "Qt picture functions"? I've never heard of them before.

But now that you've gave me enough info, I should be able to just hex it, and bring the right values from an original image to my own.

Edit: I tried again, and it still doesn't work. I really think your program has a bug, I don't understand why it won't work for me.
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2017-08-27 at 00:22.
Reply With Quote
  #13  
Old 2017-08-27, 22:00
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Qt is the library I use for the GUI and some other things, like image reading (http://doc.qt.io/qt-5/qimage.html).

It seems you're using the floppy disk version (the CD version has 105 sound samples).
I saw that the camera PAKs are a little different. You have something in the name column in the editor? In the CD version there is nothing. The text is 20 bytes long, maybe I did something wrong then the name is not empty.
I'll check.
Reply With Quote
  #14  
Old 2017-08-27, 22:19
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Here is a new version of the editor:
http://jmimu.free.fr/AITD_PakEdit/AI..._win_v0.02.zip

Floors can be exported in a very basic Collada format.
The cameras don't have correct focal and orientation (maybe even position if there are several rooms).

(Blender and Alone seems to have different perspectives, maybe it's not a good idea to use it for camera positioning.)

Changelog
---------
v0.02:
* split database between floppy and cd versions
* import/export VOX
* export picture with palette (PRESENT.PAK and some in ITD_RESS.PAK)
* start export floors

May still be buggy with floppy version...

Last edited by jmimu; 2017-08-27 at 22:35.
Reply With Quote
  #15  
Old 2017-08-28, 20:19
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Ok, the bug you had is fixed!
The files in your PAKs have names, mine don't.
The name is 20 bytes long, and I wrote it after the data, instead of before.
Since my names are 0 bytes long, there was no difference.

The windows version is fixed: http://jmimu.free.fr/AITD_PakEdit/AITD_PakEdit_win_v0.02.zip

Can you tell me which version of AITD you are using?
Reply With Quote
  #16  
Old 2017-08-29, 00:07
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
I'm at work right now, so I'll make this short.

Very cool! I'm very impressed! Thanks for fixing the updates and keeping us updated on what you're doing next.

Actually, I think for Blender you just need to change your camera's field of view. Trust me, I've ran into these problems before - especially in 3ds Max.

As far as the game is concerned, I've got the GOG version. So I can't really help you on that one, but the music sounds like *.mp3 and not *.midi.

Once I get home I'll try the images again, as well as look at the room models. Thank you so much!

Edit: I've got home, and I've tried your new program. The images do work now! I also like that you already added the sound names.

The floppy version IS a bit buggy (so I hope you fix that soon), and when I try to export the rooms or cameras' views the program crashes - disallowing me from actually seeing them in Blender, 3ds Max, etc.

I do really appreciate your work, and you do it very fast too! That's something I've wanted for years from a member of the MBN.
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2017-08-29 at 04:59.
Reply With Quote
  #17  
Old 2017-08-30, 11:19
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Hi!
In fact I was wrong, GOG version is the CD one, and I was using the floppy one.
The music on the CD version are audio CD tracks, and the voices are in VOC files (not copied to hard disk).
I have no crash with etage export... can you run the editor in command line and tell me if there is a message?

If somebody want to see Derceto in 3d, here are the collada exports (very early stage, camera are not oriented, many things are missing):
http://jmimu.free.fr/AITD_PakEdit/IN...lada_alpha.zip
Reply With Quote
  #18  
Old 2017-09-01, 19:24
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Quote:
Originally Posted by jmimu View Post
Hi!
In fact I was wrong, GOG version is the CD one, and I was using the floppy one.
The music on the CD version are audio CD tracks, and the voices are in VOC files (not copied to hard disk).
I have no crash with etage export... can you run the editor in command line and tell me if there is a message?

If somebody want to see Derceto in 3d, here are the collada exports (very early stage, camera are not oriented, many things are missing):
http://jmimu.free.fr/AITD_PakEdit/IN...lada_alpha.zip
Ok, that explains a lot.

Hey, how do I run that in the command line?

Thanks. That'll be very cool to see the collada files.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #19  
Old 2017-09-02, 10:07
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,827
Great work jmimu, keep it up.
__________________
LBA2Remake v0.4.0 released - open source re-implementation of the LBA 2 original engine for the web.
[Play on Browser]|[Changes]|[Github]


The Sacred Carrot website
Reply With Quote
  #20  
Old 2017-09-03, 11:29
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Thank you!

The windows bug for collada export is fixed.
Reply With Quote
  #21  
Old 2017-09-04, 23:59
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
I agree with Xesf.

Cannot wait to see these in 3ds Max or Blender.

Keep it up! Model importing should be fun when you get there.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #22  
Old 2017-09-09, 00:44
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
You still working on this, Jmimu?
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #23  
Old 2017-09-09, 17:11
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Yes!
Now the camera focal and orientation works perfectly.
The joke is that you have to translate the camera in the direction it's looking, not only using its x,y,z.
You also have to take into account the 6/5 ratio due to pixel stretching.


(view from Blender)

Version 0.03 for windows:
http://jmimu.free.fr/AITD_PakEdit/AI..._win_v0.03.zip
Reply With Quote
  #24  
Old 2017-09-09, 22:15
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 713
Wow! I'm very impressed!

It's nice that you finally figured out the camera properties.

Those wireframes are completely spot-on!

Hey, is it possible to move the wireframe boxes and import them back into AITD yet? I'd love to move something and change the background to give the impression of a new piece of furniture.

What's really interesting is that the developers added in extra boxes to pin-point the locations of where certain objects would be, the carpet is really a box that extends below the floor.

Edit: I'm looking at some of the scenes in 3ds Max, and they work! I haven't exported cameras yet though - only rooms.
Some of the floors won't let me export them though... ETAGE04.PAK wouldn't let me get the floors from them.

3ds Max seems to have problems with the camera, but I can always try Blender.
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2017-09-09 at 22:44.
Reply With Quote
  #25  
Old 2017-09-10, 10:02
jmimu's Avatar
jmimu jmimu is offline
Magic Level: Yellow Ball
 
Join Date: Dec 2011
Location: Paris
Posts: 23
Import is not possible for now, since export is not completed.
You're right, there is something wrong in ETAGE04, I'll investigate.

The carpet is a sceZone, used to change the step sound.
I forced it to be below the floor with a height of 1. In reality it goes from the floor to the ceiling, but like this it'll obstruct the view.
Reply With Quote
Reply

Tags
aitd, editor, fitd, pak

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
About the editor Mazaka151 LbaNet 0 2011-01-26 18:05
All-in-one editor, etc? ContiX LBA Modifications - General 16 2006-09-13 02:27
LBA Savegame Editor (new one) Master Cheater Dear moderators 5 2003-12-06 20:19
The Two Dreams about the one Dark Tower and the one Dark Lord. Gustav Sweden Off topic 7 2003-01-09 22:34
Editor soccerdan2002 General 1 2002-07-26 17:59


All times are GMT +2. The time now is 16:07.


News Feed
Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2019, the Magicball Network