Author Topic: Mission 2 - The Strike  (Read 10064 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Mission 2 - The Strike
As promised, here is the the first mission I've converted to multiplayer. It might be a little rough around the edges but it should be playable. The mission should support up to 12 players at one time (and I'd be very interested to see if the game can actually handle that many players correctly).

You'll need to have patch 1.1 installed. You'll need to download this 7zip file and extract it to your Diaspora folder. Then run the launcher. Go to the mods tab and activate the Diaspora Multiplayer Beta option. Then go to the Basic Settings tab and make sure you select the FS2 Open 3.7.1 executable (Games will not work with the patch 1.1 exes!).

Once running a multiplayer game, you should now see a new mission called The Strike.

I need people to playtest the mission as much as possible. The kind of feedback I need include.

1) Did the tube launches work correctly? In order to make them work in multiplayer, the tube launch section of the mission was completely rewritten. The game now uses a scripting system designed by m|m and a new SEXP coded by myself in order to work in multiplayer. It's possible that one or the other has bugs still. Especially when it comes to the other players or the AI (it should work for Player 1).

2) Did combat landings work correctly? These have been reported as a source of error since patch 1.1 and again the events to handle combat landings have been rewritten somewhat.

3) Is the mission too hard or too easy for the number of players you played with. What difficulty did you play on? How skilled are the players at Diaspora? Did you change the number of respawns? What would be a good number of respawns to default to?

4) Was there any issues with lag or the underlying netcode?

5) Does the mission perform correctly when played on a standalone? Does it work when a player is also on the server?

6) Any other details you can give me will help.

I'm going to start work on converting the other missions, but the feedback from this one is very important in helping me balance things and get everything working correctly right from the start. More details on the plans for the Open Beta itself can be found here. So can we keep discussion on this thread to this particular mission please.

For any coders trying this out (or anyone on Linux who needs to make their own builds) here is a patch against r10467.

Code: [Select]
Index: code/parse/sexp.cpp
===================================================================
--- code/parse/sexp.cpp (revision 10465)
+++ code/parse/sexp.cpp (working copy)
@@ -677,6 +677,7 @@
  { "damaged-escort-priority-all", OP_DAMAGED_ESCORT_LIST_ALL, 1, MAX_COMPLETE_ESCORT_LIST, SEXP_ACTION_OPERATOR, }, // Goober5000
  { "set-support-ship", OP_SET_SUPPORT_SHIP, 6, 7, SEXP_ACTION_OPERATOR, }, // Goober5000
  { "script-eval", OP_SCRIPT_EVAL, 1, INT_MAX, SEXP_ACTION_OPERATOR, },
+ { "multi-eval", OP_SCRIPT_EVAL_MULTI, 2, INT_MAX, SEXP_ACTION_OPERATOR, },
  { "debug", OP_DEBUG, 2, 2, SEXP_ACTION_OPERATOR, }, // Karajorma
  { "do-nothing", OP_NOP, 0, 0, SEXP_ACTION_OPERATOR, },
 
@@ -21269,7 +21270,7 @@
 }
 
 //WMC - This is a bit of a hack, however, it's easier than
-//coding in a whole new SCript_system function.
+//coding in a whole new Script_system function.
 int sexp_script_eval(int node, int return_type)
 {
  int n = node;
@@ -21304,6 +21305,97 @@
  return r;
 }
 
