Go Back   the Magicball Network > Forums > LBA Projects > TwinEngine
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.

TwinEngine An opensource reimplementation of the Little Big Adventure game engine. [url]http://twin-e.googlecode.com[/url]

Reply
 
Thread Tools
  #26  
Old 2013-07-24, 22:55
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
Quote:
Originally Posted by Lupin View Post
This is great news! Is there anything we can contribute?
Any help needed deciphering what remains unknown of the LBA2 island format?
I'm horrible with any 3d work, so if you're good at that it would be a great help.

Any code contributions would be appreciated though
Reply With Quote
  #27  
Old 2013-07-25, 20:13
Zink's Avatar
Zink Zink is offline
Master of Degree
 
Join Date: Sep 2001
Location: Lublin, Poland
Posts: 1,744
I have seriously enough of these scripts . I managed to catch and handle every single scripts weirdness and quirk (and there are a lot of them) up to the scene 47. And then BAM! The scene 48 contains an address that is against the rules used in previous scenes. And there is no way to distinguish between the cases. To be more specific:

In normal scripts a construct like this may exist:
Code:
SWITCH some_var
  CASE == 1
    some_commands
    BREAK (jumps to the END_SWITCH command)
  CASE == 2
    some_commands
    BREAK (jumps to the END_SWITCH command)
  DEFAULT
    some_commands
    BREAK (jumps to the END_SWITCH command)
END_SWITCH
And this is perfectly understandable and reasonable. But then, at the scene 48, we can find a piece like this:

Code:
SWITCH some_var
  CASE == 1
    some_commands
    BREAK (jumps to the last BREAK command)
  CASE == 2
    some_commands
    BREAK (jumps to the last BREAK command)
  DEFAULT
    some_commands
    BREAK (jumps to the END_SWITCH command)
END_SWITCH
Now can anyone tell how the compiler can tell the difference between these pieces so that it will compile them accordingly? Did they change their compiler behaviour at some point, or they were typing the offsets manually and made a mistake?

I was hoping to make the same thing I made for LBA1: make the compiler generate byte-identical code as the original ones. This way I would have a very good verification of the compiler correctness. But it looks like it's not possible with LBA2. I think the only thing I can do now is to sacrifice 'identicality' and make the binary comparison function to handle some allowed code differences (the difference above does not make the code to function differently, so that's acceptable).
__________________
Emerald Moon Base projects: Little Big Architect - v 0.10 and v 1.0 beta 9, Package Editor - v 0.11+, Text Editor 2 - v 2.3, Font Editor - v 2.03+.
Bug reporting (hosted by alexfont).

All LBA technical information goes in here -> LBA File Information Project

LBA Prequel Demo has been released! See our blog
Reply With Quote
  #28  
Old 2013-07-25, 20:27
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
They probably just have a small bug in the original compiler causing the offset to be off by one. I could take a look at that script if I could get a copy of your code. Maybe a second pair of eyes will shed some light on what the issue is.
Reply With Quote
  #29  
Old 2013-07-25, 20:56
Zink's Avatar
Zink Zink is offline
Master of Degree
 
Join Date: Sep 2001
Location: Lublin, Poland
Posts: 1,744
I highly doubt that it's a compiler bug. In that case it would be the same for all scripts, and the shift is not one byte, but three - exactly the size of the BREAK command (one byte command and 2 bytes address. I will send you the both scripts tomorrow.
__________________
Emerald Moon Base projects: Little Big Architect - v 0.10 and v 1.0 beta 9, Package Editor - v 0.11+, Text Editor 2 - v 2.3, Font Editor - v 2.03+.
Bug reporting (hosted by alexfont).

All LBA technical information goes in here -> LBA File Information Project

LBA Prequel Demo has been released! See our blog
Reply With Quote
  #30  
Old 2013-07-25, 21:32
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,315
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- Zink: Maybe simply treat the BREAK that jumps to the last BREAK as a different command, I suggest naming it something like BREAK_EX or something like that.

