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

Feature/multiplayer things spawn options #1175

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

UnreallyHard
Copy link

@UnreallyHard UnreallyHard commented Feb 26, 2024

Option is available for all netgame types
Added Multiplayer Things Spawn Type to setup menu
Added Cmd Line Parameter mpspawntype
Added netgame functionality
Added mobjtype_weapons array is_weapon function
Closes #681

Options for Multiplayer Things Spawn Type are:

  • All (0) - Default
  • All except weapons (1) - The most often asked variant, ex. (Suggestion) Don't spawn multiplayer weapons in co-op mode #681
  • Only monsters (2) - One step further. Nothing multiplayer related is spawned except monsters. This option can be used to remove mp only ammo spawns
  • None (3) - Nothing multiplayer related is spawned at all

Option is available for all netgame types
Added Multiplayer Things Spawn Type to setup menu
Added Cmd Line Parameter mpspawntype
Added netgame functionality
Added mobjtype_weapons array is_weapon function
Closes fabiangreffrath#681
src/net_defs.h Outdated Show resolved Hide resolved
@fabiangreffrath
Copy link
Owner

Sorry, but before you put even more effort into this, it'd be only fair to tell you that I am not convinced of this concept and I am not going to merge it like this. The difference to DM3-support is that this added a single command line parameter and one or two more checks in the code. The approach here, however, adds a new command line parameter with different arguments and even modifies the netgame protocol. That's a no, sorry.

The one feature that's been asked for is "coop without additional weapons", so I'd suggest to implement this and either call it -coop2 in analogy to -dm3, or -no_coop_spawns in analogy to -coop_spawns - but nothing more, please.

@fabiangreffrath
Copy link
Owner

Please try to restrict the amount of changes to the ones in this PR:

0272030

@UnreallyHard
Copy link
Author

Please try to restrict the amount of changes to the ones in this PR:
0272030

@fabiangreffrath I would like to make less changes but I don't think it's feasible to both keep code clean and do it.

src/doom/d_net.c
The main problem is that the code considers any deathmatch value greater than 0 to be a deathmatch game so it's applies deathmatch logic to the new value deathmatch = 4. But that doesn't work in our case as we are making a new coop mode. I described this problem in the previous comment #1175 (comment)

Since any deathmatch value greater than 0 means that it’s a deathmatch game, a lot of code changes would be made for deathmatch = 4 to work as coop game. So instead, there is only a small code changes that modify deathmatch value. Net operations continue to use a deathmatch original value and if deathmatch == 4 then everything else uses deathmatch = 0 and coop2 = true values.

So Because of all that, I made a change to src/doom/d_net.c to convert a net deathmatch value to a global var and vice versa. I moved conditions to the separate functions to make code cleaner.

netgame_modes_t
I added netgame_modes_t typedef to fix the issue with code maintainability as new deathmatch mode means that developer needs to change maximum value in both src/net_common.c and src/setup/multiplayer.c. Furthermore, using constants instead of integers is much better in my opinion, since it's much easy to find changes introduced by the deathmatch mode.

boolean coop2
It was added to get rid of a deathmatch value dependency in the base code.

Please tell me, If you have any ideas how to make less changes and support high maintainability?
If having the less changes is the main priority then I guess netgame_modes_t typedef can be deleted in exchange for the less code maintainability and the less readability.

@UnreallyHard
Copy link
Author

Please try to restrict the amount of changes to the ones in this PR:

@fabiangreffrath I additionally removed netgame_modes_t enum (to have less changes) in an exchange for the less code maintainability.

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

Successfully merging this pull request may close these issues.

(Suggestion) Don't spawn multiplayer weapons in co-op mode
2 participants