Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 [2] 3 4 ... 7

Author Topic: [0.96] Cooperative Multiplayer Combat v3.8 (2023-08-26)  (Read 185758 times)

Nick XR

  • Admiral
  • *****
  • Posts: 710
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-01-30)
« Reply #15 on: February 01, 2017, 09:56:31 AM »

On topic:
This is really impressive. I just don't know how much I fancy playing without a mouse, though.


FWIW, if player2 sticks to ships that meet the following criteria it's hardly different:
  • Fixed forward facing shields
  • Ship system that doesn't care about where a mouse is (like burn drive)
  • Primary guns/missiles that only shoot forward

Which is probably at least half the combat ships.  If you use the "turn to mouse" option, then it'll probably be a big change for you, I don't but that might be a personal problem :)
« Last Edit: February 01, 2017, 10:48:55 AM by Nick XR »
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-01-30)
« Reply #16 on: February 01, 2017, 11:04:16 AM »

Years ago, people said the same about KSP, but modders found a way. If someone is sufficiently dedicated and skilled, they might just do it for SS. It might not be likely, but don't say never.

There is a pretty big difference between a game built in an engine that is dedicated to support multiplayer games, and one in a custom engine that has nothing to even remotely help with multiplayer. Or at the least not in a legal "I-didn't-entirely-decompiled-and-recompiled-your-game" way.
Now it's just a matter of getting two instances of Starsector to talk together (AIs and all) and we can have PvP matches
The day that happens is the day that swine discover the secrets of flight, hell freezes over AND politicians start telling the truth and become un-corruptable!

Depends.
If, somehow, one discovered the section of the code where a AI routine/Player input is translated into ship activity (moving, firing, etc), it could be possible to intercept the "commands" that regulate the movements of your own ships, send it to another computer, have this second computer replace the commands of it's player enemy's AI with the commands received (ie: translating Player1 allied ships movements into Player2 enemy ships movements and vice versa).
One of the main reasons why MP will never work is because in order to make it work, you would basically have to deobfuscate a ton of code, thus breaking the EULA. Also, certain mechanics would not work/ translate well (like the time dilation) to MP. And finally, it would be a complete PAIN to fight against people as stuff that is balanced for SP would NOT balanced for MP. I mean, imagine the amount of cheesy fleets that you would face most of the time!
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Mr. Nobody

  • Commander
  • ***
  • Posts: 236
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-01-30)
« Reply #17 on: February 01, 2017, 03:20:29 PM »

That or a API by Alex.
In theory it shouldn't be too hard, a function that returns a given AI orders to a ship (ie: move left, vent, fire, use ability) and one that inputs orders to the ship (ie: the actual moving left, firing, venting, etc).

This way you could take the orders of a allied AI ship, send them over the internet (or any other system) and have them translated into enemy ships movements on another player's part.
This will be limited to a 2 players battle though, no true multiplayer with more than one player zipping around in the galaxy. Though it would be still interesting to see a small tournament where two players battle each other within some set of rules.
Logged
On the left half of the Bell curve

TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-01-30)
« Reply #18 on: February 01, 2017, 04:17:47 PM »

That or a API by Alex.
In theory it shouldn't be too hard, a function that returns a given AI orders to a ship (ie: move left, vent, fire, use ability) and one that inputs orders to the ship (ie: the actual moving left, firing, venting, etc).

This way you could take the orders of a allied AI ship, send them over the internet (or any other system) and have them translated into enemy ships movements on another player's part.

There's a lot more to it than that; accounting for latency requires the ability to rollback game state (to resolve disagreements between client game states).
Retrofitting such a networking solution to starsector would be a truly monumental task; even my unending optimism believes that solution to be impossible (without direct access to the source).

A more practicable solution is to make the game state deterministic, and just share (and buffer) player inputs.
It's all been thought about & discussed on the forums before, along with a significant amount of planning & prototyping work.
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 710
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-02-02)
« Reply #19 on: February 02, 2017, 12:28:03 AM »

