Mission Tie Hook / Stats Profiles

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

Moderator: JeremyaFr

Re: Mission Tie Hook

User avatar
Mark_Farlander
Rebel Alliance
Posts: 580
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Thu May 14, 2020 9:09 am

@Phoenix Leader
There is a thing you did not consider: when you change the sequence of the Flight Groups in a skirmish mission, you automatically also change the Start 1 point of each FG involved.
Skirmishes are not like missions: the starting position of each craft is calculated taking into account the "Starting distance" setting and the sequence of the Flight Groups.
I don't judge tactics. The Battle is the best and only Judge.

User avatar
Mark_Farlander
Rebel Alliance
Posts: 580
Joined: Tue Jan 16, 2018 10:47 pm

Post by Mark_Farlander » Thu May 14, 2020 9:17 am

However, the Starting distance can be increased or decreased to counterbalance the effect while taking into account that fighters are much faster than capital ships.
Each skirmish must be evaluated for the "collateral effects" when changing the sequence of the Flight Groups.
I don't judge tactics. The Battle is the best and only Judge.

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Fri May 15, 2020 2:10 am

I have a question for the author of the Mission Tie Hook (Jeremy): would it be possible to have a version of this hook allowing for Global Unit replacement on a per flight group basis?
This would allow to have squadron numbers for all fighter flight groups, not just for player's flight group.

The downside of editing the "Temp.txt" file to assign each flight group to a distinct Global Unit (and not GU=0) would be that you also have squadron numbers for capital ships.
I mean ISDII Corrupter 1, L/CRS Liberty 1 and so on.
The solution would be to make an exclusion for craft categories restricted to have # Craft Per Wave: 1 and Number of Waves: 1 (starships and stations).

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Fri May 15, 2020 2:24 am

I realize that "excluding" 2 craft categories from part of the hook functionalities might be tricky, so I do not demand for it.
I would be more than pleased if "To replace the flight group global unit" were available with the next version of this hook.

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

Post by JeremyaFr » Sat Aug 08, 2020 7:16 pm

WIP

Hello,
Here is a WIP version of the mission tie hook.

I've fixed a crash that happens in the Pilot Proving Ground when the HangarMap contains more than 30 objects.

EDIT: link removed

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

Post by JeremyaFr » Thu Aug 13, 2020 8:26 am

UPDATE

Hello,
I've merged the changes from the WP version into the stable version.

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

Post by JeremyaFr » Mon Nov 02, 2020 8:34 pm

UPDATE

Hello,
I've updated the mission tie hook.

I've fixed a bug with the music in the game where a mission starts with wait state instead of intro state.

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

Post by JeremyaFr » Sat Mar 20, 2021 1:31 pm

UPDATE

Hello,
I've updated the mission tie hook.

This hook now contains a new feature: Stats Profiles
Stats Profiles permit to define different profiles to customize the characteristics of a craft. Then you can use these profiles on a per mission basis.

Suppose that the craft is "FlightModels\[Model].opt".
To create a stats profile named "Profile1", create a file named "FlightModels\[Model]StatsProfile_Profile1.txt" or create a section named "StatsProfile_Profile1" in "FlightModels\[Model].ini".
The format is
Speed = integer
Acceleration = integer
SpeedIncrement = integer
Deceleration = integer
SpeedDecrement = integer
Pitch = integer
Roll = integer
Yaw = integer
ExplosionStrength = integer
HullStrength = integer
SystemStrength = integer
ShieldStrength = integer
HasShieldGenerator = integer
HasHyperdrive = integer

Suppose that the mission is "[MissionDir]\[Mission].tie".
To define a stats profile for a craft, create a file named "[MissionDir]\[Mission]_StatsProfiles.txt" or create a section named "[StatsProfiles]" in "[MissionDir]\[Mission].ini".
The format is
CraftOptName_fgc_# = ProfileName
PlayerSpeedPercent = integer
PlayerAccelerationPercent = integer
PlayerDecelerationPercent = integer
PlayerPitchPercent = integer
PlayerRollPercent = integer
PlayerYawPercent = integer
PlayerExplosionStrengthPercent = integer
PlayerHullStrengthPercent = integer
PlayerSystemStrengthPercent = integer
PlayerShieldStrengthPercent = integer
# in CraftOptName_fgc_# is an integer for the opt color marking index, starting at 0.
To define a profile for the player craft, set "CraftOptName_fg_player = ProfileName".
The default ProfileName is "Default".

The raw values are calculated as follow:

