[OPTing] texture limits
Moderator: JeremyaFr
Re: [OPTing] texture limits
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
An update of Xwa Dat Editor:
modified:
modified:
- replaced nQuant with JeremyAnsel.ColorQuant
- select a color key by clicking on the image
- make transparent a range of colors
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Another limit related to textures is broken.
When there are more than 1624 textures, the game outputs "Not enough D3DTextures" and uses the last created texture.
See Hangar craft textures corrupted
Here is a fix for that: I have replaced 1624 with 10000. This value is editable in a config file.
When there are more than 1624 textures, the game outputs "Not enough D3DTextures" and uses the last created texture.
See Hangar craft textures corrupted
Here is a fix for that: I have replaced 1624 with 10000. This value is editable in a config file.
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Excellent again. Thanks!
To summarize, this means any mission file can have up to 96 unique .opt models used concurrently in a given region regardless of Flight Group size 1 wave x 1 craft type, or maxing out a FG of 1 x 6 (i.e. x-wings) crafts. Waves have no limits. The hangar will no longer display corrupted/misapplied textures.
To summarize, this means any mission file can have up to 96 unique .opt models used concurrently in a given region regardless of Flight Group size 1 wave x 1 craft type, or maxing out a FG of 1 x 6 (i.e. x-wings) crafts. Waves have no limits. The hangar will no longer display corrupted/misapplied textures.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The crafts count of 96 per region (or 36 for melee missions) is hard coded. This value is then used to allocate a dynamic buffer. So it could be editable by modifying a few bytes. Need to be tested.
The limit of 192 flightgroups per mission can't be removed.
The limit of 192 flightgroups per mission can't be removed.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Excellent work again Jeremy, amazes me how you find and know what all these offsets do, clever fello 
The New hook hangar dll system look pretty straight forward

The New hook hangar dll system look pretty straight forward

“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: 50
- Joined: Fri Jan 17, 2014 8:09 pm
Thanks a lot!

While you are at it, please try to increase the max number of simultaneous weapons. Even with the 96 craft limit this gets noticeable when several capships are fighting each other.JeremyaFr wrote:The crafts count of 96 per region (or 36 for melee missions) is hard coded. This value is then used to allocate a dynamic buffer. So it could be editable by modifying a few bytes. Need to be tested.
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Nice catch Rasalas. Yes, I've noticed that too. Also when too many capital ships were engaged, some wouldn't even fire at all until something else was taken out, regardless of what fighter craft FG's are doing. Increasing number turbo cannons, super long range turbo cannons, and short-range turrets (and ion cannon weapons etc.) would be excellent. Some of that depends on W. HP's on opt model being there. BinHexEdit allows some limited modification of editing, (more like the firing rate and number of concurrent cannons) but not to what we all want.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- Vince T
- Posts: 14029
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
Agreed. I've noticed that to quite some extent with my Battle of Coruscant shipset, where a lot of the battling ships weren't actually doing anything except following their flight paths.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The limit of simultaneous weapons is probably defined close to the offset that defines the craft count limit. So it will be editable.
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Hi Jeremy, switching topics to the XwaDatEditor ... can you double check this program when you have some free time? We're pretty sure that when we import a .bmp image to replace an existing image within a .dat file, the editor is either compressing or dumbing down the quality of the image before it's even used by the XWA engine. We've tested with 32-bit, 24-bit, and 8-bit colored .bmp files and setting as type7 or type-24 format with or without Reimar's 32-bit patch for XWA. I maximized my screen with the editor and saw the colors dither downward after importing. Also exporting the imported image is different than the original source file as proof. It's probably not the game engine so this puts hope back into the picture.
Thanks.

W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The image types in dat files are:
When importing an image, the editor will set the type to 24.
In the dll, I added support for a type 25 which is 32-bit. Since this type is not functional in-game (WIP), I disabled it in the editor.
So the imported images are reduced to up to 256 colors (each color being 24-bit). The current algorithm generates up to 128 shades per channel.
- type 7
8-bit indexed colors and 1-bit alpha, rle compressed - type 23
8-bit indexed colors and 8-bit alpha, rle compressed - type 24
8-bit indexed colors and 8-bit alpha
When importing an image, the editor will set the type to 24.
In the dll, I added support for a type 25 which is 32-bit. Since this type is not functional in-game (WIP), I disabled it in the editor.
So the imported images are reduced to up to 256 colors (each color being 24-bit). The current algorithm generates up to 128 shades per channel.
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
Here is a new hook.
The opt vertices count per mesh is limited to 512. When a mesh contains more vertices than this limit, the game may crash when the mesh is hit.
The hook fix this crash. By default, the dll will use a value of 4096.
Download link:
xwa_hook_opt_limit.zip
Here is a new hook.
The opt vertices count per mesh is limited to 512. When a mesh contains more vertices than this limit, the game may crash when the mesh is hit.
The hook fix this crash. By default, the dll will use a value of 4096.
Download link:
xwa_hook_opt_limit.zip
“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
- Driftwood
- Posts: 2173
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
Does this imply that more detailed models are able to be utilized?
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Excellent and Thank you Jeremy!!!!!! 4096 vertices or more, per mesh. Incredible breakthrough.
That leaves flexibility for a lot more detail and less emphasis on texturing detail. Plus that would allow for enough meshes for LOD's (distance) to help take stress off the CPU with high-end models. We can still assume the maximum 50 meshes per .opt model is still in effect. Now I can make the ISD-II Avenger look even more wicked and closer to film model.
That leaves flexibility for a lot more detail and less emphasis on texturing detail. Plus that would allow for enough meshes for LOD's (distance) to help take stress off the CPU with high-end models. We can still assume the maximum 50 meshes per .opt model is still in effect. Now I can make the ISD-II Avenger look even more wicked and closer to film model.

