Author Topic: Max respawns mission value not respected in co-op campaign mode?  (Read 1775 times)

0 Members and 1 Guest are viewing this topic.

Offline Parias

  • 27
Max respawns mission value not respected in co-op campaign mode?
Has anyone tried disabling respawns for a set of co-op campaign missions before? I'm hitting a weird problem with this and I'm not sure if it's a bug or not.

I have a multiplayer mission set up with "Max Respawns" set to 0 in the Mission Specs in FRED. If I host this mission in just single-mission mode, I can go into the Host Options and change the number of respawns as needed (or leave it at 0, which is the default as per my Mission Specs). In-game this works as expected - if a player dies, they can only observe and cannot respawn.

However, if I play the same mission as part of a multiplayer campaign, this doesn't work. When I start the campaign, the Host Options shows the Respawns value as "NA" and is uneditable. I guess that's understandable as the system may want to account for different missions in a campaign having different max respawn values, but the problem is that my per-mission max respawn value isn't respected in this mode. Dead players can respawn however many times they want to (I haven't figured out what 'default' upper limit it's imposing yet).

Am I misunderstanding how this is supposed to work? I've dug through the code associated with setting up multiplayer campaign sessions and found this:

multiui.cpp:
Code: [Select]
// create the respawn count input box
Multi_ho_respawns.create(&Multi_ho_window,Ho_rsp_coords[gr_screen.res][MULTI_HO_X_COORD],Ho_rsp_coords[gr_screen.res][MULTI_HO_Y_COORD],Ho_rsp_coords[gr_screen.res][MULTI_HO_W_COORD],6,"",UI_INPUTBOX_FLAG_ESC_FOC | UI_INPUTBOX_FLAG_INVIS | UI_INPUTBOX_FLAG_NO_LETTERS,-1,&Color_bright);
// if we're in campaign mode, disable it
if(Netgame.campaign_mode == MP_CAMPAIGN){
Multi_ho_respawns.set_text(XSTR("NA",795));  // [[ Not applicable ]]
Multi_ho_respawns.disable();
} else {
Multi_ho_respawns.set_valid_chars("0123456789");
}

And in multi_campaign.cpp (around line 101):

Code: [Select]
// maybe override the Netgame.respawn setting
Netgame.respawn = The_mission.num_respawns;
nprintf(("Network","MULTI CAMPAIGN : overriding respawn setting with mission max %d\n",The_mission.num_respawns));

So it looks to me like there's code that does expressly disable the respawn value if you're in MP Campaign mode (which again makes some sense I guess?) - but then another snippet expressly placed in the multiplayer campaign handling code that's supposed to override the current respawn settings based on the current mission that maybe isn't working right? I'm really not sure - figured I'd ask before filing a Mantis report.

  

Offline Parias

  • 27
Re: Max respawns mission value not respected in co-op campaign mode?
Just a minor update: I've found that the total amount of respawns it seems to default to in MP campaign mode is about 11 or 12 (again regardless of the max respawns actually set in the mission - usually way lower than this by default).  This was confirmed via a custom testing initiative mission whereas players could push a button to request that a nearby Lucifer promptly deliver HappySparkles(TM) to their fighter in a repeated manner, followed by cake.

I'm not sure yet on the reason for this number, but for my purposes I've found that using the "set-respawns" SEXP bypasses this issue very nicely. In my case I just want to disable respawns in the mission completely, so invoking an event with set-respawns and a crazy-high number for the player ships in question fixes the problem.

I may dig a bit deeper into the respawn code as it sounds like it's 'supposed' to be using the mission-specific max respawns value (defined in the Mission Specs UI in FRED) so maybe something isn't working right.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Re: Max respawns mission value not respected in co-op campaign mode?
That sounds like the opposite of "disable respawns".

 

Offline Parias

  • 27
Re: Max respawns mission value not respected in co-op campaign mode?
You'd be surprised! This is the exact description from the set-respawns SEXP:

Quote
set-respawns
   Set the # respawns a player (or AI that could have been a player) has used.
   1: Number of respawns used up
   Rest: The player start ship to operate on.
   Only really useful for multiplayer.

Sets the number of respawns that a player "has used". So setting this to a number higher than your maximum number of respawns at the start of a mission effectively leaves you with zero available.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Max respawns mission value not respected in co-op campaign mode?
Yep, the idea for the SEXP was to allow a single player to gain extra respawns from their actions in the mission, not set the global number of respawns (Which if I remember correctly, was much harder to implement).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Parias

  • 27
Re: Max respawns mission value not respected in co-op campaign mode?
That makes sense - thanks for the explanation. In this case it's also serving as a wonderful workaround for my problem for now (I realized I can even just use mn.runSEXP in scripting instead of having to add events to all my missions), so there's that at least. I'm particularly nit-picky right now about respawns as I'm planning an upcoming LAN party to test my mod with and I want to bump up the difficulty a little ("every ship matters").

Still kinda curious why this doesn't work as expected though, because the code makes it look like it should. I'll be sure to fire this into Mantis once I have a chance.

Thanks.