devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

[Feature Request] Couch co-op multiplayer

Open yuripourre opened this issue 4 years ago • 29 comments

Would be awesome if we could play devilutionX as local multiplayer.

I have a roadmap here that I will try to implement (the items completed are on a branch not yet merged to DevilutionX):

  • [x] ~Abstract gamepad (axis/sticks #1236 keyboard and buttons)~
  • [x] ~Assign player index to gamepads (#2958)~
  • [x] ~Allows simple joysticks (2 axis and 8 buttons, instead of gamepads) (#2965)~
  • [x] ~Modify handler classes to allow multiple players (#1285)~
  • [x] Adapt game loop to handle multiple players
  • [x] Modify game render to use players' centroid as center instead of player 1 position
  • [x] Modify UI to show multiple HUDs
  • [ ] Modify multiplayer logic so a device with couch co-op can play with another device (maybe with couch co-op enabled too).
  • [ ] Fix coop players do not deal damage to monsters
  • [ ] Fix coop players cannot open doors
  • [ ] Fix spells sometimes are casted multiple times
  • [ ] Fix player 1 cannot use belt items
  • [ ] Fix player 3 join breaks the UI

yuripourre avatar Mar 21 '21 22:03 yuripourre

Do you mean multiplayer in a split screen?

Chance4us avatar Mar 21 '21 23:03 Chance4us

@Chance4us I was thinking about a single screen but I can think about it.

yuripourre avatar Mar 21 '21 23:03 yuripourre

You can actually start multiple windows from the same game, don't know if that will be helpful in any way but it would be another way to go about it

AJenbo avatar Mar 21 '21 23:03 AJenbo

Couch co-op would sure be nice. Of course you'd have to make it a lot more like the PSX so the game would pause when bringing up inventory and stuff, it could be a hassle.

galaxyhaxz avatar Mar 22 '21 00:03 galaxyhaxz

A separate gui should be created for local coop. With modern resolutions partial covering of the screen shouldn't be much of a problem. Some menus should be condensed further to accommodate the new game mode. Maybe put character sheet along with inventory or have a popup showing the change of stats.

NikoVP avatar Mar 23 '21 22:03 NikoVP

Just require 1280x480 to run :D

AJenbo avatar Mar 23 '21 23:03 AJenbo

What about the camera? I see no tasks related to it. The standard camera which is centered on one player will not cut it.

julealgon avatar Mar 25 '21 02:03 julealgon

Yes, you will have to do what the PSX did and give the players a "leash" where they can't walk further until all other players are within the range. Additionally if one player teleports it must work for all.

galaxyhaxz avatar Mar 25 '21 02:03 galaxyhaxz

What about the camera? I see no tasks related to it. The standard camera which is centered on one player will not cut it.

@julealgon Good point, added it!

Yes, you will have to do what the PSX did and give the players a "leash" where they can't walk further until all other players are within the range. Additionally if one player teleports it must work for all.

@galaxyhaxz That's what I have I mind. Thanks for mentioning teleports, it will be hard. Now, I am concerned about how annoying would be the camera changing too fast because of teleports/phasing.

yuripourre avatar Mar 25 '21 15:03 yuripourre

I think the PSX camera was on a spring and not always dead center between the players.

AJenbo avatar Mar 25 '21 15:03 AJenbo

Yep the camera on PSX jittered and lagged behind, it would catch up to you after you stopped walking. I personally liked it but i know for some it might cause motion sickness.

galaxyhaxz avatar Mar 25 '21 15:03 galaxyhaxz

Yep the camera on PSX jittered and lagged behind

I'm not a fan of the standard camera exactly because it lagged behind... I'd actually prefer something which is basically the opposite: make the camera look ahead in the direction you are facing.

That wouldn't work very well on multiplayer though (or would be harder to implement I guess).

julealgon avatar Mar 25 '21 16:03 julealgon

That would work very well on multiplayer though (or would be harder to implement I guess).

wouldn't?

AJenbo avatar Mar 25 '21 19:03 AJenbo

Proposed UI using original graphics: minimal-ui

yuripourre avatar Apr 03 '21 19:04 yuripourre

Showing the face is a pretty cool idea, even though maybe it would still be worth it showing the player number somewhere, since multiple players can have the same class.

Maybe a "PX" text at the bottom right corner of the image would make sense?

julealgon avatar Apr 03 '21 20:04 julealgon

Or the hero name?

AJenbo avatar Apr 03 '21 22:04 AJenbo

@julealgon This idea might work well for the level, some games show that over the portrait. I am afraid that player number is not clear enough to identify the player (maybe if player had a marker close to the character).

@AJenbo yeah, I am trying to figure out where to include the name, having the name might work better to identify the player indeed.

yuripourre avatar Apr 03 '21 22:04 yuripourre

@julealgon This idea might work well for the level, some games show that over the portrait. I am afraid that player number is not clear enough to identify the player (maybe if player had a marker close to the character).

@AJenbo yeah, I am trying to figure out where to include the name, having the name might work better to identify the player indeed.

Seeing the actual player number somewhere might be helpful because monsters will target the player with lower number

qndel avatar Apr 03 '21 22:04 qndel

Another attempt after more tweaks. I tried some combinations of ideas. What do you think?

coop-minimal-ui-v3(fw)

yuripourre avatar Apr 04 '21 19:04 yuripourre

Personally, I would go for fewer gold borders, and the PvP mode is global so 4 buttons don't actually make that much sense.

AJenbo avatar Apr 04 '21 20:04 AJenbo

Would like to see a design that:

  • Fits in 640x480
  • Shows main elements of the panel (xp bar and durability icons are missing here)
  • Ideally showed the 4 hotkeys for each player (or showed additional UI so that players could hotkey their spells somehow - not clear how that would be done here)
  • Is a bit more similar to other UI elements in the game (see ajenbo's comment)
  • Showed the P1/P2/P3/P4 text in the same color used to draw the player arrows in the automap

julealgon avatar Apr 04 '21 21:04 julealgon

Showed the P1/P2/P3/P4 text in the same color used to draw the player arrows in the automap

Could have a border with the same color as the arrows on the map

AJenbo avatar Apr 04 '21 21:04 AJenbo

One more attempt (640x480) minimalistic_flip

yuripourre avatar Apr 04 '21 23:04 yuripourre

What's the worst-case scenario for the UI? Can you post a screenshot with

  • 4 players
  • the biggest possible character name allowed in the game currently in terms of length
  • with all gear pieces breaking (helm, armor, sword, shield)
  • how it looks like when you have 20+ spells learned and is selecting hotkeys.
  • with inventory and character screens open
  • with a scroll hotkey, showing how many scrolls are left for the selected spell

julealgon avatar Apr 06 '21 02:04 julealgon

Only allowing 2 players like the original PSX version wouldn't be the end of the world either.

AJenbo avatar Apr 06 '21 02:04 AJenbo

Only allowing 2 players like the original PSX version wouldn't be the end of the world either.

I don't disagree. I just mentioned it because Yuri himself was targeting 4 players so I wanted to make sure the UI could handle it.

julealgon avatar Apr 06 '21 03:04 julealgon

Wasn't strictly a reply to you either :)

AJenbo avatar Apr 06 '21 03:04 AJenbo

It might be worth looking at how other action RPGs implement local multi such as Diablo 4 to search for ideas.

jan-kleks avatar Sep 03 '24 16:09 jan-kleks

That's the best I could think so far. I am working on the couch co-op, I had to change some of the joystick buttons, there are still a lot of bugs but it's progressing.

Image Image

yuripourre avatar Dec 08 '25 01:12 yuripourre

Image

yuripourre avatar Dec 22 '25 21:12 yuripourre