Page 2 of 3

Re: Mission Tie Hook

Posted: Sat Aug 08, 2020 7:16 pm
by JeremyaFr
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

Re: Mission Tie Hook

Posted: Thu Aug 13, 2020 8:26 am
by JeremyaFr
UPDATE

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

Re: Mission Tie Hook

Posted: Mon Nov 02, 2020 8:34 pm
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Sat Mar 20, 2021 1:31 pm
by JeremyaFr
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
}

Re: Mission Tie Hook / Stats Profiles

Posted: Sun Mar 21, 2021 11:55 pm
by Ace Antilles
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Fri May 28, 2021 2:04 pm
by JeremyaFr
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".

Re: Mission Tie Hook / Stats Profiles

Posted: Wed Jul 07, 2021 1:31 pm
by Haakan
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 ?

Re: Mission Tie Hook / Stats Profiles

Posted: Wed Jul 07, 2021 7:58 pm
by capitanguinea
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?

Re: Mission Tie Hook / Stats Profiles

Posted: Sat Jul 10, 2021 4:04 am
by Haakan
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Tue Jul 13, 2021 4:58 am
by Driftwood
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Sat Jun 04, 2022 10:40 am
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Sat Jun 04, 2022 12:40 pm
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Thu Jun 16, 2022 8:04 pm
by JeremyaFr
UPDATE

Hello,
I've updated the mission tie hook.

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

Re: Mission Tie Hook / Stats Profiles

Posted: Sun Sep 18, 2022 8:08 am
by JeremyaFr
UPDATE

Hello,
I've updated the mission tie hook.

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

Re: Mission Tie Hook / Stats Profiles

Posted: Tue Oct 04, 2022 6:03 pm
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Mon Nov 07, 2022 7:19 pm
by JeremyaFr
UPDATE

Hello,
I've updated the mission tie hook.

Now you can overwrite the tour of duty strings.

Re: Mission Tie Hook / Stats Profiles

Posted: Thu Jan 12, 2023 7:14 pm
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Sat Feb 25, 2023 7:40 pm
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Mon Feb 05, 2024 7:18 pm
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Mon Feb 12, 2024 1:08 am
by Voyager
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

Re: Mission Tie Hook / Stats Profiles

Posted: Mon Feb 12, 2024 12:41 pm
by JeremyaFr
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.

Re: Mission Tie Hook / Stats Profiles

Posted: Mon Feb 12, 2024 4:41 pm
by Voyager
Thank you. I got past that initial one, but running into new issues. I'll create a thread on the Help channel sometime tonight to figure out and work through how to get XwC working with 6.0.2 with the fire rate hooks installed. The objective will be to have a list of steps for at least one current XWAU version.

Going to be going on travel most of this week, but should be able to do most of the experimenting on my laptop.

Thank you,

Harry Voyager

Re: Mission Tie Hook / Stats Profiles

Posted: Thu Mar 14, 2024 7:01 pm
by JeremyaFr
UPDATE

Hello,
I've updated the mission tie hook.

I've added a CanShootThroughtShieldOnHardDifficulty setting.

To define if the ships can shoot throught the shield on hard difficulty, set "CanShootThroughtShieldOnHardDifficulty = 0". The default value is 0. It is 1 for the mission 50 (Death Star Phase 2).