W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Question... traditionally the fighter craft (for example the X-wing) has had a maximum of four different FG colors - Red, Y, B, & G. Since the texture file count-patch allows more images per .opt model, is it possible to hook more FG colors? i.e. expand to 6 or more possible separate FG textures ? Not even sure how AlliED editor would work with that if possible.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
We can already have more than 4 different markings (FG colors). The game engine has no limit for them. So I think the maximum would be 127.
See the the colored rectangles in this image. I've edited the A-Wing to add 6 more markings. But for some reasons, AlliED doesn't work with more than 4 differents markings. I haven't check whether YOGEME can handle them.
We can already have more than 4 different markings (FG colors). The game engine has no limit for them. So I think the maximum would be 127.
See the the colored rectangles in this image. I've edited the A-Wing to add 6 more markings. But for some reasons, AlliED doesn't work with more than 4 differents markings. I haven't check whether YOGEME can handle them.
You do not have the required permissions to view the files attached to this post.
Last edited by JeremyaFr on Thu May 17, 2018 8:39 pm, edited 1 time in total.
- ual002
- Posts: 982
- Joined: Wed Sep 24, 2008 2:23 am
Yogme isnt set up for it but if the hook exists you can throw a ticket into the Yogme github to request support. I support this. I am more likely to start texturing before modeling and have been wondering this myself.





- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Hmm interesting, so until we can change a mission to use more than 4 Flightgroups there's no point changing any opts to add more textures, so it'll have to be put on the backburner 

“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
Yep, if the Yogme editor can be updated that means the X-wing model could now have all six Red Squadron markings plus the generic Xwing FG, each with it's own colors: R,Y,B,G, so theoretically 28 different FG texture maps ( 7 FG markings x 4 colors). Even more...if someone wanted to add burn marks and other fancy texture effects.
Also, the cool thing is all the different droid head meshes could be added concurrently and the trick is they would only have 4 visible and 24 transparent/invisible textures when the other FG textures are in use. The file size would be a little larger but worth it.
Troy Dangerfield's e-mail is no longer valid.
Also, the cool thing is all the different droid head meshes could be added concurrently and the trick is they would only have 4 visible and 24 transparent/invisible textures when the other FG textures are in use. The file size would be a little larger but worth it.

Troy Dangerfield's e-mail is no longer valid.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
As a workaround, you can now set the markings outside the mission tie file by creating a txt file.
See viewtopic.php?p=154246#p154246
As a workaround, you can now set the markings outside the mission tie file by creating a txt file.
See viewtopic.php?p=154246#p154246
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Wonderful Jeremy! Just awesome. That allows more flexibility with limited ship slots. 

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
Question... are there examples of different models attached to seperate flight group colors or does it only affect textures?
I ask because if multiple models and textures can occupy a single slot, then we have the ability to condense specific groupings of like ships into a single slot. ISD I and ISD II occupying the same slot for instance with multiple livery variations of each. VSDs, calamari classes, etc.
Now I am realizing a few limitations... first, an editor that can select beyond the standard 4 FG colors, and second, variations in ship stats, specifically shields and engine speeds... and finally the tech library.
This is mainly a thought exercise but the potential to have the same ship with minor model details and colors is very exciting. For example... a YT1300 model with and without nose cone, with variations of color scheme. Artistic and unique interpretations of smuggler and trader models of YT2000s, 2400s and even murian transports.
I ask because if multiple models and textures can occupy a single slot, then we have the ability to condense specific groupings of like ships into a single slot. ISD I and ISD II occupying the same slot for instance with multiple livery variations of each. VSDs, calamari classes, etc.
Now I am realizing a few limitations... first, an editor that can select beyond the standard 4 FG colors, and second, variations in ship stats, specifically shields and engine speeds... and finally the tech library.
This is mainly a thought exercise but the potential to have the same ship with minor model details and colors is very exciting. For example... a YT1300 model with and without nose cone, with variations of color scheme. Artistic and unique interpretations of smuggler and trader models of YT2000s, 2400s and even murian transports.




