[Feature Request] Couch co-op multiplayer
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
Do you mean multiplayer in a split screen?
@Chance4us I was thinking about a single screen but I can think about it.
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
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.
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.
Just require 1280x480 to run :D
What about the camera? I see no tasks related to it. The standard camera which is centered on one player will not cut 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.
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.
I think the PSX camera was on a spring and not always dead center between the players.
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.
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).
That would work very well on multiplayer though (or would be harder to implement I guess).
wouldn't?
Proposed UI using original graphics:

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?
Or the hero name?
@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.
@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
Another attempt after more tweaks. I tried some combinations of ideas. What do you think?

Personally, I would go for fewer gold borders, and the PvP mode is global so 4 buttons don't actually make that much sense.
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
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
One more attempt (640x480)

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
Only allowing 2 players like the original PSX version wouldn't be the end of the world either.
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.
Wasn't strictly a reply to you either :)
It might be worth looking at how other action RPGs implement local multi such as Diablo 4 to search for ideas.
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.