Edit: And are you even sure it's supposed to be a BREAK command, instead of say, GOTO? Something like GOTO or JMP would make much more sense here, since it in effect jumps to the target address.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #31  
Old 2013-07-26, 11:20
Zink's Avatar
Zink Zink is offline
Master of Degree
 
Join Date: Sep 2001
Location: Lublin, Poland
Posts: 1,744
Quote:
Originally Posted by Battler View Post
- Zink: Maybe simply treat the BREAK that jumps to the last BREAK as a different command, I suggest naming it something like BREAK_EX or something like that.

Edit: And are you even sure it's supposed to be a BREAK command, instead of say, GOTO? Something like GOTO or JMP would make much more sense here, since it in effect jumps to the target address.
If it was named GOTO in the original commands list, I would name it so too. There is only one BREAK command and it is used in both cases. Naming it differently depending on target command would cause only confusion and more complication to the compiler. That could be kind of a solution if there was any difference in the script behaviour because of that. But since it does not matter if the target address points to the last BREAK or END_SWITCH, I think the best will be just to ignore it.
__________________
Emerald Moon Base projects: Little Big Architect - v 0.10 and v 1.0 beta 9, Package Editor - v 0.11+, Text Editor 2 - v 2.3, Font Editor - v 2.03+.
Bug reporting (hosted by alexfont).

All LBA technical information goes in here -> LBA File Information Project

LBA Prequel Demo has been released! See our blog
Reply With Quote
  #32  
Old 2013-07-26, 16:38
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,315
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- Zink: Well you can keep the name BREAK, but add it a target parameter. Remember, the commands list doesn't specify the parameters for each command, so interpreting the BREAK command as having one parameter (the target) would not create any confusion or complication.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #33  
Old 2013-07-28, 06:19
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
Quick status update:

Model rendering is pretty much complete now. There are a few small texture issues with a few models, but all the main Twinsen models work perfectly. I'm going to try to implement animation next.

If anyone is really good at OpenGL I need to figure out how to draw models on the grid at a certain XYZ coord. My OpenGL skills are enough to draw objects, but not enough to draw multiple objects in relation to each other.

I've attached a large Twinsen in his wizard costume. I should probably turn on some texture filtering to make it look a bit more like it should, but I think this is fine for now.
Attached Thumbnails
Click image for larger version

Name:	bigwizard.png‎
Views:	327
Size:	33.8 KB
ID:	9786  
Reply With Quote
  #34  
Old 2013-07-28, 10:25
Zink's Avatar
Zink Zink is offline
Master of Degree
 
Join Date: Sep 2001
Location: Lublin, Poland
Posts: 1,744
Quote:
Originally Posted by Battler View Post
- Zink: Well you can keep the name BREAK, but add it a target parameter. Remember, the commands list doesn't specify the parameters for each command, so interpreting the BREAK command as having one parameter (the target) would not create any confusion or complication.
It could be reasonable to make such option, but it turned out that this gglitch* occurs only in one place in all the scripts. I just made all the LBA2 scripts compile successfully, and, except for that single place, identically to the originals. So considering that it does not influence the script's effect I think it is much more reasonable to compile that place just like the others.

* (c) Umbilical Brothers
__________________
Emerald Moon Base projects: Little Big Architect - v 0.10 and v 1.0 beta 9, Package Editor - v 0.11+, Text Editor 2 - v 2.3, Font Editor - v 2.03+.
Bug reporting (hosted by alexfont).

All LBA technical information goes in here -> LBA File Information Project

LBA Prequel Demo has been released! See our blog
Reply With Quote
  #35  
Old 2013-07-28, 11:45
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,315
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- Zink: Yes, but considering the change would be quite minor, I can't see a valid reason to not implement it. And no, it's not much more reasonable to compile that place just like the others because it removes accuracy.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #36  
Old 2013-07-28, 15:13
Zink's Avatar
Zink Zink is offline
Master of Degree
 