stats.Speed = (int)(stats.Speed * 2.25f + 0.5f);
stats.Acceleration = (int)(stats.Acceleration * 2.25f + 0.5f);
stats.Deceleration = (int)(stats.Deceleration * 2.25f + 0.5f);
stats.Pitch = stats.Pitch * 256;
stats.Roll = stats.Roll * 256;
stats.Yaw = stats.Yaw * 256;
stats.ExplosionStrength = stats.ExplosionStrength * 105;
stats.HullStrength = stats.HullStrength * 105;
stats.ShieldStrength = stats.ShieldStrength * 50;

if( ShipCategory == ShipCategory_Starship || ShipCategory == ShipCategory_Platform )
{
HullStrength /= 16;
ShieldStrength /= 16;
ExplosionStrength /= 16
}

if( ShipCategory == ShipCategory_Freighter || ShipCategory == ShipCategory_Container )
{
HullStrength /= 4;
ShieldStrength /= 4;
ExplosionStrength /= 4
}

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Mar 21, 2021 11:55 pm

I will elaborate a little on Jeremys previous post. Stats Profiles is something we've been testing and refining for a while and finally the bugs have been worked out.
There will be a proper tutorial posted on the main pages once Update 2 is out but here's a little more explanation into how it works.

Stats Profiles: This mode allows you to give a ship different Statistics or performance in a mission without affecting the default ship.
For example you can set up a TIE Fighter to have added Shields or Hyperdrive, or decreased hull strength, speed and handling.
This is all controlled from the StatsProfiles section in the Opts INI file. You don’t need run an editor to change the ship stats first.
You can choose from the different Craft performance modes that have been made available by the creator in their relevant INI file.
You can also use MXvTED for reference to create new performance models to characterize your vehicle.

Mxvted.jpg
Yaw.jpg
Here's a guide to which numbers in MXvTED refer to the sections needed in the INI file.
1: Speed = 100
2: Acceleration = 16
3: Deceleration = 27
4: Roll = 36
5: Pitch = 20
6: Yaw = 40
7: HasShieldGenerator = 1....0 = No. 1 = Yes
8: HasHyperdrive = 1......... 0 = No. 1 = Yes
9: ShieldStrength = 50
10: HullStrength = 20
11: SystemStrength = 10
12: ExplosionStrength = 7

I've updated many model INI files from Updates 1 and 2 to include a "Default" profile listing.
This means you can easily see the original Stats without opening MXvTED.
There's a lot of models in the game but we will update more INI files with default templates as we go.

I hope that gives a little more explanation into the new feature but there will be a tutorial posted in the near future.
You do not have the required permissions to view the files attached to this post.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by JeremyaFr » Fri May 28, 2021 2:04 pm

UPDATE

Hello,
I've updated the mission tie hook.

I've added percents for stats for all crafts.

Code: Select all

SpeedPercent = integer
AccelerationPercent = integer
DecelerationPercent = integer
PitchPercent = integer
RollPercent = integer
YawPercent = integer
ExplosionStrengthPercent = integer
HullStrengthPercent = integer
SystemStrengthPercent = integer
ShieldStrengthPercent = integer
*Percent applies to all crafts.

You can define them in the misson ini or in the global default.ini:
create a file named "FlightModels\StatsProfiles.txt" or create a section named "[StatsProfiles]" in "FlightModels\default.ini".

User avatar
Haakan
Cadet 2nd Class
Posts: 81
Joined: Sun Jul 14, 2019 1:36 am

Post by Haakan » Wed Jul 07, 2021 1:31 pm

JeremyaFr wrote:
Fri May 28, 2021 2:04 pm
UPDATE

Hello,
I've updated the mission tie hook.

I've added percents for stats for all crafts.

Code: Select all

SpeedPercent = integer
AccelerationPercent = integer
DecelerationPercent = integer
PitchPercent = integer
RollPercent = integer
YawPercent = integer
ExplosionStrengthPercent = integer
HullStrengthPercent = integer
SystemStrengthPercent = integer
ShieldStrengthPercent = integer
*Percent applies to all crafts.

You can define them in the misson ini or in the global default.ini:
create a file named "FlightModels\StatsProfiles.txt" or create a section named "[StatsProfiles]" in "FlightModels\default.ini".
Is it feasible to allow for defining craft name and ID ?
Lt. Colonel A. Araujo
Commander, 7th SpecOps Squadron "Alpha"
Battlegroup I
Emperor's Hammer.

