Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coop multiplayer support? #7

Closed
poVoq opened this issue Feb 5, 2020 · 14 comments
Closed

Coop multiplayer support? #7

poVoq opened this issue Feb 5, 2020 · 14 comments

Comments

@poVoq
Copy link

@poVoq poVoq commented Feb 5, 2020

In your FAQ it sounds a bit like multiplayer isn't supported due to performance problems with the QC entity system.

But maybe coop multiplayer would still be feasible? A campaign with 2-4 players would probably be really fun.

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Feb 5, 2020

whew boy that's it's own odyssey. I can kind of point to where things need to be fixed, but I ran out of energy to focus on them.

  1. Client-side prediction doesn't exactly work right, at best I was using the Darkplaces flag sv_clmovement 1.

  2. battleMETAL's QC uses an entity for player camera, an entity that has to follow the player's "true" entity.

  3. I never got FTEQW-style entity updating to work right either.
    https://github.com/Subject9x/battleMETAL/blob/master/client/client_main.qc#L597

To really get this codebase back to network play; we'd have to get clientside prediction to work for player cameras, and be able to sync CSQC entity copies to their SSQC counterparts. For me, this was a lot of work, but it's not "impossibly hard".

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Feb 7, 2020

Another random note: Co-Op / PvP was originally a design goal, and there's still some code that functions for this:

  • you can change your faction id via console: cmd mech setfaction <1, 2, 3>
  • this then allows you to set Deploy and Nav points with different factions.
  • You can set player starting equipment on Co-Op maps by making a .sav file in the /data/map_scripts/ folder for that map.
  • you can check out local co-op yourself with this fun method:
    • start up 2 instances of darkplaces.
    • instance 1, go to any map, and enter the following console commands:
      • coop 1
      • maxplayers 2
      • restart
    • then on instance 2, type:
      • connect
    • you should be able to connect to the map in instance 1.

Another fatal showstopper bug though is that AI movement is not predicted clientside and apparently has a tendency to chug the server. If network play were to be implemented, the AI would need a semi-complete rewrite of its movement code to ignore engine builtins of walkmove() and movetogoal().

@poVoq
Copy link
Author

@poVoq poVoq commented Feb 8, 2020

Ok, thanks for the details. I guess we can keep this open to track possible progress towards this "not impossible" goal in the future :)

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Feb 9, 2020

Agreed, maybe if we can get a build of the game ported over to FTEQW - I've heard that networking in that world is more robust and easier to wrangle. 👍

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Mar 4, 2020

no joke, an idle conversation and some testing has lead to an idea to try for networking.
So far the sacrifice seems to be player shadows and maybe some 'sim' feel with looking around your mech.

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Mar 11, 2020

Yup been down this hole the entire time; lag-compensator branch is probably going to be a fairly massive upgrade to the game, just a warning.

@poVoq
Copy link
Author

@poVoq poVoq commented Mar 11, 2020

Keep us posted, sounds like it will improve the game a lot :)

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Mar 24, 2020

Still on-track to finishing up the network branch. The last remaining gubbins are:

  • building death animations.
  • sending player data to other players.
  • refactoring mission lifecycle to handle multiple players.

after this there's still the UIX work to be completed but I can merge the network changes to the main branch and work from there.

@poVoq
Copy link
Author

@poVoq poVoq commented Mar 24, 2020

Sounds great. Enemy AI is working so that coop missions would be feasible?

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Mar 24, 2020

From my 2-player tests with a friend, the AI functions more-or-less the same, but they can be a tad network heavy.

@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Mar 30, 2020

wrapping up internal tests this week. The lag-compensation branch seems to mostly work but I'd still say keep the player count under 8. I've been testing with 4 players so far and some latency does seem to build up over time but nothing that stops the show.

@Subject9x Subject9x reopened this Apr 2, 2020
@Subject9x
Copy link
Owner

@Subject9x Subject9x commented Apr 2, 2020

Main code changes have been merged, there's refinements to be made but this feature request has been completed! 👍

@poVoq
Copy link
Author

@poVoq poVoq commented Apr 2, 2020

Super cool. Thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@poVoq @Subject9x and others