Jump to content


Photo

BGT in Linux (Successfully I think)


  • Please log in to reply
129 replies to this topic

#41 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 30 January 2011 - 08:49 AM

WeiDU on Linux turns all file system calls to lowercase; hence, a single upper case character in the given path will fail. I don't think that dots will cause issues, however.

Edited by the bigg, 30 January 2011 - 08:49 AM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#42 Turambar

Turambar
  • Modder
  • 935 posts

Posted 02 February 2011 - 07:19 AM

I've read that the BGT instalation on linux requires running tis2bg2 over wine.
I've seen, though, on the iesdp, that the .tis format is the same for all IE games: what does tis2bg2 really do? Couldn't the .tis files just be --get-biff_ed from bg1, and --make-biffed into bg2 just afterwards?

edit: added attachments for asc64 ONLY
new tp2 (test 4 last version):
new unix script: ; thanks to Anomaly for his help
debug from last reinstallation, if you need it:
Italian tra file:

Edited by Turambar, 04 January 2012 - 03:18 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#43 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 02 February 2011 - 07:30 AM

IIRC, there's some difference in how overlays are handled between the engines; without tis2bg2, water becomes green when you enable 3d acceleration. After five minutes on Google, I found the source code to tis2bg2. From that archive, you should simply edit tis2bg2.cpp until you can get it to compile and have the same output on some sample files as running tis2bg2.exe via wine.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#44 Turambar

Turambar
  • Modder
  • 935 posts

Posted 02 February 2011 - 09:06 AM

IIRC, there's some difference in how overlays are handled between the engines; without tis2bg2, water becomes green when you enable 3d acceleration. After five minutes on Google, I found the source code to tis2bg2. From that archive, you should simply edit tis2bg2.cpp until you can get it to compile and have the same output on some sample files as running tis2bg2.exe via wine.

Thanks. Unfortunately, I don't know C, I don't nderstand what has to be included, what libs I need, ...
Is there anyone who can tell me how to compile it, or compile it on linux and attach it if it's possible?

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#45 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 02 February 2011 - 10:07 AM

