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 2016-09-28, 19:20
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Alone in the Dark: Hex - Editing

I know that this is not related to LBA in the modification section, but it certainly is for AITD. Anyways, I've been using, ( as so the title says ) a hex editor to edit the information and play AITD to see if anything has changed. I've been looking into several of the files lately, that consists of the CAMERA.PAKS, ETAGE.PAKS, LISTANIM.PAKS, and LISTBODY.PAKS.

The CAMERA.PAKS appear to hold all of the views for the cameras throughout the game, it seems to be a matter of position, and rotation. The image data ( backgrounds ) might be in the ITD_RESS.PAK, but I'm still not sure.

The ETAGE.PAKS appear to hold the collisions for all of the background elements in the game.

One of the first offsets in the LISTANIM.PAKS will switch one of the player's existing standing animations to the walking animations. Thus, you always have to keep moving - you can never stop.

I'm no programmer, but I think I am certainly starting to decipher some of the algorithms in these files. As of now, I am starting to really understand the LISTBODY.PAKS. For some reason in the AITD directory, you will notice that for some PAKS, you will notice that there are two for one. The reason for this is that we all know that you can select either Emily or Edward. When you play as Edward, the game loads and initializes the, LISTBODY.PAK for example. On the other hand, if you play as Emily, the game takes the LISTBOD2.PAK into account. I am not sure the reason why there are specifically two when they could all fit into one, I haven't got that far yet.

From my understanding of the LISTBODY.PAKS, these are the offsets I've gathered:

The first several offsets contain groups of couple or triple digits, which I am guessing are the actual body indices, and then after that, each body is represented by a separation of almost a offset or two of constant 00's.

I'm viewing the offset base as hex.

Here's an example:

offset: 00000450: Body 1
offset: 000006A0: Body 2
offset: 00000960: Body 3
offset: 00000BA0: Body 4
offset: 00000E30: Body 5
offset: 000012F0: Body 6
offset: 00001420: Body 7
offset: 000015B0: Body 8
offset: 00001680: Body 9
offset: 00001920: Body 10
offset: 00001FA0: Body 11
offset: 000025E0: Body 12
offset: 00002F30: Body 13
offset: 000037E0: Body 14
offset: 00003C00: Body 15
offset: 00004020: Body 16
offset: 00004A30: Body 17
offset: 00004B50: Body 18
offset: 00004C70: Body 19
offset: 00005440: Body 20
offset: 00005840: Body 21
offset: 00005C50: Body 22
offset: 000062F0: Body 23
offset: 00006AA0: Body 24
offset: 00006CC0: Body 25

I still have yet to go down the list - I've only began. Now the real names of these bodies? I do not know. I'll have to change some values in every single one and then test the game to see what bodies got changed. But, for anyone programmers out there, hopefully this could give a start to a model viewer of some sort. Although, I wouldn't mind some source code and see if I could do anything. I've taken looks at C# and C++ and am feeling more comfortable with it, but I'm not sure about how I would go about doing this.

I just figured since it's been some time since I've been on, I thought this might make some people out there happy.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #2  
Old 2016-09-28, 19:24
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Sorry for my English this morning - I kind of just slapped this post together. I just wanted some information out at the moment.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #3  
Old 2016-09-29, 01:45
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
So, I decided I better be more specific and just prove that I didn't just Photoshop this. I have provided a screenshot both with the game and hex editor opened. I have "print screened" the whole thing, and this is what I came up with. Similarly, the file formats of the models in AITD does not seem far off from the way the models are stored in both LBA 1 and 2.

By the way, I'm starting to figure out some of the model indices now. I've only found some, but by input of a lot of different values in the middle of a model allow that distortion effect, and it's helping me find others. This is kind of exciting to me in a way.

__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #4  
Old 2016-09-29, 01:52
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Only a couple moments later, and I think I've found the "root" position for all of the bones. I really considered taking a screenshot for this one. I'm grateful I'm not alone in the dark with Emily - she's creepy... Don't tell her I said that.