+void sexp_script_eval_multi(int node)
+{
+ char s[TOKEN_LENGTH];
+ bool success = true;
+ int execute_on_server;
+ int sindex;
+ player *p;
+
+ strcpy_s(s, CTEXT(node));
+
+ node = CDR(node);
+
+ execute_on_server = is_sexp_true(node);
+
+ node = CDR(node);
+
+ multi_start_callback();
+ multi_send_string(s);
+ // evalutate on all clients
+ if (node == -1) {
+ multi_send_bool(true);
+ execute_on_server = 1;
+ }
+ // we have to send to all clients but we need to send a list of ships so that they know if they evaluate or not
+ else {
+ multi_send_bool(false);
+
+ do {
+ p = get_player_from_ship_node(node, true);
+
+ // not a player ship so skip it
+ if (p == NULL ){
+ node = CDR(node);
+ continue;
+ }
+ else {
+ // if this is me, flag that we should execute the script
+ if (p == Player) {
+ execute_on_server = 1;
+ }
+ // otherwise notify the clients
+ else {
+ sindex = ship_name_lookup(CTEXT(node));
+ multi_send_ship(sindex);
+ }
+ }
+
+ node = CDR(node);
+ } while (node != -1);
+ }
+
+ multi_end_callback();
+
+ if (execute_on_server) {
+ success = Script_system.EvalString(s, NULL, NULL, s);
+ }
+
+ if(!success) {
+ Warning(LOCATION, "sexp-script-eval failed to evaluate string \"%s\"; check your syntax", s);
+ }
+}
+
+void multi_sexp_script_eval_multi()
+{
+ int sindex;
+ char s[TOKEN_LENGTH];
+ bool sent_to_all = false;
+ bool success = true;
+
+ multi_get_string(s);
+ multi_get_bool(sent_to_all);
+
+ if (sent_to_all) {
+ success = Script_system.EvalString(s, NULL, NULL, s);
+ }
+ // go through all the ships that were sent and see if any of them match this client.
+ else {
+ while (multi_get_ship(sindex)) {
+ Assertion(sindex >= 0, "Illegal value for the ship index sent in multi_sexp_script_eval_multi()! Ship %d does not exist!", sindex);
+ if (Player->objnum == Ships[sindex].objnum) {
+ success = Script_system.EvalString(s, NULL, NULL, s);
+ }
+ }
+ }
+
+ if(!success) {
+ Warning(LOCATION, "sexp-script-eval failed to evaluate string \"%s\"; check your syntax", s);
+ }
+}
+
+
 void sexp_force_glide(int node)
 {
  ship *shipp;
@@ -23987,6 +24079,11 @@
  case OP_SCRIPT_EVAL:
  sexp_val = sexp_script_eval(node, OPR_NULL);
  break;
+
+ case OP_SCRIPT_EVAL_MULTI:
+ sexp_script_eval_multi(node);
+ sexp_val = SEXP_TRUE;
+ break;
 
  case OP_CHANGE_IFF_COLOR:
  sexp_change_iff_color(node);
@@ -24407,6 +24504,10 @@
  multi_sexp_set_ets_values();
  break;
 
+ case OP_SCRIPT_EVAL_MULTI:
+ multi_sexp_script_eval_multi();
+ break;
+
  // bad sexp in the packet
  default:
  // probably just a version error where the host supports a SEXP but a client does not
@@ -25010,6 +25111,7 @@
  case OP_SET_SECONDARY_WEAPON:
  case OP_SET_NUM_COUNTERMEASURES:
  case OP_SCRIPT_EVAL:
+ case OP_SCRIPT_EVAL_MULTI:
  case OP_ENABLE_BUILTIN_MESSAGES:
  case OP_DISABLE_BUILTIN_MESSAGES:
  case OP_LOCK_PRIMARY_WEAPON:
@@ -27037,6 +27139,14 @@
  case OP_SCRIPT_EVAL:
  return OPF_STRING;
 
+ case OP_SCRIPT_EVAL_MULTI:
+ if (argnum == 0)
+ return OPF_STRING;
+ else if (argnum == 1)
+ return OPF_BOOL;
+ else
+ return OPF_SHIP;
+
  case OP_CHANGE_IFF_COLOR:
  if ((argnum == 0) || (argnum == 1))
  return OPF_IFF;
@@ -28796,6 +28906,7 @@
  case OP_DAMAGED_ESCORT_LIST_ALL:
  case OP_SET_SUPPORT_SHIP:
  case OP_SCRIPT_EVAL:
+ case OP_SCRIPT_EVAL_MULTI:
  return CHANGE_SUBCATEGORY_OTHER;
 
  case OP_NUM_SHIPS_IN_BATTLE:
@@ -32392,17 +32503,25 @@
  },
 
  {OP_SCRIPT_EVAL_STRING, "script-eval-string\r\n"
- "\tEvaluates script to return a string"
+ "\tEvaluates script to return a string\r\n\r\n"
  "Takes 1 argument...\r\n"
  "\t1:\tScript\r\n"
  },
 
  {OP_SCRIPT_EVAL, "script-eval\r\n"
- "\tEvaluates script"
+ "\tEvaluates script\r\n\r\n"
  "Takes at least 1 argument...\r\n"
  "\t1:\tScript to evaluate\r\n"
  },
 
