Tour Multiplayer Hook

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

Moderators: Darksaber, General_Trageton, Forceflow, JeremyaFr, DTM

Tour Multiplayer Hook

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Mon Apr 02, 2018 6:30 pm

XWA has always had great singleplayer. But the multiplayer aspect of it was very lacking, especially compared to XvT.

Well not anymore.

Introducing the Tour Multiplayer hook! This hook adds a ton of features and fixes a few bugs in the original game. This hook is considered as the next generation of my multiplayer patch.


Please read the readme for additional details.

Some screenshots of the visual changes:

https://imgur.com/a/2y72M

Changelog:

Code: Select all

2.1
- Fixed a major bug where not all missions were listed on the load screen
- Removed Dinput.dll, tactical officer and wingmen voices hooks (download them seperately)

Code: Select all

2.0a
- Tactical officer hook now included

Code: Select all

2.0

Bugs fixed/Features added:
- Combat and Racing buttons are now seperate and in different positions
- Craft selection has been fixed for both hosts and clients
- Load button on load screen is finally fixed
- Delete button removed from load screen unless its Skirmish
- Setting buttons are realigned properly
- IFF 4/Orange is now orange in the Craft and message lists
- Craft Selection can now be like XvT if the proper options are selected in the mission FG
- New quit message shown if player is to be captured during a mission
- Config now has three seperate options to change combat sim background, music and setting bar
- Hangar in Multiplayer now acts like the hangar in XvT (which is pop in and pop out with a wave loss)
- You can allow the AI to take over your craft with "Shift+M"
- You can now cycle regions if spectating in Multiplayer using shift+M(previous) and M(next) keys
- Server update rate options are now 8, 29 and 59
- Tour briefings in story mode will not use the custom background provided by the hook
- Target box color now changes to the target IFF
- Arrows in battle menus have returned and are fully functional


Features removed:
- Tactical officer code has been removed so that it can be placed in its own hook
- Mission description button removed
1.3

Code: Select all

- Updated patch to work with Steam XWA Vanilla
1.2.1

Code: Select all

- Updated Combat missions to make use of different tactical officers
- Included hook_tourmultiplayer.cfg
- Disabling xvt combat simulator background also restores original music
1.2

Code: Select all

- Tactical Officers 3-7 can now be loaded as well as having different tactical officers between Team 1 and Team 2
- Included XvT Imperial Tactical officers
- Clients on the roster screen will now see the correct FG list
- Fixed bug where the mission list scroll bar would move to the bottom in Skirmish mode
- Added Mission Description button to UI
- Imperial Wingmen voices have been removed from my hook and are now controlled by Jeremy's wingmen voices hook
- Combat Engagements mode now has the correct UI buttons on the roster screen
- Fixed a bug where the wingmen menu would be grayed out if the player had multiple waves
- Fixed bug where Skirmish mode was loaded on the roster after exiting a Tour mission in Multiplayer
Previous changelog notes are in readme.

Link to the download and source: XWA_TourMultiplayer_Hook

EDIT: Make sure you download the latest version of the hangar hook to prevent a startup error! viewtopic.php?p=147470#p147470

Please leave feedback, comments or concerns.
Last edited by Justagai on Wed Aug 07, 2019 2:47 pm, edited 11 times in total.

User avatar
ual002
Ensign
Galactic Empire
Posts: 488
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Mon Apr 02, 2018 7:02 pm

And it works great! For a guy like me always wishing there was a painless way to share the missions I made, this is the way to do it. Congrats sir!

These features are a long time coming, and work amazing.