__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #5  
Old 2016-09-29, 18:58
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
Hi man, I think some people out there knows a lot about AITD file structure. If you speak french or english NHG on Discord can help he's the guy who have the WR record right now on YT. Him and 2 others have cracked the game code a lot and knows a lot. It might interest you to have a talk with them on SDA forums.
__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #6  
Old 2016-09-30, 05:07
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Quote:
Originally Posted by gravel22 View Post
Hi man, I think some people out there knows a lot about AITD file structure. If you speak french or english NHG on Discord can help he's the guy who have the WR record right now on YT. Him and 2 others have cracked the game code a lot and knows a lot. It might interest you to have a talk with them on SDA forums.
Thanks for the reply, gravel22! I've been waiting to hear something from someone. Really? That is really impressive! I must check that out - when I get the chance. I've actually began writing a program to see if I can edit AITD PAK files - not that it will actually get anywhere, but I'm pushing myself beyond my limits in hope of accomplishing something.

I'll try and send a screenshot soon!
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #7  
Old 2016-09-30, 05:12
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Here's what I've got so far of the body indices. It's funny that the main characters are not at the top of the list like how they are in LBA 1 or 2. The same might apply for Time Commando as well.

__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #8  
Old 2016-09-30, 05:24
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
gravel22, would you happen to know the email address for NHG?
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #9  
Old 2016-09-30, 16:12
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
Quote:
Originally Posted by MrQuetch View Post
gravel22, would you happen to know the email address for NHG?
Don't have the email but here's a Discord invite link, he's on LBA Discord you can catch him here.

https://discord.gg/7VsTa

Forum post that might get you in contact :

https://forum.speeddemosarchive.com/..._1992_dos.html

Programs built to check game files (I think) :

https://kb.speeddemosarchive.com/Alo...onal_Resources

Interesting links :

https://kb.speeddemosarchive.com/Alone_in_the_Dark_(1-3)

https://kb.speeddemosarchive.com/Alo...s_and_Glitches

Hope this can help
__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #10  
Old 2016-09-30, 18:31
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Gee, that's a lot of information. It's one thing to ask for a simple email address, but thank you all the more so for taking the time to send me several links.

I'll see what I can do. One of my first steps in my program is to see if I can output the vertex and polygon amount from whatever model is accessed.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #11  
Old 2016-09-30, 18:57
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Ok, I just registered an account on the SDA, and send a private message to NHG, hopefully he can get back to me on that. Again, thanks for the information, gravel22!
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #12  
Old 2016-10-01, 19:17
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
No problem man it's a pleasure to help
__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #13  
Old 2016-10-01, 20:56
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
So, I've discovered a lot more information about the file structure now of the body PAK files. I've finally come to learn what values represent what colors - and this was one of the main reason I even began hexing the game.

Here is that bit of information: ( From my understanding )

A0 = Orange.
AA = Green.
AB = Dark Green.
AC = Very Light Green.
AD = Super Light Green.
AE = Grayish Green.
AF = Dark Gray.

B0 = Faded Pink.
BA = Dark Blue.
BB = Darker Blue.
BC = Faded Green.
BD = Light Gray.
BE = Lighter Gray.
BF = Lightest Gray.

99 = Light Blue.
98 = Lighter Blue.
97 = Dark Red.
96 = Red.
95 = Dark Pink.
94 = Pink.
93 = Dark Green.
92 = Barely Lighter Green.
91 = Lighter Green.
90 = Light Teal / Green.
89 = Tan.
88 = Very Light Tan.
87 = Brown.
86 = Dark Tan.
85 = Light Brown.
84 = Light Tan.
83 = Light Orange.
82 = Light Blue / Purple.
81 = Light Green.
80 = Black.

Note: Of course, this is only a snippet - sometimes using lower values causes the game to crash, and if not at first, eventually noise will come across the screen and the game will lock up.

But, I've come to learn that the algorithm for the way in which the colors of the polygons are stored is rather horrendous! It may seem at first that many polygon indices are controlled by 3 values which represent X,Y,Z value in 3D space - but even then, I may be wrong. And in between SOME of those values, you find an index to a polygon's color, but then to find the next colored polygon takes just as long to find - because the values for polygons and their colors are all over the place! It's almost as if the algorithm for the game's polygons and colored values is stored randomly, but shouldn't!

I can find models easily in the file - I've figured out that part. The crucial vertex data seems like it's at the top of each model, and the colors are below that... But STILL...