+ {OP_SCRIPT_EVAL_MULTI, "multi-eval\r\n"
+ "\tEvaluates script\r\n\r\n"
+ "Takes at least 2 arguments...\r\n"
+ "\t1:\tScript to evaluate\r\n"
+ "\t2:\tTrue/False - Should the script evaluate on the server?\r\n"
+ "\t(rest):\tList of players who should evaluate this script. If no player is given, all clients will execute the script\r\n"
+ },
+
  {OP_FORCE_GLIDE, "force-glide\r\n"
  "\tForces a given ship into glide mode, provided it is capable of gliding. Note that the player will not be able to leave glide mode on his own,, and that a ship in glide mode cannot warp out or enter autopilot."
  "Takes 2 Arguments...\r\n"
Index: code/parse/sexp.h
===================================================================
--- code/parse/sexp.h (revision 10465)
+++ code/parse/sexp.h (working copy)
@@ -719,6 +719,7 @@
 #define OP_SET_ETS_VALUES (0x0023 | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG) // niffiwan
 #define OP_CALL_SSM_STRIKE (0x0024 | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG) // X3N0-Life-Form
 #define OP_SET_MOTION_DEBRIS (0x0025 | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG)    // The E
+#define OP_SCRIPT_EVAL_MULTI (0x0026 | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG) // Karajorma
 
 // defined for AI goals
 #define OP_AI_CHASE (0x0000 | OP_CATEGORY_AI | OP_NONCAMPAIGN_FLAG)




[attachment deleted by an evil time traveler]
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline bunik

  • 22
Re: Mission 2 - The Strike
hi! with my friend up standalone server. starting dogfight mission(v3.7.1) - its OK! but if launch any coop-mission - server is dawn or game crash!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Mission 2 - The Strike
Try running the standalone in debug mode and tell me what kind of error message you get. You may get a few warnings you can click through by choosing No first.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Echelon9

  • 210
Re: Mission 2 - The Strike
Yes, we'd be very interested in any detailed error reports from the standalone server with this mission.

 

Offline bunik

  • 22
Re: Mission 2 - The Strike
Try running the standalone in debug mode
you have little manual for this?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Mission 2 - The Strike
Basically go to the Diaspora folder and click on the file called fred2_open_Diaspora_R1_Debug. You will then find a file in Data called fs2_standalone.log or fs2_open.log. Get me a copy of that file. It will hopefully allow us to figure out what is causing your crashes.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline bunik

  • 22
Re: Mission 2 - The Strike
logs -

[attachment deleted by an evil time traveler]

 

Offline Echelon9

  • 210
Re: Mission 2 - The Strike
logs -

Is triggering from an Assertion() within the code base. See below for extract but I will take a look.

Code: [Select]
ASSERTION: "chunk_type == OP_DEFPOINTS" at modelcollide.cpp:735

 

Offline Geallen

  • 24
    • Skype
    • Steam
    • Twitter
Re: Mission 2 - The Strike
I have ran into a problem myself.

The tube launch works when I put Alpha 1 into a tube, attached via pod. The launch goes smoothly, then my controls are frozen going at the speed of 0. I tried to fix this by putting a event chained under the Launch that set Alpha 1 mobile. However when I do this the ship exponentially increases its speed towards FTL standards and crashes the game.

No errors were encountered aside from the crash.

PS: multi mode was Coop

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Mission 2 - The Strike
Is this when making your own missions or with Mission 2?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Geallen

  • 24
    • Skype
    • Steam
    • Twitter
Re: Mission 2 - The Strike
Its when I'm making my own missions from scratch. I just have a fade in, a message is sent. Then the Viper is launched.

Edit: I thought this topic appropriate since the Multi-beta DL-link is on this topic.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Mission 2 - The Strike
If you want, I can take a look at the mission. Or you can just post the SEXPs involved in the launch.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Geallen

  • 24
    • Skype
    • Steam
    • Twitter
Re: Mission 2 - The Strike
This is the SP version wherein I test stuff. So its only meant to accommodate one player. I didn't put any triggers/timers on it to trigger it yet, because I just wanted to see that it worked.

$Formula: ( when
   ( true )
   ( do-nothing )
   ( multi-eval
      "tblParShip('BS Dalliance')"
      ( true )
   )
   ( multi-eval
      "tblSelDock('Stbd Tube1')"
      ( true )
   )
   ( multi-eval
      "tblSelShip('Alpha 1')"
      ( true )
   )
   ( multi-eval
      "tblLaunch('Alpha 1')"
      ( true )
   )
)
+Name: Tube Launch Alpha 1
+Repeat Count: 1
+Interval: 1
+Chained: 5

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Mission 2 - The Strike
Try having two events instead and putting a delay between the events with the docking and the launch.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Geallen

  • 24
    • Skype
    • Steam
    • Twitter
Re: Mission 2 - The Strike
I get an error now whenever I try to launch. I took your suggestion and put it up intwo different parts. First I chained the launch part with no delay to the first scipts. Then I unchained it. When I break into debugger mode I just have no sound or camera shake, but have the same results as when I didn't run into an error.

This was the same error as to when I didn't have the data needed. Also was the same for both failed script executions. Will put a DL link up soon. The mission itself isn't really filled to the brim with events as I've been working to make my first complete.

http://www.sendspace.com/file/ba0emr

Could not find index 'Player' in type 'HookVariables'

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name:      (null)
Name of:   (null)
Function type:   (null)
Defined on:   0
Upvalues:   0

Source:      (null)
Short source:   
Current line:   0
- Function line:   0
------------------------------------------------------------------


------------------------------------------------------------------

stack traceback:
   [C]: ?
   [string "tubeLaunch-sct.tbm - On Gameplay Start"]:132: in function 'processLaunchStartDef'
   [string "tubeLaunch-sct.tbm - On Gameplay Start"]:113: in function 'processTubeDef'
   [string "tubeLaunch-sct.tbm - On Gameplay Start"]:100: in function 'onFrame'
   [string "Simulation"]:2: in main chunk
------------------------------------------------------------------

1: Userdata [HookVariables]
2: String [Player]
------------------------------------------------------------------

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Mission 2 - The Strike
I believe there's a scripting bug (feature?) where some HookVariables aren't initialised on the 1st gameplay frame.  Try delaying the tubelaunch by 1 sec, maybe with ( has-time-elapsed 1 )?
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Geallen

  • 24
    • Skype
    • Steam
    • Twitter
Re: Mission 2 - The Strike
Well now I'm having the problems I first had. It launches then player control isn't given back. Also really weird, even though my HUD tells me I am going 0/ms when I check my distance to the Dalliance it is increasing fast. I mean really fast, give it half a minute or so and you are over 20000 meters from the Dalliance.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Mission 2 - The Strike
That sounds a bit like a code bug that was fixed recently.  Which version of Diaspora are you using?
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Geallen

  • 24
    • Skype
    • Steam
    • Twitter
Re: Mission 2 - The Strike
1.1, using the data file provided by this link, and 3.7.1 provided to me by karajorma on a thread I posted.

Link to build I'm using: http://diaspora.fs2downloads.com/Multiplayer_Beta_Patch_1.1_Builds.7z

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Mission 2 - The Strike
OK - that's me out of ideas for now. If I get a chance in the next few days I'll see if I can reproduce the issue on my PC.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...