Done. You might want to try it on one file (or ten) and check that its output is the same as the Windows version via Wine before running a BGT setup (since I just toyed a bit with the #ifdefs, chances are that it was compiled as 64 bit or to use the wrong endianness).

Attached Files


Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#46 Turambar

Turambar
  • Modder
  • 935 posts

Posted 02 February 2011 - 12:41 PM

It fails due to buffer overflow:
Spoiler

My machine is 64bit, might that be the problem? It should have most 32-bit-compatibility libs, though. I might try on my laptop (which is 32bit) later.
PS: Perhaps I should start a new topic for this? where?

Edited by Turambar, 02 February 2011 - 01:03 PM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#47 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 02 February 2011 - 12:43 PM

Can you upload the file it was failing on?

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#48 Turambar

Turambar
  • Modder
  • 935 posts

Posted 02 February 2011 - 01:04 PM

Can you upload the file it was failing on?

It was the original AR2000.tis from bg1.
I tested it with wine and the windows tis2bg2 and it appears to work: converted file

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#49 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 03 February 2011 - 09:14 AM

Done, I think (on AR2000 it has the same output whether run from Wine or natively). It works in an ext3 file system, but not in a folder mounted via VirtualBox's protocol - something about MMAP permissions.

Attached Files


Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#50 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 February 2011 - 10:26 AM

Done, I think (on AR2000 it has the same output whether run from Wine or natively). It works in an ext3 file system, but not in a folder mounted via VirtualBox's protocol - something about MMAP permissions.

It still fails, with "Invalid input area name" or "Invalid input area directory":
Spoiler

I'm using it in my home folder, in my normal file system.
Moreover, the .exe you attached does not run through wine
Spoiler

Edited by Turambar, 03 February 2011 - 10:31 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#51 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 03 February 2011 - 10:33 AM

Parameter passing is a fugly mess (but what do you expect out of the BiG congregation). ./tis2bg2_linux -l ./ar2000 linux/ar2000 should work (everything before the last slash is the path, everything after is the SOURCE_RES of this particular area). I also do not know or care why a given tool refuses to work under Wine if I'm working on a native equivalent.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#52 Turambar

Turambar
  • Modder
  • 935 posts

Posted 03 February 2011 - 11:21 AM

Parameter passing is a fugly mess (but what do you expect out of the BiG congregation). ./tis2bg2_linux -l ./ar2000 linux/ar2000 should work (everything before the last slash is the path, everything after is the SOURCE_RES of this particular area). I also do not know or care why a given tool refuses to work under Wine if I'm working on a native equivalent.

Ok it worked now. I diffed the output from wine and linux. The tis are the same, but the wed files differ (but the .wed treated with wine was obtained with an older version of tis2bg2, the one included in BGT).
The two files, opened with IETME, appear the same and correct (whereas the original file from bg1 had green water); NI can open both, and I can't see where they actually differ.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#53 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 04 February 2011 - 02:22 AM

I hope that the contents are identical, except that the version made with the native Linux client has some padding appended to the bottom; if so, it's because memory mapping works differently between Linux and Windows. If not, I have more hacking to do.

EIDT: you can use weidu --cmp-from linux.wed --cmp-to wine.wed to get a crude diff if you don't know of other binary diff tools.

Edited by the bigg, 04 February 2011 - 02:25 AM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#54 Turambar

Turambar
  • Modder
  • 935 posts

Posted 04 February 2011 - 05:58 AM

I checked them with WeiDU and there were only 3 bytes to change:
To turn the linux version into wine
COPY ~linux\ar2000.wed~ ~wine\ar2000.wed~
// patches to turn [linux\ar2000.wed] into [wine\ar2000.wed]
	WRITE_BYTE 0x24 65 // 0x41 == A
	WRITE_BYTE 0x25 82 // 0x52 == R
	WRITE_BYTE 0x2b 52 // 0x34 == 4
Vice versa, to turn wine into linux
COPY ~wine\ar2000.wed~ ~linux\ar2000.wed~
// patches to turn [wine\ar2000.wed] into [linux\ar2000.wed]
	WRITE_BYTE 0x24 97 // 0x61 == a
	WRITE_BYTE 0x25 114 // 0x72 == r
	WRITE_BYTE 0x2b 0 // 0x00
Those offsets are all in the same field: name of the tileset. They are the 1st, 2nd and last character.
I understand the first two: the letters only change case (the old version, through wine, used capital letters; the new, linux one uses lower case).
The last byte is correctly 0 in linux (no character).
I don't understand why the last character is 0x34 (ascii for 4) in the wine version.
Moreover, and that's most astonishing, NI sees the two files as having the same 8 bytes at 0x25: their values (decimal) are 065 082 050 048 048 048 000 000 (hex 0x41 0x52 0x32 0x30 0x30 0x30 0x00 0x00); this is different from what WeiDU says for either file (NI says upper case as the wine version, but the last byte is 0 as in linux)

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#55 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 04 February 2011 - 06:09 AM

The probable cause for the 0x00 vs. 0x34 are differences between how mmap() works in Linux and in Windows (or Wine); probably not worth obsessing over (most likely the Windows/Wine version preserves whatever data was in the memory, while the Linux version sets the whole file to 0x00 before proceeding). As per why it shows as 0x00 in Near Infinity, C strings are delimited by a NUL (0x00) character (and the convention is preserved by Java), thus NI reads the string as "ar2000<end>" and pads the rest of the 8 bytes with NUL characters.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#56 thom_raindog

thom_raindog
  • Member
  • 3 posts

Posted 04 February 2011 - 01:27 PM

Can I throw a question in here as well? I managed to get bgt-linux to a point where it will at least start the installation, but it coughs up an error about not being able to find CHITIN.KEY right away, which is weird as it is right there in the same directory as the game. This might be a simple case of me being dense, but can someone point me to a solution?

I have NOT registered the games, but I would assume that makes no difference here.

#57 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 04 February 2011 - 01:29 PM

Did you run tolower?

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#58 thom_raindog

thom_raindog
  • Member
  • 3 posts

Posted 04 February 2011 - 10:27 PM

I swear I did tun tolower.. maybe at the wrong time? In any case, installation is running as we speak (after symlinking my BG1 dir to a strictly lowercase one ;) ). Keep fingers crossed and thank you!

#59 thom_raindog

thom_raindog
  • Member
  • 3 posts

Posted 05 February 2011 - 10:14 PM

That did it! Thanks so much.

#60 -Die Mensch-Maschine-

-Die Mensch-Maschine-
  • Guest

Posted 06 March 2011 - 04:05 AM

Hi there. I?m trying to get BGT to work on OS X 10.6.6, and my guess is that this would be a good starting point. However, I apparently can?t find MosPack anywhere, this link from the first post appears to be broken. Any one of you would happen to know where I can find it?

Cheers.