- Allows waves/craft jumping for players for any gamemode set from mission file
- Allows Imperial wingmen to talk (code from my wingmen patch is implemented with a few fixes, not compatible with JeremyFr's wingmen hook)
- Temporary fix for hangar in multiplayer (will have a better solution later)
Last edited by ual002 on Mon Apr 02, 2018 7:05 pm, edited 2 times in total.
For the glory of his majesty Emperor Palpatine! Image Image Image Image

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1711
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Mon Apr 02, 2018 7:04 pm

Nice!

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10317
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Apr 03, 2018 12:10 am

Could you explain these more please

- S-foils are removed from the Assault Gunboat, Missile Boat and Skipray Blastboat (Compatible with JeremyFr's sfoils hook, sfoils will still work on those ships)
- Allows Imperial wingmen to talk (code from my wingmen patch is implemented with a few fixes, not compatible with JeremyFr's wingmen hook)
- Temporary fix for hangar in multiplayer (will have a better solution later)

Why are the S-Foils removed, this remark seems to contradict it's self, please explain
So is Jeremys wingman hook disabled by your hook, what if both are installed?

On the combat engagement screen, craft selection and difficulty options are both duplicated
“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

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Tue Apr 03, 2018 12:33 am

- S-foils are removed from the Assault Gunboat, Missile Boat and Skipray Blastboat (Compatible with JeremyFr's sfoils hook, sfoils will still work on those ships)
I probably should have said "S-foils fixed" to have less confusion. Basically I've set the listed ships s-foils to the value of "5" to disable them, allowing them to be flown from the hanger/after another wave, otherwise they would be stuck with their s-foils activated with the player being unable to shoot. One can still use s-foils in flight with Jeremy's hook however since I imagine it hooks the s-foils function at the time of use. I've tested this to be the case.
- Allows Imperial wingmen to talk (code from my wingmen patch is implemented with a few fixes, not compatible with JeremyFr's wingmen hook)
Jeremy's wingmen hook is incompatible with my code due to the way he implemented his hook. If both are installed then this may result in certain voices not triggering for example or other off note issues. My code doesn't necessarily "disable" his hook.
- Temporary fix for hangar in multiplayer (will have a better solution later)
As of now, the player will pop in and out of the hangar with no change to armament or craft or waves. The hangar is one of the biggest issues I've dealt with since the start of this project so I worked on other issues in the meantime to continue progress. I didn't want a player however, to enter the hanger and desync the entire game and force the host to quit. So I've placed a stop gap measure in the meantime.
On the combat engagement screen, craft selection and difficulty options are both duplicated
I am aware of the issue and is something that I plan to fix later down the line. It does not cause any crashes that I know of and is a visual bug.

User avatar
ual002
Ensign
Galactic Empire
Posts: 488
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Tue Apr 03, 2018 12:38 am

-I personally was never able to get JeremyaFr's wingman voice hook to function, this was what appears to be an independent continuation of that project. And Justagai's version is functional. Also compatible with my voice acted pilot I uploaded.
For the glory of his majesty Emperor Palpatine! Image Image Image Image

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

Post by Mark_Farlander » Tue Apr 03, 2018 3:54 am

This looks an awesome upgrade!

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10317
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Apr 03, 2018 1:20 pm

One more thing, do we have to have the XVT wallpaper? Can't you create a *.cfg file to enable or disable it please

Thank you
“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

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

Post by Mark_Farlander » Tue Apr 03, 2018 2:09 pm

Allowing the player to choose the wallpaper would be even more awesome.

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Tue Apr 03, 2018 10:00 pm

Mark_Farlander wrote:
Tue Apr 03, 2018 2:09 pm
Allowing the player to choose the wallpaper would be even more awesome.
Darksaber wrote:
Tue Apr 03, 2018 1:20 pm
One more thing, do we have to have the XVT wallpaper? Can't you create a *.cfg file to enable or disable it please

Thank you
I will see what I can do

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1711
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Tue Apr 03, 2018 11:27 pm

I presume that as long as all players have identical code, images shouldn't matter much? Or do you think desync may be a problem? I know that back in the day if one player had the imperial concourse installed and the second had the rebel one, desync made the game unplayable.

That said, the issue seemed to stem from strings mismatch.

User avatar
Jaeven
Ensign
Galactic Empire
Posts: 399
Joined: Mon Mar 30, 2015 3:18 am

Post by Jaeven » Wed Apr 04, 2018 1:42 am

How is the performance at any rate?

The last time I tried to play XWA Multiplayer there was like a 5 second delay for the non-host player. Could have been just me, I haven't had all that much experience in playing XWA online.

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Wed Apr 04, 2018 2:18 am

Driftwood wrote:
Tue Apr 03, 2018 11:27 pm
I presume that as long as all players have identical code, images shouldn't matter much? Or do you think desync may be a problem? I know that back in the day if one player had the imperial concourse installed and the second had the rebel one, desync made the game unplayable.

That said, the issue seemed to stem from strings mismatch.
You bring up a very good point and It's very well possible which is why I ran some tests to see if this string was syncing or not. It seems to not sync so it might be fine in changing it but I am always wary of having too much variance between clients. I will see about implementing an option to change the background through a cfg file, as well as implementing an alternative method of changing the background string (pushing strings onto the stack rather than changing strings themselves).

Jaeven wrote:
Wed Apr 04, 2018 1:42 am
How is the performance at any rate?

The last time I tried to play XWA Multiplayer there was like a 5 second delay for the non-host player. Could have been just me, I haven't had all that much experience in playing XWA online.
The performance should be much much better than before with my hook. It changes the server tick rate to 30 and turns off internet mode by default, resulting in smoother games.

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Fri Apr 06, 2018 3:23 am

1.1 has been uploaded.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10317
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Fri Apr 06, 2018 6:02 am

That's great,

but to the layman you haven't actually explained in readme how you disable it

Something like would be enough

Code: Select all

; Simulator Background = 1 (enable) or 0 (disable)
; When set to 1, enables the background.
; When set to 0, disables the background.
“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

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Fri Apr 06, 2018 9:58 pm

Ok, I have added instructions to enable or disable the XvT background under the "how to use" section of the readme.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10317
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Apr 07, 2018 11:55 am

Thank you

Oh are you planning on making any more update anytime in the very near future, I only ask as I'll add it to the DSUCP as an option if your good with that, it seems to work of, but haven't tested it fully, rely on other people like ual002 to do that :D

It would be nice to see Jeremy's opinion on your hook :)
“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

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1605
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Apr 07, 2018 12:55 pm

Hello,

In your src.zip, there is no need to include the packages, bin and obj folders.

In the Readcfg class, why do you create the cfg file if it is missing? In this case, you can simply use default values.
Reading the ParseNumberFile method, your code reads only the first option. You can read the cfg file line by line and check the option name as a future proof. If you eventually add more options, there wil be less code to modify.

In the hook_tourmultiplayer.cfg file, it would be better to add the option doc.

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Sun Apr 08, 2018 2:00 am

Darksaber wrote:
Sat Apr 07, 2018 11:55 am
Thank you

Oh are you planning on making any more update anytime in the very near future, I only ask as I'll add it to the DSUCP as an option if your good with that, it seems to work of, but haven't tested it fully, rely on other people like ual002 to do that :D

It would be nice to see Jeremy's opinion on your hook :)
You're welcome

Maybe around 2 months or so. I plan to have the next update to be another large one. I'm perfectly ok with it being added to the DSUCP.
JeremyaFr wrote:
Sat Apr 07, 2018 12:55 pm
Hello,

In your src.zip, there is no need to include the packages, bin and obj folders.

In the Readcfg class, why do you create the cfg file if it is missing? In this case, you can simply use default values.
Reading the ParseNumberFile method, your code reads only the first option. You can read the cfg file line by line and check the option name as a future proof. If you eventually add more options, there wil be less code to modify.

In the hook_tourmultiplayer.cfg file, it would be better to add the option doc.
Yes, I should have removed them. I'm a bit new to posting source files so I wasn't really sure what is considered kosher.

I had the cfg regenerate itself should the user ever delete it, but you're right that its better to simply load a default option if that is the case. If you have a C# example of your cfg implementation I would be happy to take a look at it. I will be honest, I didn't spend that much time with the cfg implementation because I didn't plan on having any more additional options. The reason being is because I want to limit the amount of variance between players in multiplayer to prevent desyncronization.

Thank you for your feedback.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1605
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Apr 08, 2018 8:49 am

Something like that:

Code: Select all

    class ConfigFile
    {
        public ConfigFile()
        {
            const string path = "hook_tourmultiplayer.cfg";

            if (!File.Exists(path))
            {
                return;
            }

            using (StreamReader sr = new StreamReader(path))
            {
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    if (string.IsNullOrEmpty(line))
                    {
                        continue;
                    }

                    if (line[0] == '#' || line[0] == ';' || (line[0] == '/' && line[1] == '/'))
                    {
                        continue;
                    }

                    int pos = line.IndexOf('=');

                    if (pos == -1)
                    {
                        continue;
                    }

                    string name = line.Substring(0, pos).Trim();
                    string value = line.Substring(pos + 1).Trim();

                    if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(value))
                    {
                        continue;
                    }

                    if (name.Equals("xvtsimulatorbackground", StringComparison.OrdinalIgnoreCase))
                    {
                        XvtSimulatorBackground = value.Equals("1", StringComparison.OrdinalIgnoreCase);
                    }
                }
            }
        }

        public bool XvtSimulatorBackground { get; } = true;
    }
or like that:

Code: Select all

    static class ConfigFile
    {
        static ConfigFile()
        {
            const string path = "hook_tourmultiplayer.cfg";

            if (!File.Exists(path))
            {
                return;
            }

            using (StreamReader sr = new StreamReader(path))
            {
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    if (string.IsNullOrEmpty(line))
                    {
                        continue;
                    }

                    if (line[0] == '#' || line[0] == ';' || (line[0] == '/' && line[1] == '/'))
                    {
                        continue;
                    }

                    int pos = line.IndexOf('=');

                    if (pos == -1)
                    {
                        continue;
                    }

                    string name = line.Substring(0, pos).Trim();
                    string value = line.Substring(pos + 1).Trim();

                    if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(value))
                    {
                        continue;
                    }

                    if (name.Equals("xvtsimulatorbackground", StringComparison.OrdinalIgnoreCase))
                    {
                        XvtSimulatorBackground = value.Equals("1", StringComparison.OrdinalIgnoreCase);
                    }
                }
            }
        }

        public static bool XvtSimulatorBackground { get; } = true;
    }

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Sun Apr 08, 2018 5:51 pm

Cool, thanks.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10317
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Apr 09, 2018 12:20 pm

Changed this to a 'sticky' thread :)

And thanks for the permission for adding it to the DSUCP :)
“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

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Mon Jun 11, 2018 11:12 pm

Just an update on the hook: I've gotten around to fixing some of the bugs and I'm in the process of finishing up an actual "Tour" or campaign mode. This will allow multiple .lst files to be utilized for different campaigns and allow progression. (I want to thank Jeremy for helping me out on this)

Screenshot: https://imgur.com/a/G9b1mzY

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1711
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Mon Jun 11, 2018 11:55 pm

Nice! This will be a nice feature for expanding community mission options. I always hated having to overwrite the campaign, and/or use altered pilots to access "post" ROTJ missions.

User avatar
ual002
Ensign
Galactic Empire
Posts: 488
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Tue Jun 12, 2018 1:57 am

Exactly
For the glory of his majesty Emperor Palpatine! Image Image Image Image

Post Reply