Join Date: Sep 2001
Location: Lublin, Poland
Posts: 1,744
Done, for the sake of perfectionism!
__________________
Emerald Moon Base projects: Little Big Architect - v 0.10 and v 1.0 beta 9, Package Editor - v 0.11+, Text Editor 2 - v 2.3, Font Editor - v 2.03+.
Bug reporting (hosted by alexfont).

All LBA technical information goes in here -> LBA File Information Project

LBA Prequel Demo has been released! See our blog
Reply With Quote
  #37  
Old 2013-07-29, 18:24
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
Zink, I'd like to start adding scripting support to the engine. I guess you know the most about how the scripting works, so do you have ideas on how to implement a good scripting system?
Reply With Quote
  #38  
Old 2013-07-29, 18:52
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,751
Quote:
Originally Posted by klusark View Post
Zink, I'd like to start adding scripting support to the engine. I guess you know the most about how the scripting works, so do you have ideas on how to implement a good scripting system?
Take a look at what i did on twin-e. The implementation on LBArchiect is different from what we need on residuslvm
__________________
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
  #39  
Old 2013-07-29, 20:54
Zink's Avatar
Zink Zink is offline
Master of Degree
 
Join Date: Sep 2001
Location: Lublin, Poland
Posts: 1,744
Alexfont is right here. LBArchitect's script decoding implementation would be counter-optimal for the engine. I think the best is the Twin-e approach (a switch structure for all opcodes), because, up to my knowledge, C/C++ creates hash tables for large switches, which means it's the fastest solution we can get, and easier to maintain than a custom hash table.

What I can help in the most is the LBA2 Scene format, of which I have discovered some more nuances than are available in the currently public documents (still many things remain unknown however), and I think I am able to tell what actions should the engine take on most of the commands.
__________________
Emerald Moon Base projects: Little Big Architect - v 0.10 and v 1.0 beta 9, Package Editor - v 0.11+, Text Editor 2 - v 2.3, Font Editor - v 2.03+.
Bug reporting (hosted by alexfont).

All LBA technical information goes in here -> LBA File Information Project

LBA Prequel Demo has been released! See our blog
Reply With Quote
  #40  
Old 2013-07-30, 04:59
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
A list of opcodes to approximate actions would be greatly appreciated

I hope that it is overall similar to the LBA1 scripting so that I can write something general right away.

Also, a small update:

I've got some mostly working island viewing code. For some reason there is colour banding and large black areas, but I'm sure I'll figure that out soon.

I got models loaded, but I can not get them to draw in the right place. It seems like the coords are rotated 90 degrees from the center of the section they are in, but when rotated they are still not in the correct location. Anyone know why that might be?
Attached Thumbnails
Click image for larger version

Name:	mostlydonetexture.png‎
Views:	353
Size:	450.0 KB
ID:	9789  
Reply With Quote
  #41  
Old 2013-07-30, 13:09
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,315
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- klusark: Parts of the islands are either untextured (therefore filled with a solid color only) such as the brown dirt on Citadel Island, and parts are textured with textures from RESS.HQR.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #42  
Old 2013-07-30, 17:30
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
Battler: I do realize that. The default colour is white, so as it is the island is requesting the colour to be black. Obviously I just am missing some part of the code.

I attached an example of how it looks up close to show the problem a little better.
Attached Thumbnails
Click image for larger version

Name:	islandclose.png‎
Views:	263
Size:	400.7 KB
ID:	9790  
Reply With Quote
  #43  
Old 2013-07-30, 18:53
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,315
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- klusark: The black is where the sea texture from RESS.HQR should go.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #44  
Old 2013-07-30, 19:12
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
Battler: No, it shouldn't. Attached is the same area in the original game.
Attached Thumbnails
Click image for larger version

Name:	islandcloselba.png‎
Views:	386
Size:	137.4 KB
ID:	9791  
Reply With Quote
  #45  