Version updated to .2

New videos on main post demonstrating UI bits and functionality.

New UI interface elements (thanks for reminding me about sprites Tartiflette)


Rediness color key:
Green = ready
Yellow = almost ready
Orange = not close to ready
Red = out of ammo

Mr. Nobody

  • Commander
  • ***
  • Posts: 236
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-01-30)
« Reply #20 on: February 02, 2017, 03:36:14 AM »

There's a lot more to it than that; accounting for latency requires the ability to rollback game state (to resolve disagreements between client game states).
Retrofitting such a networking solution to starsector would be a truly monumental task; even my unending optimism believes that solution to be impossible (without direct access to the source).

A more practicable solution is to make the game state deterministic, and just share (and buffer) player inputs.
It's all been thought about & discussed on the forums before, along with a significant amount of planning & prototyping work.

Correct me if i am wrong but could a system similar to the one used in Supreme Commander work? It enforces a minimum lag of 500ms (iirc) between players so the game has time to synch everything properly.
I don't know how 501+ms lag is handled though.
Logged
On the left half of the Bell curve

TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-01-30)
« Reply #21 on: February 02, 2017, 04:50:12 AM »

There's a lot more to it than that; accounting for latency requires the ability to rollback game state (to resolve disagreements between client game states).
Retrofitting such a networking solution to starsector would be a truly monumental task; even my unending optimism believes that solution to be impossible (without direct access to the source).

A more practicable solution is to make the game state deterministic, and just share (and buffer) player inputs.
It's all been thought about & discussed on the forums before, along with a significant amount of planning & prototyping work.

Correct me if i am wrong but could a system similar to the one used in Supreme Commander work? It enforces a minimum lag of 500ms (iirc) between players so the game has time to synch everything properly.
I don't know how 501+ms lag is handled though.

Yes, SupCom used a peer-to-peer deterministic lock-step model to keep the clients in perfect sync, and that 500ms enforced latency would be precisely because of the buffering necessary to achieve this.

There's an article on the subject here that specifically mentions SupCom (among other RTS games).

- Making Starsector deterministic is relatively easy if you're familiar with Java instrumentation.
- Making it fixed time step is likewise doable
- Capturing, relaying, buffering & remotely interpreting user inputs (in a symmetric way) is a little more involved, but again nothing impossible.
- Making the AI behave symmetrically is an unknown to me at this point, as I've not looked at that code yet. Though I don't anticipate it being too hard to work around, or fix if necessary.
- Building the backend for matchmaking, leaderboards etc etc is time consuming, but straightfoward.

With modern broadband, I'm hoping SS MP will have a much increased simulation rate (and thus a far smaller input buffer); something in the range of 100ms.
Though there's no reason it can't dynamically tune itself to the latency between the clients involved.
I've tested the game with an artificial latency on inputs, and it remains perfectly playable well above 200ms; in fact almost unnoticeable most of the time.
That said, aiming ship weapons does suffer a little, especially on the smaller ships.
Fortunately most of the time you defer weapon targeting to the AI, and as that's part of the simulation it's obviously unaffected by the latency.

Implementing it is all perfectly possible, and well within my understanding; it's just a case of finding the time  :-\

Ironically the most difficult part so far has been writing instrumentation to inject menu options.
You'd think it'd be straightforward....(and it would be, if it were a good gui API like Swing or Javafx)... but the home brew ui that Starsector uses is... shall we say... less than perfect. :'(
« Last Edit: February 02, 2017, 08:36:26 AM by TJJ »
Logged

Cyan Leader

  • Admiral
  • *****
  • Posts: 718
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-02-02)
« Reply #22 on: February 02, 2017, 06:19:16 AM »

This looks amazing, thanks for the effort.

No mouse function and no split screens are still big issues but one step at a time I suppose.
Logged

Elijah

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-02-02)
« Reply #23 on: February 02, 2017, 10:58:41 AM »