CMDR/LC Alejandro Araujo/Alpha/Wing I/ISDII Hammer/BGI

User avatar
capitanguinea
Galactic Empire
Posts: 226
Joined: Sun Aug 30, 2015 3:59 pm

Post by capitanguinea » Wed Jul 07, 2021 7:58 pm

How this would work in multiplayer enviroment? If in pvp two use xwings and one has an edited profile the mission would load the changes for one, both, noone or simply would it crash?

User avatar
Haakan
Cadet 2nd Class
Posts: 81
Joined: Sun Jul 14, 2019 1:36 am

Post by Haakan » Sat Jul 10, 2021 4:04 am

capitanguinea wrote:
Wed Jul 07, 2021 7:58 pm
How this would work in multiplayer enviroment? If in pvp two use xwings and one has an edited profile the mission would load the changes for one, both, noone or simply would it crash?
If it is a coop mission, both would have the info on profiles for each FG. But if you edited on your own the profile...I don't know, it might desynch.
Lt. Colonel A. Araujo
Commander, 7th SpecOps Squadron "Alpha"
Battlegroup I
Emperor's Hammer.

CMDR/LC Alejandro Araujo/Alpha/Wing I/ISDII Hammer/BGI

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Tue Jul 13, 2021 4:58 am

I would tend to agree with Mr Araujo, my experience with multiplayer days in XWA informs me that any kind of differences between players negatively impacts the netcode performance.

If you are suggesting that there are two FGs of X-Wings and both players have the same profiles on their system, but each FG uses a different FG based on those profiles, then theoretically being 1:1 identical files on each system the game should not desync. If one computer does not have 1:1 identical profile, but has an unaltered one vs a player with a modified one, at worst the game will hard crash, and at best will likely desync and you will suffer poor performance.

If you are playing multiplayer, all game files must be 1:1 the same in regards to EXE stats for things featured in the skirmish/mission, and all text files related to every opt utilized in the mission, ranging from almost all text files, especially strings.txt (with the exception of the flyable/gunnerflyable/nonflyable portions of the shiplist), all must be 100% identical or the game will suffer massive desync, and in some cases (missing opt on one player side for example) the game will hard crash to desktop.

I had this documented somewhere, but I believe my old clan site is down and I don't think I have any backups to share. We used XWAU/UCP heavily back in the day and mitigated all desync issues via much trial and error. 1:1 game installations among players removes virtually all desync issues.

Strings.txt is actually one of the worst offenders, even changing the pilot rank names desyncs the game in multiplayer. So one player using the default XWA concourse and another playing with Imperial Concourse is enough to desync the game, even with otherwise 1:1 install.

Hooks and object profiles and stats are entirely new tech and I haven't personally had the opportunity, or made the opportunity to test the multiplayer features in relation to these functions so much research needs to be done, and while many things passively "just work" behind the scenes, certain things I'm sure do and will break the game in multiplayer either period, or if things aren't tested and configured properly on both ends of the players systems.

If you play with a regular group it should be no issue to create an XWA install and share the folder and contents with your group, or at least the mod install settings, to entirely mitigate any user created conflicts by ensuring that every game install 1:1 matches every other install among group members. If you're doing pickup games then the parties involved need to coordinate game settings and get a standard of mod to use to avoid issues; otherwise stick to vanilla or default XWAU install settings to avoid conflicts.

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

Post by JeremyaFr » Sat Jun 04, 2022 10:40 am

UPDATE

Hello,
I've updated the mission tie hook.

I've added settings to disable player shoot on a per-mission basis.

To disable player laser shoot, set "DisablePlayerLaserShoot = 1". The default value is 0.
To disable player warhead shoot, set "DisablePlayerWarheadShoot = 1". The default value is 0.

You can disable laser shoot, disable warhead shoot, disable both laser shoot and warhead shoot, or keep both enabled.

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

Post by JeremyaFr » Sat Jun 04, 2022 12:40 pm

Other settings included in the update are IsRedAlertEnabled, SkipHyperspacedMessages, ForcePlayerInTurret, ForcePlayerInTurretHours, ForcePlayerInTurretMinutes and ForcePlayerInTurretSeconds.

To define the red alert in hangar, set "IsRedAlertEnabled = 1". The default setting enables IsRedAlertEnabled for mission id 20.
To skip hyperspaced messages, "set SkipHyperspacedMessages = 1". The default setting enables SkipHyperspacedMessages for mission id 49.
To force the player in turret, set "ForcePlayerInTurret = 1". The default setting enables ForcePlayerInTurret for mission id 1.
To set the force turret time, set the ForcePlayerInTurretHours, ForcePlayerInTurretMinutes and ForcePlayerInTurretSeconds settings. The default values are 0, 0, 8.

