the Magicball Network Forums

the Magicball Network Forums (
-   LBA Modifications - General (
-   -   LBArchitect with the LBA2 Scene editing! (

Zink 2013-12-25 21:32

LBArchitect with the LBA2 Scene editing!
Hi all,

I managed to release the LBArchitect beta 9, that includes the LBA2 Scene and Script editing. And a sad news is that this may be the last version that will be released. I don't know if I will be able to continue work on this. I will however do my best to fix important bugs if they are found.

This version enables you to open, edit and save scenes from LBA2, including scripts, and including the outside scenes. However, they have to be loaded with another background (one of the existing isometric Grids). Building LBA2 stages with Designer is not possible yet.

There is also no help for the script commands. If you want to help, you may test the commands and send me anything you discover. Since I didn't have the game source, I researched the script command parameters by setting a value and testing whether all the scripts decompile well. Unfortunately, some commands are never used in the original scripts, so this method could not work for them. Because of that some commands may work strangely, while others may crash the game.

You can download the beta 9 version from my site:

or, if the the above link does not work for you, from here:


Darkflame 2013-12-26 01:22

Just wow.

What a present!
Really well done!

xesf 2013-12-26 16:17

LBA community always has great gifts in this part of the season. Really great work Zink.

As I can easily understand you won't be able to work more on this tool, I just need to thank you all the hard work and effort you've been doing in this past years with all your tools, specially LBArchitect.

One last note, you should get rid of the "beta 9" suffix because the tools is so damn stable after all those versions :D

Polaris 2013-12-27 00:26

That's aweseome ! No, awesome !! Thanks you Zink |)

Zink 2013-12-27 11:20


Originally Posted by alexfont (Post 447032)
As I can easily understand you won't be able to work more on this tool

That's not set in stone. It may turn out I will have some time. I just can't be sure now how much or if any.


Originally Posted by alexfont (Post 447032)
One last note, you should get rid of the "beta 9" suffix because the tools is so damn stable after all those versions :D

Good point. I will think about it for the next release :P

Polaris 2014-02-10 11:14

Who is Stanley ?

Jast 2014-02-10 16:10


Originally Posted by Polaris (Post 447459)
Who is Stanley ?

I'm guessing:

Originally Posted by Twinsunica
At some place in the [Emperor's] palace, Twinsen inquires a guy called Stanley from Adeline Software International's game Time Commando.

Polaris 2014-02-10 19:02

That guy has a name ?! I thought he simply was "the Time Commando" :stupid:

Polaris 2014-02-10 19:22

Neat I must say !

marcosmapf 2014-02-11 00:17

That's very nice! Are you planning on doing something specific or are you just messing around with the tools?

Zink 2014-02-11 22:22


Originally Posted by MrQuetch (Post 447456)
Nice job, Zink! Wow, I am very impressed! The same goes for just about everyone else. By the way, I downloaded the program. However, I am having trouble trying to save an edited already existing scene to, "LS2" format. It only allows me to save in, "LS1" format, which was what the last LBArchitect included with it. Also, how do I open up the outside scenes? Can you please tell me how to save to, "LS2" format, and how to open up outside scenes? Thanks! I hope to hear from you soon! ;)

Hi! It's great someone is actually doing something with the program :)

The only available LS1 format is a bug. I just omitted the place when I was fixing the file dialogs. Alternatively you can save the grid/scene to a scenario, open the scenario as a HQR file, and then extract the LS2 file from the entry 9 (counting from 1), (which will be there only if the Scripts compile without errors).

Darkflame 2014-02-12 14:17

This is all awesome stuff :D
I wish I had time to play about with it but I am swamped with work right now.

Zink 2014-02-13 08:21


Originally Posted by MrQuetch (Post 447477)
Do you know if there are any easier ways of editing the outside scenes? All I can do is turn on the, "Green Net". Even then, that doesn't help. From my experience and knowledge, I have to estimate where actual locations are from locations of nearby objects that I know are there in the game. If it is not too hard, having exact point locations would be nice, but I understand that there is still more to be done.

I don't know any. I actually didn't mean to include the outside scene editing for this release, but the format turned out to be the same as of the isometric ones, so it didn't require any additional work. For the next release ("If" :)) I plan to make at least displaying the height maps of the outside areas in isometric mode. But it's a lot of work, because I need to change the rendering engine to a more flexible one, and that will... you know what :).


Originally Posted by MrQuetch (Post 447477)
By the way, I also figured out the, "IMPACT POINT" code line used for LBA 2. This line of code creates an effect at the index of a, "Flag Point / Location", and then the index of the effect that is displayed there.

In the SCENE.HQR file at entry 57, there are some examples of these used for land mines after the Zeelichians have invaded Twinsun. They are located near the bottom of the grid. For example: Actor 18 is only enabled after the invasion, and if you are a distance away, while not being in discreet mode, the line will be triggered. You will then hear a, "Click" and the line of code, "IMPACT POINT" will trigger. Note for the object, the flag where the effect happens is at the same position. This doesn't have to be the same. You could have an effect happen on the opposite side of the grid, just change the flag location. Here is another example: Change IMPACT POINT 18 15 to 15 15. This will create an explosion where Dino - Fly would be standing, or is standing.

Oh, that's great you figured it out. Thanks for the explanation, I will check it when I have some time.

Battler 2014-02-14 03:21

- Zink: For rendering height maps in isometric mode, you can look at the code of my LBA 2 Island Height Map Viewer. That pretty much does just that.

Zink 2014-02-14 08:16

Thanks, I will certainly do that.

Zink 2014-02-17 20:42

I never played TC nor AITD, so I can't tell for sure, but if the resource.hqr is the only hqr file in TC directory, it is possible that all is kept inside it, in the way that each entry contains one group of data, that are further encoded (like smaller HQRs inside one large HQR). This technique is present in both LBA1 and 2. I cannot help you in the research, but I can give you some advice:
1. You could test if I'm right with the structure by unpacking one of the entries (preferably a large one) and research by hex-editing whether or not it contains something like a list of offsets at the beginning. It might be hard to see if present, as well as apparent while not present (the data might resemble such structure while being something else).
2. After trying to find the file's structure, the research method I use to find out what the entry does, is changing a random part of the file (taking the structure into consideration not avoid making the file unreadable to the game engine) to something else (starting with a single byte, in most cases to 0x00 or 0xFF) and playing the game for couple of minutes to see if that changed something. If not, try another byte or group, ending with the whole file if necessary (I had to do that couple of times for LBA2). If the game crashes after the change, return that byte to the original value, and try another byte or a different value.

It's not an easy task, and no effects are guaranteed. I still have not discovered some entries of ress.hqr from LBA2, though I have changed all of their contents and played the whole game. Looks like they are not used for anything (which might be true as well).

As for scene editing... it depends. We could tell if we knew the scene format.

SpaceGuitarist 2016-12-14 05:41


Originally Posted by MrQuetch (Post 447465)
I just made this in spare time.







Polaris 2016-12-15 20:17


SpaceGuitarist 2016-12-16 01:25

Apparently, you have plenty of time during lunch breaks. I suggest you make more "hot rabbibunnies in swimsuits" montages druing this period. :rolleyes:

Wesker 2016-12-18 06:01


Originally Posted by MrQuetch (Post 455214)
You have to hex the files in order to change the color of polys, and then save the file as under a different name with the same lm2 extension.

Is this also possible with Time Commando, MrQuetch? Namely the console versions? Because if that's the case, then I would definitely like to try.

Wesker 2016-12-24 03:04


Originally Posted by MrQuetch (Post 455225)
Although the formats are similar from PC to console, they are NOT exactly the same as far as I know. Similar, but different.

I'll be honest, I'd love to edit the models for Time Commando and play as Stanley in blue instead of yellow, but that'd need shifting the hues of his texture because his entire suit is a texture, NOT a color.

Actually though, each texture has a polygon color under it, you can play the game with the textures OFF, but I never do that because the textures bring out more detail in the game's overall style. This way, you can see the poly color and not poly texture, but I guess you could change poly color, but then you'd need to change textures if you want to play with a different colored texture.

I suggest you ask Battler, Zink, and Xesf, because they know much more about how the files are stored, and how they work, especially for LBA. Not much work seems to have been done for Time Commando yet, unfortunately.

By hexing though, I've figured out some of the entries for Time Commando in the LBA Package Editor - which can open up HQR files, and actually gave a list to Xesf so he can add them in the Package Editor list of indices.

Unfortunately, I never discovered anything too special, but I learned that Time Commando uses the exact same sound effect and image formats like the LBA games do. That being said, it should be similar for Alone in the Dark, but that uses PAK files instead of HQR files. Additionally, with all of this being said, you should be able to open up the models and view them with animations if they have the same / similar format as the LBA and AITD series do.

Xesf has a lot of custom programs on his sacred carrot website - you should check it out if you haven't yet.

So, it should be possible to edit the models for TC, and play the game with your modifications, but there is only one entry in an HQR for TC that contains the models - it's strange because LBA1 and 2 have HQR's that hold the models and animations separately from each other. For TC, they are all compressed in a single entry in an HQR - which really sucks, and I don't know how to 'uncompress' it even more (it's the same story for the hex that I've done for AITD, you should also check that thread if you haven't yet). Actually, AITD's PAKs' are more structured like the LBA's HQRs'.

I wish there was an entry for each model and animation in TC like LBA, but TC seems to have been compressed a 'second' time, and Xesf would know how that's stored I'm sure. Maybe he'll find a way to get those files 'uncompressed', and if he does, we can edit them like the LBA files.

I wanted to edit the models for TC like a year ago, but I could never figure out where what was located after extracting the entry which has all models an animations - it's too big to tell where anything is with the extra compression. Even then, if you DID hex a part of the code, you wouldn't be able to tell what you switched, and if you managed to switch something, a group of things would all be edited from changing one thing of binary code.

For example, in AITD, I changed one value, and it moved a group of vertices from Emily's head to the right - hand side of the screen.

Sorry for the big paragraphs, but I hoped this helps some with how it works. Xesf, I'm sure will be able to figure it out and have an executable to edit the files in the future.

Thanks for the long and detailed answer, MrQuetch.

I'm asking this because the Sega Saturn version of Time Commando is a mess with wrong and inconsistent color choices. Stanley for example has his face in the correct skin color but then his neck and hands are in a different brownish-like color which doesn't match his face. And many enemies are also like that.

Now that you mentioned about the models using textures, I noticed the textured parts in the models are all displayed in the correct color, but then the flat shaded ones have wrong colors so maybe it's not that difficult to make them match the correct colors in the textures.

Some pictures to show what I'm referring to.

Funny thing is, in the credits scene the Stanley model and some others appear with the correct matching skin colors! While some other character/enemy models show up way worse than they do in the game.

Wesker 2016-12-25 04:09

MrQuetch, the problem with the Sega Saturn is the rendering. The console doesn't render polygonal graphics in triangles like the PlayStation does, but in quads, a less used standard than triangles. So that forces you to readapt the polygon models to similar ones rendered in quads, hence why you may notice those models are "different" to the ones in the PC and PlayStation versions, as they are more bulkier as a result. This happens with most 3D polygon games that are multiplataform and shared by the Sega Saturn and either the PC or the PlayStation, it was a norm because of the stantard used. And of course, this is applied to the polygon graphics of the Sega Saturn version of Time Commando.

Another big issue in the Sega Saturn version of Time Commando is the lack of shading, at all. The PC and PlayStation version have a lot of shading with help to "disguise" the combination of textured parts and flat parts that the models do. But in the Sega Saturn version there was NO shading at all programmed so that's why the models look like that, very crude. It was possible to program shading in the Sega Saturn, some other games like for example the Resident Evil conversion managed to do it, but it seems it was a complicated task because of the dual CPU-GPU architecture of the console and the tricky hardware the system had, and clearly Time Commando for the Sega Saturn suffers because of this omission. In fact, I noticed that those differences in skin color present through the characters' bodies ARE ALSO in the PC and PlayStation versions, but they are less evident because of the shading which manages to properly integrate each other together. On the Sega Saturn version they couldn't get the shading working and instead of properly redesign the colors to fit to the new "crude" situation of this version, they simply left it like the other versions are.

The Sega Saturn version was not programmed by Adeline Software, but by another French company known as Virtual Studio. This company was formed from the ashes of Loriciel, which was a noted French company from the 80s/early 90s which went bankrupt in 1993. Under their new form of Virtual Studio and keeping most of the staff that Loriciel had, they went to develop some games for other bigger companies, for example the Smurfs games for Infogrames, and also this conversion of Time Commando for the Sega Saturn which was released in March 1998, that is, when the entire Adeline staff had already moved to form No Cliché under the ownership of Sega. I bet neither Fred nor ayone from the former Adeline staff had anything to do with it (I have always wanted to ask Fred about this but he probably won't know anything) and I can also guess this was all agreed between Delphine Software, the parent comany of Adeline, and Acclaim which was the company interested in having a Sega Saturn version developed and published. It was only published in Japan by the Japanese branch of Acclaim though, the North American and European one wasn't interested (by 1998, the Sega Saturn was pretty much doomed outside Japan, where it enjoyed a better status and still had many games released until 1999/2000).

I'm thinking that either these guys of Virtual Studio had very little expertise on the Sega Saturn or they were simply rushed to release the game in this status, as it has a very incomplete feel. There's even a major fatal bug in stage 8, the future one, which has always happened to me playing the game up to that point and have never able to elude. The only way I have been able to play stage 9 and finish the game has been through passwords, as this version use the exact same passwords of the PlayStation version since this version is largely based on it. It has the same title screen menus and options (which are different in the PC version) and it also shares the same modifications the PlayStation version did compared to the PC version based on game interface and else. The framerate is also very jerky (this usually moves between 10-20fps and suffers a lot when there's a lot of enemies around) and there's also some sound irregularities concerning wrong voice pitches and lousy MIDI music conversion (and this was clearly lazyness from the conversion team because the Sega Saturn has GREAT music/sound hardware, of better quality than the one of the PlayStation in fact).

To sum up, a total mess of a conversion. But I like a lot both Time Commando and the Sega Saturn, which is one of my favorite consoles. I wish it would have also received a conversion of Little Big Adventure, but alas this never happened. Little Big Adventure 2 was actually slated to appear in both the PlayStation and the Sega Saturn, but it never happened in either of them. The Sega Saturn proved well when it was developed correctly for it, for example the Resident Evil conversion I mentioned before. This has adapted graphics compared to the PlayStation conversion (again, because of the triangle/quad difference) but AT LEAST it has SHADING and everything looks pretty decent. Now that you mentioned about Alone in the Dark 2, there's also a Sega Saturn version of that one, with the same textured models of the PlayStation version and else, but it suffers similar problems to the Time Commando conversion: no shading and jerky framerate. But at least the color design choices in that one are correct, unlike Time Commando, and it also has some benefits compared to the PlayStation version: the Sega Saturn takes much less time to load (the PlayStation version is a huge pain in the ass in that regard, it's constatly loading whatever little thing you do and takes a lot) and it has MIDI music which isn't interrupted by cutscenes, unlike the PlayStation which features sample music from the PC CD version but it always stops when a cutscene appears and that breaks the game flow a lot. That version was developed by Infogrames itself, clearly by people who had problems programming the Sega Saturn but at least were a little wiser than Virtual Studio was when converting Time Commando.

So that's why at I would like to try to fix this color issue, and, even if there's still a lot of problems regarding the Sega Saturn conversion, at least there would be some consistency of the graphics and not that carnival color fest it has because of the different and wrong skin colors through the character bodies and else.

If you are curious enough, here you have some samples of the Sega Saturn version of Time Commando running and also a comparison with the PlayStation version (and some other games which follow after that).

Polaris 2017-01-07 12:39

Whoah, technical :eek: How did you get so much knowledge on the subject ?

Wesker 2018-01-31 00:39


Originally Posted by Polaris (Post 455275)
Whoah, technical :eek: How did you get so much knowledge on the subject ?

I suppose you mean me? Sorry for getting back to you so late (more than a year later!), I went back to this thread just by coincidence and saw your message.

I'm an enthusiast of the Sega Saturn console (and most Sega systems in general) and since I like the Fred games a lot, you can pretty much guess. When I figured out many years ago that there was a rare Sega Saturn version of Time Commando released in Japan, I went and bought it straight away. This version has always been very undocummented because of its rarity, many people don't even know it actually exists.

So, when I got the game... boy, you had to see the reaction in my face about what I got. I would have loved to see a conversion of a great Fred game like Time Commando (and wished about the Little Big Adventure games to make the way to this system too as was intended, but sadly never happend) making its way in a great shape and form to one of my favourite systems of all time... only to find this travesty of a port which is almost unbearable/unplayable.

It's that bad, and not because the console is difficult to program for, which it's, but also because the porting team (French company Virtual Studio) didn't even try. I mean, the Sega Saturn got many games graphically/technically more advanced than Time Commando faring out way better in the console. This one is clearly the prime example of how not to code for the systems and worst of all, release a game like this. It even has a fatal bug in level 8 which prevents you from completing the game! The only way you can actually finish the Sega Saturn version is by jumping to level 9 straight by password (which you can get from the PlayStation version since the Sega Saturn version shares identical passwords with that version). Lame.

Anyway, of course I have some expertise in the technical aspects of the Sega Saturn since I'm so fond of this console and therefore analyzed the many issues of its conversion of Time Commando during all the years I have had this version and played it throughout. It's not like I'm a programming/coding expert, quite on the contrary, but have informed a lot about how the console behaves and what's reflected about this in this particular version of the game, and well... that's how I tried to explain it to MrQuetch long ago when the topic arise, since he said something about changing polygon colors and wanted to see if that was also possible in the Sega Saturn of Time Commando to fix the mess of the miscolored graphics it has, which is one of its many bad issues.

Battler 2021-04-12 09:30

- Zink: Would it be possible to obtain the source code of the latest version of LBArchitect? I'm asking, because you might have discovered information about the scene formats that might be useful for my own program (I'm still planning to port them all, or at least those that are still needed, to some language that's better than Visual Basic 6, especially now that Microsoft have made that impossible to use on the recent Windows versions).

All times are GMT +2. The time now is 09:49.

Powered by vBulletin®
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2021, the Magicball Network