32-bit mode hook

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

Re: 32-bit mode hook

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Sat Jul 20, 2019 7:47 pm

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.
Image Image Image Image Image

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jul 20, 2019 7:55 pm

Bman wrote:
Sat Jul 20, 2019 7:41 pm
DS, does any adjustments via the game's video menu settings help with shadowing? I'm going to test with ReShade to see if there is any improvement with the models.
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 :)
ual002 wrote:
Sat Jul 20, 2019 7:47 pm
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.
I think the only thing you can do is to use the Craft No. in MXvTED at least most people should be familiar with it :)
“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

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Jul 20, 2019 8: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.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jul 20, 2019 8:30 pm

Image :D :D
“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

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jul 20, 2019 9:01 pm

UPDATE

Is this better?
xwa_hook_32bpp_7_family.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jul 20, 2019 9:07 pm

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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jul 20, 2019 9:18 pm

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 ;)
“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

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Jul 20, 2019 10:39 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.

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Sat Jul 20, 2019 11:57 pm

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.
Image Image Image Image Image

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Jul 21, 2019 6:17 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?

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jul 21, 2019 10:40 am

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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sun Jul 21, 2019 10:53 am

Q. Question, Do you still need the 4444 patch applied?

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

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jul 21, 2019 11:29 am

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.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jul 21, 2019 11:32 am

DarHan wrote:
Sat Jul 20, 2019 4:11 pm
I just wanted to report, the departure hangar looks great with that latest version, but the “mission failed” hangar seems to still have the problem where texture illumination is inverted.
Can you redownload the hook and retry?
If the problem persists, please attach a screenshot.

User avatar
DarHan
Rebel Alliance
Posts: 325
Joined: Mon Dec 05, 2005 12:01 am
Contact:

Post by DarHan » Sun Jul 21, 2019 2:00 pm

Sorry, I forgot to report. The version you uploaded last night solved that issue.
“Red Four, nothing’s gone wrong yet.”
— Hobbie Klivian

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jul 21, 2019 3:11 pm

:)

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Jul 21, 2019 6:36 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.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Jul 22, 2019 6:54 pm

I have to update the library (JeremyAnsel.Xwa.Opt) and the editor (XwaOptEditor) to support illumination for 32-bit textures.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Wed Jul 24, 2019 10:40 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

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Jul 25, 2019 3:38 pm

It was the ambiant color and the diffuse color not reacting with the vertex normals.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Jul 25, 2019 5:33 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

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Jul 25, 2019 8:16 pm

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.

User avatar
rogue518
XWAU Member
Posts: 2856
Joined: Wed Jul 12, 2000 11:01 pm
Contact:

Post by rogue518 » Fri Jul 26, 2019 1:00 am

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
'Stay in Attack formation!' Darth Vader aka: Anakin Skywalker During the 'Battle Of Yavin'

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Jul 26, 2019 2:30 pm

Can you attach a crash report from the Event Viewer please?

User avatar
rogue518
XWAU Member
Posts: 2856
Joined: Wed Jul 12, 2000 11:01 pm
Contact:

Post by rogue518 » Sat Jul 27, 2019 9:38 pm

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:

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>
I hope this helps... I hope this is what you are looking for.....

Sincerely, Rogue518
'Stay in Attack formation!' Darth Vader aka: Anakin Skywalker During the 'Battle Of Yavin'

Post Reply