Old 2013-07-30, 19:53
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,315
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- klusark: You're right. Then I have no idea why you're getting black there. Ask alexfont or someone to give you yaz0r's code for the LBA 2 islands, maybe that can help you.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #46  
Old 2013-07-31, 09:33
Lupin's Avatar
Lupin Lupin is offline
Previously Link
 
Join Date: Dec 2001
Location: Paris
Posts: 2,761
Did you check this thread? http://forum.magicball.net/showthrea...t=13076&page=8
There should be the answer to your question in the last few pages. The thread is a general discussion on deciphering the island format.
I don't recall this particular part exactly but I think it has to do with color ramps (using a whole line of the color palette to create gradients).
Also, the LBAOnline code deals with both issues (black areas and building positions/rotations). You can find a link to it in a previous post here.

Edit: I realize you are already using LBAOnline's code. I don't see what could possibly be wrong at first sight.

Last edited by Lupin; 2013-07-31 at 10:02.
Reply With Quote
  #47  
Old 2013-08-02, 04:10
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
It was a problem with leaving textures enabled when drawing without textures.

I've attached a new image, with models, but the models aren't textured yet.

On my computer I get around 1200fps.
Attached Thumbnails
Click image for larger version

Name:	largeisland.jpg‎
Views:	366
Size:	144.3 KB
ID:	9797  
Reply With Quote
  #48  
Old 2013-08-02, 05:26
Homeless's Avatar
Homeless Homeless is offline
Zebrazilla
 
Join Date: Oct 2002
Posts: 4,054
Looks fantastic! I'm glad to see this progress
__________________

LBA Speedruns
Personal Best - LBA 1 - Any% PC - Time: 01h 04m 23s
Personal Best - LBA 1 - Any% Android - Time: 01h 04m 35s
Reply With Quote
  #49  
Old 2013-08-07, 21:15
Zink's Avatar
Zink Zink is offline
Master of Degree
 
Join Date: Sep 2001
Location: Lublin, Poland
Posts: 1,744
A small question: what is the easiest option to compile the ResidualVM on Windows? I tried using cygwin, but I got this: "ERROR: Cygwin building is not supported by ScummVM anymore. Consider using MinGW.". I don't like MingW (never succeeded in compiling anything), so maybe another environment (graphical preferably)?
__________________
Emerald Moon Base projects: Little Big Architect - v 0.10 and v 1.0 beta 9, Package Editor - v 0.11+, Text Editor 2 - v 2.3, Font Editor - v 2.03+.
Bug reporting (hosted by alexfont).

All LBA technical information goes in here -> LBA File Information Project

LBA Prequel Demo has been released! See our blog
Reply With Quote
  #50  
Old 2013-08-07, 21:33
klusark klusark is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2013
Posts: 21
This is the way I do it:
In the folder you checkout open
devtools/create_project/msvc11/create_project.sln
Just replace msvc11 with the version you are using.

Compile that tool.

From the root directory run
Code:
create_project . --msvc --msvc-version 11 --disable-png --disable-flac --disable-vorbis --disable-theora --disable-mpeg2 --disable-mad --disable-mt32emu --disable-scalers --disable-hqscalers --disable-freetype --disable-engine=myst3 --disable-engine=grim
Replace the 11 with the msvc version you want.
This will disable all the libraries that aren't needed for LBA and disable the Grim and Myst3 engines so you don't have to build those.

It will create residualvm.sln which can be used for development.


Since ResidualVM is based off of ScummVM, the instructions here should help you compile on any platforms we support. Note that LBA doesn't require any extra libraries other than SDL right now, so you can ignore most of the library related instructions.
Reply With Quote
Reply

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
Another implementation ambient Little Script Adventure 3 2013-01-25 00:16
A new forum for Yaz0r's TwinEngine ChaosFish LBA Modifications - General 7 2007-05-25 12:19
Problem with the twinengine Polaris First aid 6 2007-02-09 12:51


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




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