This is amazing, thank you very much for the effort you put into this!
(basically the same post as above, but it truly is amazing. Multiplayer regarding Starsector has always been, in my mind, like this idea)
Logged

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-02-02)
« Reply #24 on: February 02, 2017, 12:49:28 PM »

I don't suppose that SS supports dual mice?

Then you could plug two mice into the computer and play with your friend without networking anything.
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

Nick XR

  • Admiral
  • *****
  • Posts: 710
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-02-02)
« Reply #25 on: February 02, 2017, 01:09:16 PM »

I don't suppose that SS supports dual mice?

Then you could plug two mice into the computer and play with your friend without networking anything.

No, SS probably gets the cursor position from the OS and I don't know of any OS that supports multiple cursors.  (You can have multiple mice controlling the same cursor though).

There are work-arounds for the lack of multiple mice that don't hamper gameplay IMO; only personally controlling guns that fire forward, only using forward fixed shields (although an AI will aim it if you have omni), and there's now a "cycle targets" command for targeting.



TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat (2017-02-02)
« Reply #26 on: February 02, 2017, 02:01:33 PM »

I don't suppose that SS supports dual mice?

Then you could plug two mice into the computer and play with your friend without networking anything.

No, SS probably gets the cursor position from the OS and I don't know of any OS that supports multiple cursors.  (You can have multiple mice controlling the same cursor though).

There are work-arounds for the lack of multiple mice that don't hamper gameplay IMO; only personally controlling guns that fire forward, only using forward fixed shields (although an AI will aim it if you have omni), and there's now a "cycle targets" command for targeting.

JInput allows you to query each and every input device connected to the computer; Mice, Keyboards, Game Controllers, etc.
As SS is built upon LWJGL, and LWJGL utilises JInput, you should have no trouble bypassing the LWJGL API and querying JInput directly.
So multiple mice should absolutely be possible.

Not done it myself though.
Logged

Deshara

  • Admiral
  • *****
  • Posts: 1578
  • Suggestion Writer
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat v.2 (2017-02-02)
« Reply #27 on: February 06, 2017, 10:51:27 AM »

So, TODO list for this to up in scope: support for multi-mouse input in SS, bug Alex just for support for split screen
Logged
Quote from: Deshara
I cant be blamed for what I said 5 minutes ago. I was a different person back then

Nick XR

  • Admiral
  • *****
  • Posts: 710
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat v.2 (2017-02-02)
« Reply #28 on: February 06, 2017, 01:08:40 PM »

My current todo list:
* Improve UI elements for the additional players (indicators for each weapon)
* Support for .8x
* Make a compelling video of multiplayer in action
* See about auto scaling the viewable area to always show both ships

I'm not sold on the use case of there being a need to support a second mouse input.  I don't see a scenario where a second player has a mouse at the same desk or couch and can actually play.  But, this is open source, so if anyone wants to code it up and submit a pull request I'll happily merge it.

Deshara

  • Admiral
  • *****
  • Posts: 1578
  • Suggestion Writer
    • View Profile
Re: [0.7.2a] Cooperative Multiplayer Combat v.2 (2017-02-02)
« Reply #29 on: February 06, 2017, 10:00:48 PM »

My current todo list:
* Improve UI elements for the additional players (indicators for each weapon)
* Support for .8x
* Make a compelling video of multiplayer in action
* See about auto scaling the viewable area to always show both ships

I'm not sold on the use case of there being a need to support a second mouse input.  I don't see a scenario where a second player has a mouse at the same desk or couch and can actually play.  But, this is open source, so if anyone wants to code it up and submit a pull request I'll happily merge it.

I have my PC hooked into my entertainment center, this is a wireless keyboards/mice from the couch household! Splitscreen PC support is an automatic plus for me
Logged
Quote from: Deshara
I cant be blamed for what I said 5 minutes ago. I was a different person back then
Pages: 1 [2] 3 4 ... 7