Page 2 of 5

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 7:47 pm
by ual002
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.

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 7:55 pm
by Darksaber
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 :)

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 8:01 pm
by Bman
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.

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 8:30 pm
by Darksaber
Image :D :D

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 9:01 pm
by JeremyaFr
UPDATE

Is this better?
xwa_hook_32bpp_7_family.jpg

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 9:07 pm
by JeremyaFr
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.

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 9:18 pm
by Darksaber
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 ;)

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 10:39 pm
by Bman
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. :-)

Re: 32-bit mode hook

Posted: Sat Jul 20, 2019 11:57 pm
by ual002
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.

Re: 32-bit mode hook

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

Re: 32-bit mode hook

Posted: Sun Jul 21, 2019 10:40 am
by JeremyaFr
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.

Re: 32-bit mode hook

Posted: Sun Jul 21, 2019 10:53 am
by Darksaber
Q. Question, Do you still need the 4444 patch applied?

I take it now, that the hook applies all the necessary offsets

Re: 32-bit mode hook

Posted: Sun Jul 21, 2019 11:29 am
by JeremyaFr
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.

Re: 32-bit mode hook

Posted: Sun Jul 21, 2019 11:32 am
by JeremyaFr
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.

Re: 32-bit mode hook

Posted: Sun Jul 21, 2019 2:00 pm
by DarHan
Sorry, I forgot to report. The version you uploaded last night solved that issue.

Re: 32-bit mode hook

Posted: Sun Jul 21, 2019 3:11 pm
by JeremyaFr
:)

Re: 32-bit mode hook

Posted: Sun Jul 21, 2019 6:36 pm
by Bman
Confirmed, xwaOptEditor didn't have illumination for native 32-bpp textures.

Re: 32-bit mode hook

Posted: Mon Jul 22, 2019 6:54 pm
by JeremyaFr
I have to update the library (JeremyAnsel.Xwa.Opt) and the editor (XwaOptEditor) to support illumination for 32-bit textures.

Re: 32-bit mode hook

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

Re: 32-bit mode hook

Posted: Thu Jul 25, 2019 3:38 pm
by JeremyaFr
It was the ambiant color and the diffuse color not reacting with the vertex normals.

Re: 32-bit mode hook

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

Re: 32-bit mode hook

Posted: Thu Jul 25, 2019 8:16 pm
by JeremyaFr
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.

Re: 32-bit mode hook

Posted: Fri Jul 26, 2019 1:00 am
by rogue518
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

Re: 32-bit mode hook

Posted: Fri Jul 26, 2019 2:30 pm
by JeremyaFr
Can you attach a crash report from the Event Viewer please?

Re: 32-bit mode hook

Posted: Sat Jul 27, 2019 9:38 pm
by rogue518
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