Here's part of what I've gathered for the way in which the files are stored:

Starting from offset: 00003760
Ending at offset: 00003770

Below is the hex code, and what has happened after I slightly shifted values.

84 D5 ED 8C 92 F5 4A 5A 83 9A 4B BA 3C 89 E2 91
55 8E 9B 16 90 D8 B4 AA 64 A2 BA F5 91 4D 36 7B

84 = game crash
D5 = vertex move
ED = vertex move
8C = vertex move
92 = game crash
F5 = game crash
4A = color
5A = red gradient on emily's hair
83 = game crash
9A = game crash
4B = game crash
BA = game crash
3C = game crash
89 = color
E2 = vertex move
91 = game crash
55 = vertex move
8E = game crash
9B = game crash
16 = vertex move
90 = game crash
D8 = game crash
B4 = game crash
AA = vertex move
64 = game crash
A2 = game crash
BA = game crash
F5 = vertex move
91 = game crash
4D = vertex move
36 = game crash
7B = game crash

As you can see, most of the values have caused the game to crash.

So, my conclusion as of now? Hex editing is a literal pain in the rear! I like editing the game to be able to see what I can find new, but it takes so much time, and even all the more when you are trying to decipher the way in which files are stored. I've gotten better within the past few years - but it's still rather ridiculous.

Well, I'm not giving up yet. I'll see what I can still do in the future - but I've had some doubts lately. I'll look into the structure some more, and if things still don't turn out, I'll have to think of something else. I can totally see how hex editing is a job for some programmers.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #14  
Old 2016-10-01, 21:02
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
NHG still hasn't got back to me yet, but when he does, I'll see what he has to say.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #15  
Old 2016-10-01, 22:45
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
Quote:
Originally Posted by MrQuetch View Post
So, my conclusion as of now? Hex editing is a literal pain in the rear! I like editing the game to be able to see what I can find new, but it takes so much time, and even all the more when you are trying to decipher the way in which files are stored. I've gotten better within the past few years - but it's still rather ridiculous.
Why don't you invest some time in finding the secret room in LBA 1. It's been confirmed by Fred itself and it has never been found before.

You have to change a line of code and the room will appear in the game.
__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #16  
Old 2016-10-02, 01:01
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Quote:
Originally Posted by gravel22 View Post
Why don't you invest some time in finding the secret room in LBA 1. It's been confirmed by Fred itself and it has never been found before.

You have to change a line of code and the room will appear in the game.
That sounds awfully familiar to me... I remember reading that somewhere on the forums a couple of years ago. If I remember, I actually found the grid file in the LBA_GRI.HQR file. I don't remember where, but I'll check up on that.

As far as the code portion is concerned, I think that's just a matter of editing the SCENE.HQR file. I could tell a 'Scene' zone ( out of the many which do already exist in the game ) to load up that particular grid file rather than going to one of the many others that do actually exist in the game.

Although the room you are talking about may exist in the files, there is just no access to it during normal gameplay. I'll have to look more in-depth on that subject though.

Thanks for the cheer-up, gravel.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #17  
Old 2016-10-02, 01:08
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
Yup, I just found the grid file - the title for the file even specifically indicates that the room was directly cut from the game. At what point in time during the development of the game? I'm not sure - but it definitely is there. The grid index is 61. That's some pretty cool stuff.
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #18  
Old 2016-10-02, 01:19
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
I've just checked the scene file for the room as well, and there's almost nothing. Twinsen, this being Actor 0, has no Life or Track scripts - they both say END in the files. Then Actor 0, is one of the many other Meca Penguins that you see throughout the game, which for some reason is invisible, and is always located at the north side of the grid / room. This Penguin will appear visible, and will be placed at Twinsen's location if the player has a Penguin in the inventory, in case you didn't know in the mathematical file structure sense. Finally, there are 5 zones listed in the room, each giving you either money, life, or magic points if you use the, "action" command in their specific locations.