With these new options, you can edit the behavior of the game where the exe uses hardcoded mission indices.

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

Post by JeremyaFr » Thu Jun 16, 2022 8:04 pm

UPDATE

Hello,
I've updated the mission tie hook.

I've fixed a bug with the red alert in hangar.

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

Post by JeremyaFr » Sun Sep 18, 2022 8:08 am

UPDATE

Hello,
I've updated the mission tie hook.

I've added a IsWarheadCollisionDamagesEnabled setting to enable or disable the warhead collision damages.

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

Post by JeremyaFr » Tue Oct 04, 2022 6:03 pm

UPDATE

Hello,
I've updated the mission tie hook.

You can now define the crafts strings on a per-mission basis.

To replace the craft name in shiplist.txt, the format is: "craft", craft index, "name", value.
To replace the craft spec name in strings.txt, the format is: "craft", craft index, "specname", value.
To replace the craft plural name in strings.txt, the format is: "craft", craft index, "pluralname", value.
To replace the craft short name in strings.txt, the format is: "craft", craft index, "shortname", value.

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

Post by JeremyaFr » Mon Nov 07, 2022 7:19 pm

UPDATE

Hello,
I've updated the mission tie hook.

Now you can overwrite the tour of duty strings.

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

Post by JeremyaFr » Thu Jan 12, 2023 7:14 pm

UPDATE

Hello,
I've updated the mission tie hook.

Now when the SkipHyperspacedMessages setting is set it will skip not only the entering hyperspace message but also the entering area message.

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

Post by JeremyaFr » Sat Feb 25, 2023 7:40 pm

UPDATE

Hello,
I've updated the mission tie hook.

I've added a SkipObjectsMessagesIff setting.

To skip hyperspaced messages, set "SkipHyperspacedMessages = 1". The default setting enables SkipHyperspacedMessages for mission id 49.
To skip objects messages based on iff, set "SkipObjectsMessagesIff = value". When value is -1 no message is skip. When value is 255 all messages are skiped. In other cases the value is the IFF. The default value is 1 for mission id 49, 50, 51, 52.

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

Post by JeremyaFr » Mon Feb 05, 2024 7:18 pm

UPDATE

Hello,
I've updated the mission tie hook.

I've added per-difficulty profiles.

Code: Select all

Suppose that the craft is "FlightModels\[Model].opt".
To create a stats profile named "Profile1", create a file named "FlightModels\[Model]StatsProfile_Profile1.txt" or create a section named "StatsProfile_Profile1" in "FlightModels\[Model].ini".
To define a profile for the player, append _Player after the profile name. For example: StatsProfile_Profile1_Player.
To define a profile based on the difficulty, append _Easy, _Medium, or _Hard after the profile name. For example: StatsProfile_Profile1_Easy.
To define a profile for the player based on the difficulty, append the player key and the difficulty key. For example: StatsProfile_Profile1_Player_Easy.

Voyager
Cadet 3rd Class
Posts: 38
Joined: Sun May 13, 2007 11:01 pm

Post by Voyager » Mon Feb 12, 2024 1:08 am

So, I have successfully immediately broken XwC.

The XwC v5.0 was built on the XWAU2020update_v4.0, so I believe is has an early 2021 version of the hooks. Relaying it in over the 6.0.2, I get an error:

xwa_hook_main (DInput.dll)
"To call the hook that sets the battles and missions images count" is not correctly initialized.

I'm thinking something has probably changed since May 2021 in the way the hooks check for mission images, mission data, or total mission count, bit I don't seem to be finding it yet. Probably something that's obvious in retrospect.

Thank you,

Harry Voyager

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

Post by JeremyaFr » Mon Feb 12, 2024 12:41 pm

Hello,
The error means that there is a conflict between a hook and a patch appied to the xwa exe.

The concourse hook contains this patch:

Code: Select all

static const HookPatchItem g_battlesMissionsImagesPatch[] =
{
	{ 0x15D16D, "6A35", "6A7F" },
	{ 0x15D183, "6A35", "6A7F" },
	{ 0x15D19C, "6A08", "6A40" },
};
In the xwa exe from XwC v5.0, there is a patch applied to the exe at the same offsets but with different values. This is why an error is shown.
To fix it you can revert the patch to its original values and let the hook patching the exe.

Post Reply