32-bit mode hook
Moderator: JeremyaFr
Re: 32-bit mode hook
- ual002
- Posts: 982
- Joined: Wed Sep 24, 2008 2:23 am
While I'm testing as many of the objects with this new hook, I found necessary to log what I'm doing. Does anyone actually have a list of the numbers associated with the model index for everything? The shiplists.txt is not accurate for the model index I realized.





- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
I haven't touched the settings, they are as they where taking both images, and sorry but I didn't like reshade, so I not going there

I think the only thing you can do is to use the Craft No. in MXvTED at least most people should be familiar with itual002 wrote: ↑Sat Jul 20, 2019 7:47 pmWhile I'm testing as many of the objects with this new hook, I found necessary to log what I'm doing. Does anyone actually have a list of the numbers associated with the model index for everything? The shiplists.txt is not accurate for the model index I realized.

“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
002, are you talking about non ship opts like the DS2 interior models? i think the hangarmapeditor might have that info.
Jeremy, have a question. Would it help memory wise, if we manually converted all the .opt files to 32-bpp per the tutorial thread I posted (via your XWAOptEditor & 32 bit patcher.xml for the game engine), and then add the last three sections of your readme file from xwa_hook_32bpp.zip / xwa_hook_32bpp_diffuse.zip to the patcher.xml file in XwaExePatcher-1.0.17 folder? Or is it waste of time? The offsets are little different. Thanks.
Jeremy, have a question. Would it help memory wise, if we manually converted all the .opt files to 32-bpp per the tutorial thread I posted (via your XWAOptEditor & 32 bit patcher.xml for the game engine), and then add the last three sections of your readme file from xwa_hook_32bpp.zip / xwa_hook_32bpp_diffuse.zip to the patcher.xml file in XwaExePatcher-1.0.17 folder? Or is it waste of time? The offsets are little different. Thanks.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Is this better?
Is this better?
You do not have the required permissions to view the files attached to this post.
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Bman, no need to pre convert the OPTs. It can be done at runtime by the hook.
The hook is required to support illumination for 32-bit models.
If you convert OPTs to 32-bit with XwaOptEditor, you will lose the illumination. I will update the editor with the changes from the hook to support illumination for 32-bit OPTs.
The hook is required to support illumination for 32-bit models.
If you convert OPTs to 32-bit with XwaOptEditor, you will lose the illumination. I will update the editor with the changes from the hook to support illumination for 32-bit OPTs.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Much better than it was Jeremy, thank you, I think this will be perfect, the shuttles wings are a little darker now, but again much better than they where with no 32bpp hook
Your a bit of a miracle worker aren't you
Your a bit of a miracle worker aren't you

“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Thanks so much. This is awesome. Reason I asked, I wasn't sure if the .opt models were permanently changed to 32bpp format on the HD after game ends, or if it was temporary during the runtime environment and then reverts back. That could use a lot of memory. Well done nonetheless. Worf-out. 

W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- ual002
- Posts: 982
- Joined: Wed Sep 24, 2008 2:23 am
Roger on MXVTED, that's what I was sorta using but it was a pain. I might put an excel dock together for the state of DSUCP shiplists and then ppl can use it on the fly to plop objects into hangars with [hangarmap] sections of the ini
I went a little nuts making a Space Colony 2 Hangar for myself today
https://imgur.com/a/O4HYzzG
Ok, I'm done hijacking.
I went a little nuts making a Space Colony 2 Hangar for myself today
https://imgur.com/a/O4HYzzG
Ok, I'm done hijacking.





- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Pardon me if I'm being dense, but what is the point of increasing the bits per pixel from 16 to 32 without using 32 bit textures in the opts to exploit the larger color space?
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
In OPTs, the colors are defined as 565 format. An alpha value of 8 bits can be attached to a pixel. When a texture is transparent, the game reduces the color format to 4444.
In DATs, the images are in 8 bits indexed. The color index points to a RGB 888 color. An alpha value of 8 bits can be attach to a color. In the result, the pixel are defined as 32 bits. But the game reduces the color to 1555 (or 4444 with a patch).
The hook enables full 32-bit for those existing images.
In DATs, the images are in 8 bits indexed. The color index points to a RGB 888 color. An alpha value of 8 bits can be attach to a color. In the result, the pixel are defined as 32 bits. But the game reduces the color to 1555 (or 4444 with a patch).
The hook enables full 32-bit for those existing images.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Q. Question, Do you still need the 4444 patch applied?
I take it now, that the hook applies all the necessary offsets
I take it now, that the hook applies all the necessary offsets
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The 4444 patch is not needed.
The hook set it for the ModelIndex_418_16000_0_ResData_Fonts. The game required that the fonts stay in 16-bits. Otherwise it crashes.
The hook set it for the ModelIndex_418_16000_0_ResData_Fonts. The game required that the fonts stay in 16-bits. Otherwise it crashes.
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Can you redownload the hook and retry?
If the problem persists, please attach a screenshot.
- DarHan
- Posts: 324
- Joined: Mon Dec 05, 2005 12:01 am
- Contact:
Sorry, I forgot to report. The version you uploaded last night solved that issue.
“Red Four, nothing’s gone wrong yet.”
— Hobbie Klivian
— Hobbie Klivian
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Confirmed, xwaOptEditor didn't have illumination for native 32-bpp textures.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
I have to update the library (JeremyAnsel.Xwa.Opt) and the editor (XwaOptEditor) to support illumination for 32-bit textures.
- Trevor
- Posts: 539
- Joined: Thu Dec 04, 2014 7:11 pm
So what exactly was happening when all shading disappeared?
It looked like all vertex shading went out the window and Ambient was set to 1.0
Was this because the hook blocked vertex shading data or because the texture was considered a "light" (you mentioned illumination a few times but I wanted to be sure)
Trev
It looked like all vertex shading went out the window and Ambient was set to 1.0
Was this because the hook blocked vertex shading data or because the texture was considered a "light" (you mentioned illumination a few times but I wanted to be sure)
Trev
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
It was the ambiant color and the diffuse color not reacting with the vertex normals.
- Trevor
- Posts: 539
- Joined: Thu Dec 04, 2014 7:11 pm
Does that mean that XWA sets Ambient to 1.0 if its unable to work out diffuse lighting from normals? I guess that's kinda clever since it avoids objects being black or very dark.
By the way, what is the global Ambient value that XWA uses? or is it dependent on mission?
Trev
By the way, what is the global Ambient value that XWA uses? or is it dependent on mission?
Trev
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
For projectiles, the game set the ambient color to 1.0.
When diffuse lighting is disabled, the game set the color to 0.4.
When diffuse lighting is enabled, the game initializes the color to 0.0 and adds the diffuse lights. The hook initializes the color to 0.2.
When diffuse lighting is disabled, the game set the color to 0.4.
When diffuse lighting is enabled, the game initializes the color to 0.0 and adds the diffuse lights. The hook initializes the color to 0.2.
- rogue518
- Posts: 2815
- Joined: Wed Jul 12, 2000 11:01 pm
- Contact:
Hell,... my game crashes to desktop when I try to start a mission using xwa_hook_32bpp or xwa_hook_32bpp_diffuse....
When I take out the hook... xwa_hook_32bpp or xwa_hook_32bpp_diffuse... the game can be played.
Sincerely, Rogue518

Sincerely, Rogue518
'Stay in Attack formation!' Darth Vader aka: Anakin Skywalker During the 'Battle Of Yavin'
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Can you attach a crash report from the Event Viewer please?
- rogue518
- Posts: 2815
- Joined: Wed Jul 12, 2000 11:01 pm
- Contact:
JeremyaFr…. I think this is what you want.... I went into Event Viewer, and found this:
Level Date and Time Source Event ID Task Category
Error 7/27/2019 5:17:39 PM Application Error 1000 (100)"
Faulting application name: XWingAlliance.exe, version: 2.0.0.2, time stamp: 0x3765a9b7
Faulting module name: KERNELBASE.dll, version: 10.0.17763.615, time stamp: 0x832170f2
Exception code: 0xe06d7363
Fault offset: 0x0011fd62
Faulting process id: 0x1784
Faulting application start time: 0x01d544c0ac6335b4
Faulting application path: F:\GOG Games\Star Wars - X-Wing Alliance\XWingAlliance.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: a05eef43-df41-4275-88fe-ea9fea389845
Faulting package full name:
Faulting package-relative application ID: "
This was in XML View:
I hope this helps... I hope this is what you are looking for.....
Sincerely, Rogue518
Level Date and Time Source Event ID Task Category
Error 7/27/2019 5:17:39 PM Application Error 1000 (100)"
Faulting application name: XWingAlliance.exe, version: 2.0.0.2, time stamp: 0x3765a9b7
Faulting module name: KERNELBASE.dll, version: 10.0.17763.615, time stamp: 0x832170f2
Exception code: 0xe06d7363
Fault offset: 0x0011fd62
Faulting process id: 0x1784
Faulting application start time: 0x01d544c0ac6335b4
Faulting application path: F:\GOG Games\Star Wars - X-Wing Alliance\XWingAlliance.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: a05eef43-df41-4275-88fe-ea9fea389845
Faulting package full name:
Faulting package-relative application ID: "
This was in XML View:
Code: Select all
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2019-07-27T21:17:39.093792100Z" />
<EventRecordID>2122</EventRecordID>
<Channel>Application</Channel>
<Computer>DESKTOP-8J1CGS1</Computer>
<Security />
</System>
- <EventData>
<Data>XWingAlliance.exe</Data>
<Data>2.0.0.2</Data>
<Data>3765a9b7</Data>
<Data>KERNELBASE.dll</Data>
<Data>10.0.17763.615</Data>
<Data>832170f2</Data>
<Data>e06d7363</Data>
<Data>0011fd62</Data>
<Data>1784</Data>
<Data>01d544c0ac6335b4</Data>
<Data>F:\GOG Games\Star Wars - X-Wing Alliance\XWingAlliance.exe</Data>
<Data>C:\WINDOWS\System32\KERNELBASE.dll</Data>
<Data>a05eef43-df41-4275-88fe-ea9fea389845</Data>
<Data />
<Data />
</EventData>
</Event>
Sincerely, Rogue518
'Stay in Attack formation!' Darth Vader aka: Anakin Skywalker During the 'Battle Of Yavin'