Seeing as you've beaten the game, gravel, I realize that you know more about the speed running strategies than I do, but what about in-game actual data? Either way, thanks for giving me some advice. I appreciate it. Now speaking of which, I wonder what all the more of a reason there was for this room to be in the game. I wonder what Fred's intentions were...
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #19  
Old 2016-10-02, 01:53
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
Quote:
Originally Posted by MrQuetch View Post
I've just checked the scene file for the room as well, and there's almost nothing. Twinsen, this being Actor 0, has no Life or Track scripts - they both say END in the files. Then Actor 0, is one of the many other Meca Penguins that you see throughout the game, which for some reason is invisible, and is always located at the north side of the grid / room. This Penguin will appear visible, and will be placed at Twinsen's location if the player has a Penguin in the inventory, in case you didn't know in the mathematical file structure sense. Finally, there are 5 zones listed in the room, each giving you either money, life, or magic points if you use the, "action" command in their specific locations.

Seeing as you've beaten the game, gravel, I realize that you know more about the speed running strategies than I do, but what about in-game actual data? Either way, thanks for giving me some advice. I appreciate it. Now speaking of which, I wonder what all the more of a reason there was for this room to be in the game. I wonder what Fred's intentions were...
I think it's not the room he's talking about. From what I understand we have to change a line in the code and the room appears. Fred said there's really bad stuff in there.

I think it's well hidden.
__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #20  
Old 2016-10-02, 02:01
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
Well in this video here they talk about it but I can't find where.

__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #21  
Old 2016-10-02, 15:31
Bot13's Avatar
Bot13 Bot13 is offline
Look beyond reality.
 
Join Date: Aug 2004
Location: Fortress Island.
Posts: 2,687
How have I missed that speedrun with Raynal & Chanfray??
__________________
Quote:
Originally Posted by ChaosFish View Post
Did you know? Over 30 million people lurk the MBN every day. We who actually post here are like celebrities to them.
Reply With Quote
  #22  
Old 2016-10-02, 18:18
gravel22's Avatar
gravel22 gravel22 is offline
FreemanQC
 
Join Date: Sep 2008
Location: Canada
Posts: 536
Send a message via MSN to gravel22
Quote:
Originally Posted by Bot13 View Post
How have I missed that speedrun with Raynal & Chanfray??
Haha idk man, it even made the front page
__________________
Little Big Adventure Former World Record Holder (53:40:80) see on Twitch below

I'm a LBA speedrunner find me on and SPEEDRUN.COM subscribe to my twitch channel.
Reply With Quote
  #23  
Old 2016-10-02, 19:06
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,760
PAK files are like HQR files from LBA. They have multiple entries and are compressed.

Have a look at some reverse code here: https://github.com/somaen/fitd-resid...er/src/pak.cpp
__________________
Personal Blog - blog.xesf.net

TwinEngine v0.2.1 win32 beta released - open source re-implementation of the LBA 1 original engine.
[Discuss]|[Download]|[Changes]|[SourceCode]|[Issues]


The Sacred Carrot website
Reply With Quote
  #24  
Old 2016-10-02, 22:27
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
I've seen the speed run of LBA 1 already, but did not know Fred actually had a room hidden through code. I did understand what you have already said, gravel, and that you have specifically told me already, but I understand better now. Sorry, thanks for the clarification.

Bot, if you haven't yet, you should see the speed run when you get the chance.

Xesf, thank you so much - I knew that the files were stored in a similar way, but had no idea that there was code to reverse the actual PAK files. I'll have to look into that. I'd say more, but I'm on my phone right now. Thanks again!
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
  #25  
Old 2016-10-02, 22:30
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 708
By the way, gravel, what do you mean by, "bad stuff"? Like mature or adult only content? Or you mean like the reason for it just didn't fit the game???
__________________
I am a Quetch. However, I am a Mr. Quetch.
Reply With Quote
Reply

Tags
aitd, editing, hacking, moding

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
LBA 2 ILE/OBL editing Battler LBA Modifications - General 13 2004-06-09 23:05
my new LBA EDITING site Mannesh LBA Modifications - General 9 2004-05-23 21:17
Editing posts Toblopo Dear moderators 1 2003-11-14 14:18
The Two Dreams about the one Dark Tower and the one Dark Lord. Gustav Sweden Off topic 7 2003-01-09 21:34
Editing GTA Squirrel3of8 Off topic 13 2002-08-23 14:19


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




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