Craft limit, Starship limit, Starfighter limit, Object limit
Re: Craft limit, Starship limit, Starfighter limit, Object limit
- AngeI
- Posts: 528
- Joined: Sun Jan 24, 2016 5:27 pm
Thanks for the answer! I had wanted to at least increase the amount of possible lasers from 256 to 512, but this blows it wide open. So I could have 192 flight groups AND 128 asteroids? But Asteroids are also classed as a flight group are the not?
-
- Posts: 34
- Joined: Tue Oct 13, 2020 12:14 am
FlightGroups are a separate thing from spawned objects, tied more closely to mission logic. When a FG is spawned into the mission, it depends on what kind of object it is. So a craft FG will spawn into the Craft section, counting towards the vanilla limit of 96 craft per region. Meanwhile an asteroid FG will spawn into the Space Object section, counting toward the 128 Space Object limit. But yes, they're both FlightGroups and both count toward the 192 FG limit in the mission file.
I can look into increasing the Space Object count for more asteroids. It didn't work very well when I tried it in XvT, causing some visual artifacts. But it's worth a try in XWA.
I can look into increasing the Space Object count for more asteroids. It didn't work very well when I tried it in XvT, causing some visual artifacts. But it's worth a try in XWA.
- AngeI
- Posts: 528
- Joined: Sun Jan 24, 2016 5:27 pm
Awesome, thanks for the explanation
Certainly separating out things like asteroids could be useful in populating a mission with a wider area of asteroids instead of travelling a few km out to be clear of it.
![lachen :)](./images/smilies/icon_smile.gif)
-
- Posts: 34
- Joined: Tue Oct 13, 2020 12:14 am
To increase the number of Space Objects, originally 128 per region, to something like 256:
7 is 128 objects, 8 is 256, 9 is 512, etc. Adjust however you want. Since they're not commonly used it may not be necessary to go super high. When the game is performing frame updates, it has to loop over the entire allocated section, whether there's something there or not. That applies to craft and projectiles as well. So if performance is a concern, it's something to keep in mind.
As far as I can tell it's working without any problems. Although having lots of asteroids on screen, besides adding to visual clutter, does contribute to rendering slow-down. More stuff to test.
For mines, they spawn in a grid. So if you assign a mine FG with 8 craft per wave, they spawn an 8x8 grid for 64 total.
For asteroids, they randomly spawn around their starting waypoint. If you assign an asteroid FG with 8 craft per wave, it randomly generates 8 asteroids of varying size and distance.
Code: Select all
At offset 14CD3, replace C1E007 with C1E008
As far as I can tell it's working without any problems. Although having lots of asteroids on screen, besides adding to visual clutter, does contribute to rendering slow-down. More stuff to test.
For mines, they spawn in a grid. So if you assign a mine FG with 8 craft per wave, they spawn an 8x8 grid for 64 total.
For asteroids, they randomly spawn around their starting waypoint. If you assign an asteroid FG with 8 craft per wave, it randomly generates 8 asteroids of varying size and distance.
- AngeI
- Posts: 528
- Joined: Sun Jan 24, 2016 5:27 pm
Thanks mate. I noticed mines actual spawn numbers depend on the difficulty level you set. Lets just assume a single mine, then easy would only spawn the 1 mine, medium spawns 2, hard spawns 3. Also if I simply wanted to increase projectiles to 512 instead of something stupidly high, what would be the offset for that? Is that the same as above or a different code?
-
- Posts: 34
- Joined: Tue Oct 13, 2020 12:14 am
Difficulty shouldn't matter for mines.
For projectiles, same place, different value. This gives you 512 projectiles.
For projectiles, same place, different value. This gives you 512 projectiles.
Code: Select all
At offset 14C68, replace 750BBA1000 with B800020000
At offset 14C6D, replace 0000 with EB0A
- AngeI
- Posts: 528
- Joined: Sun Jan 24, 2016 5:27 pm
It shouldn't but it does for some reason
![big grin :D](./images/smilies/icon_biggrin.gif)
Awesome, thank you!Random Starfighter wrote: ↑Sat Oct 17, 2020 9:17 pm
For projectiles, same place, different value. This gives you 512 projectiles
Code: Select all
At offset 14C68, replace 750BBA1000 with B800020000 At offset 14C6D, replace 0000 with EB0A
![lachen :)](./images/smilies/icon_smile.gif)
- Trevor
- Posts: 541
- Joined: Thu Dec 04, 2014 7:11 pm
This is just friken awesome.... ![lachen :)](./images/smilies/icon_smile.gif)
So, unfortunately being arrays, while logical, doesn't seem to lend itself to any enhancement (tied to single thread cpu).
then again... maybe a hook could take every second entry and process it on a second cpu leaving only half the number for the original game to process.
Trev
![lachen :)](./images/smilies/icon_smile.gif)
So, unfortunately being arrays, while logical, doesn't seem to lend itself to any enhancement (tied to single thread cpu).
then again... maybe a hook could take every second entry and process it on a second cpu leaving only half the number for the original game to process.
Trev
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Great! So having more than 6 wingmen per FG for AI FG's would be a great example of using the xwa_hook_mission_tie hook to assign FG texture maps. Asteroid fields would need LOD meshes for performance for sure.
.
Random, have a related question. 1) I know how to make Asteroids targetable in the CMD screen and destroyable by just changing a couple of offsets, the latter to that of a mine type object. The problem is their formation then becomes like a grid similar to the mines and if they take one laser hit, poof! Do you know to properly make them targetable and break up into pieces like a starship, station, and other "normal" object attributes ?
.
2) When enabling RotartyGunTurret meshes on starships, we know right now there is a limit of 16 RotaryGunTurret meshes with a maximum of 2 laser hardpoints per mesh, for any .opt model. Do you have any ideas on how to increase the possible number RotaryGunTurret meshes? Most starship models here have never utilized that feature, but the trade off is we get more laser hardpoints that are mirrored on both sides of a starship, up to 128 or something like that, instead of just 32. But they fire from the hull meshes or static turret meshes. Not as realistic.
.
3) Holy grail question everyone has asked for years... just looking in the Strings.txt file, I believe their is a limit of around 223 fixed craft slots, each with their own unique stats, some categorized by type such as starfighters, freighters, starships, stations, etc. Any clever ideas on how to expand on that to make an unlimited database of unique slots that could be dynamically added to and used for any given mission file? I would assume no, but just asking. Thanks![lachen :-)](./images/smilies/icon_smile.gif)
.
Random, have a related question. 1) I know how to make Asteroids targetable in the CMD screen and destroyable by just changing a couple of offsets, the latter to that of a mine type object. The problem is their formation then becomes like a grid similar to the mines and if they take one laser hit, poof! Do you know to properly make them targetable and break up into pieces like a starship, station, and other "normal" object attributes ?
.
2) When enabling RotartyGunTurret meshes on starships, we know right now there is a limit of 16 RotaryGunTurret meshes with a maximum of 2 laser hardpoints per mesh, for any .opt model. Do you have any ideas on how to increase the possible number RotaryGunTurret meshes? Most starship models here have never utilized that feature, but the trade off is we get more laser hardpoints that are mirrored on both sides of a starship, up to 128 or something like that, instead of just 32. But they fire from the hull meshes or static turret meshes. Not as realistic.
.
3) Holy grail question everyone has asked for years... just looking in the Strings.txt file, I believe their is a limit of around 223 fixed craft slots, each with their own unique stats, some categorized by type such as starfighters, freighters, starships, stations, etc. Any clever ideas on how to expand on that to make an unlimited database of unique slots that could be dynamically added to and used for any given mission file? I would assume no, but just asking. Thanks
![lachen :-)](./images/smilies/icon_smile.gif)
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
-
- Posts: 34
- Joined: Tue Oct 13, 2020 12:14 am
I'm speaking from XvT experience here, but basic objects don't have hitpoints, so I'm not sure if there's any way around "one hit kill" without making them spawn in as a craft. If that could be accomplished, it might be possible to have fancier explosions too. But that would be a much more complex patch. I can make asteroids to be merely destructible like mines in XvT, but I don't know where to look in XWA.
No idea about the turrets. I wouldn't know where to begin, either. All I know is there's a limit of 50 mesh components and what looks like 16 active turrets. XvT was the same way.
Yes, the holy grail. These are all fixed-length arrays embedded into the game executable. Resizing or moving them would be a monumental task. The best idea I can think of would be to hook into the mission loading functions and hot-swap entire elements of the array with something else. Kind of like how the hangar hooks can do different things for each mission.
I'm really not very familiar with XWA's coding. Sorry this is all outside of my area of expertise...
No idea about the turrets. I wouldn't know where to begin, either. All I know is there's a limit of 50 mesh components and what looks like 16 active turrets. XvT was the same way.
Yes, the holy grail. These are all fixed-length arrays embedded into the game executable. Resizing or moving them would be a monumental task. The best idea I can think of would be to hook into the mission loading functions and hot-swap entire elements of the array with something else. Kind of like how the hangar hooks can do different things for each mission.
I'm really not very familiar with XWA's coding. Sorry this is all outside of my area of expertise...
- AngeI
- Posts: 528
- Joined: Sun Jan 24, 2016 5:27 pm
Is this what the hooks actually do? Replace entire sets of code by calling them instead of the base code? I'm not a coder, best I can do is manipulate it when I understand what some things doRandom Starfighter wrote: ↑Sun Oct 18, 2020 6:35 pm
Yes, the holy grail. These are all fixed-length arrays embedded into the game executable. Resizing or moving them would be a monumental task. The best idea I can think of would be to hook into the mission loading functions and hot-swap entire elements of the array with something else. Kind of like how the hangar hooks can do different things for each mission.
![big grin :D](./images/smilies/icon_biggrin.gif)
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Hooks replace game code with new code, generally at the function level (that is, they replace original-game subroutines with new versions). That's why they're .dlls. As such, they can do very nearly anything; the trick is understanding the engine enough to know how to do what you want to do.
I've long thought that while circumventing the craft slot limit outright may be too complex a change to effect, Random's proposal may be tenable. A hook that runs during mission initialization should be able to rewrite the in-memory craft table using a mission-specific craft list, taking craft stats from individual craft text files (probably xml for this kind of data). In addition to that, the info loaded dynamically from the various files (strings.txt, .dat files for ship icons, etc.) would all have to be located and similarly reloaded from craft-specific files. Then there would be various side effects on areas of the game outside the flight engine to address - player stats, the tech room, multiplayer synchronization, maybe others.
By the way, thanks for dropping in, Random! Exciting stuff.
I've long thought that while circumventing the craft slot limit outright may be too complex a change to effect, Random's proposal may be tenable. A hook that runs during mission initialization should be able to rewrite the in-memory craft table using a mission-specific craft list, taking craft stats from individual craft text files (probably xml for this kind of data). In addition to that, the info loaded dynamically from the various files (strings.txt, .dat files for ship icons, etc.) would all have to be located and similarly reloaded from craft-specific files. Then there would be various side effects on areas of the game outside the flight engine to address - player stats, the tech room, multiplayer synchronization, maybe others.
By the way, thanks for dropping in, Random! Exciting stuff.
- AngeI
- Posts: 528
- Joined: Sun Jan 24, 2016 5:27 pm
So in theory, if someone had the knowledge, time and patience, they could rewrite the imuse code or at least make it... better? Perhaps even support higher quality sound like mp3s ![big grin :D](./images/smilies/icon_biggrin.gif)
![big grin :D](./images/smilies/icon_biggrin.gif)
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Kieran, that's pretty much what I'm aluding to. Swapping out the strings.txt file with another one temporarily on a per mission basis. No need to change slots stats. For example using corvette slot and substituting with a hammerhead corvette. Crafts that can share reasonable and similar stats already defined in original slot. Just keeping it simple.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
I believe that can already be done with the mission objects hook.
- JeremyaFr
- Posts: 3983
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
WIP
Hello,
To make testing more easier, I've included the patch in a hook.
Hello,
To make testing more easier, I've included the patch in a hook.
You do not have the required permissions to view the files attached to this post.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3983
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
WIP
You can now define the crafts count in the config file.
You can now define the crafts count in the config file.
You do not have the required permissions to view the files attached to this post.
- Trevor
- Posts: 541
- Joined: Thu Dec 04, 2014 7:11 pm
Awsome, and yeah, very easy to test numbers now.
Trev
Trev
- JeremyaFr
- Posts: 3983
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
WIP
Hello,
Here is new WIP version of the crafts count hook.
I've fixed a bug with the init code in the hook.
Hello,
Here is new WIP version of the crafts count hook.
I've fixed a bug with the init code in the hook.
You do not have the required permissions to view the files attached to this post.
- AngeI
- Posts: 528
- Joined: Sun Jan 24, 2016 5:27 pm
@JeremyaFr would it be possible for you to publish the source code for this hook? There's a bug with the flight group friendly/enemy list displays when using multi-region missions.
- JeremyaFr
- Posts: 3983
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
I've uploaded the source code for the crafts count hook and for the tourmultiplayer hook.
These hooks are marked as WIP and are not downloaded with XwaHooksSetup.
-
- Posts: 34
- Joined: Tue Oct 13, 2020 12:14 am
Thank you for the source code. I've made some modifications to fix a bug with the friend/enemy craft lists. My original solution to fix a crash was to stop checking craft beyond index 192, but this only allows the craft list to be visible in the first region because the other regions spawn their craft into higher index ranges.
This new modification is a proper fix to the craft list, allowing it to scan all craft instead of the first 192 slots, with additional array bounds checking to prevent overflowing and causing a game crash.
My project files are different but these are my changes:
craftlist.h/craftlist.cpp:
Contains one new hook function for the craft list filter, and its needed structure definitions.
hooks.h
Added two new locations to call hook functions.
Deleted the bad craft list patch, replaced with new patch. This calls the new function and contains bounds checking.
Code: Select all
DELETED:
{ 0x0BFC61, "A1B8A37C00", "B8C0000000" },
{ 0x0C0D63, "A1B8A37C00", "B8C0000000" },
ADDED:
{ 0x0BFC13, "807C3204097447668B443202663DCB00743C663DCC007436663DCD0074308B443223", "57E817830E005985C0744389E825FFFF0000894C84404581FDC00000007440EB2D90" },
{ 0x0C0D15, "807C3204097447668B443202663DCB00743C663DCC007436663DCD0074308B443223", "57E815720E005985C0744389E825FFFF0000894C845C4581FDC00000007440EB2D90" },
I've added documentation for the patch code here, but also in rs_exe_edit.txt
And here's the final DLL.
You do not have the required permissions to view the files attached to this post.
- JeremyaFr
- Posts: 3983
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Hello,
I've updated the crafts count hook.
I've added a fix from RS for the friendly and enemy craft lists.
Hello,
I've updated the crafts count hook.
I've added a fix from RS for the friendly and enemy craft lists.