Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
starscr3am77

Registered:
Posts: 5
Reply with quote  #1 
I am trying to create a simple 15 minute scripted scenario where the players have to destroy 6 ships in succession. After a few minutes the game gets choppy then the clients disconnect from the server. The computers are all in the same house so connectivity shouldn't be an issue and like I mentioned, it runs great the first few minutes which makes me believe something is wrong with my script. Here is my scenario, any help would be greatly appreciated!


<mission_data version="1.0" background_id_arme="73cf9f00-9fc5-4a2a-9c29-0eda64437a24" playerShipNames_arme="Artemis\Intrepid\Aegis\Horatio\Excalibur\Hera\Ceres\Diana">
  <start id_arme="73cf9f00-9fc5-4a2a-9c29-0eda64437a24">
    <create type="player" x="50000.0" y="0.0" z="50000.0" angle="0" name="B.S. Entertainment" sideValue="2" raceKeys="Federation" hullKeys="Dreadnought" />
    <create type="enemy" x="50000.0" y="0.0" z="36000.0" angle="180" name="X2" raceKeys="Gorgonite enemy" hullKeys="Cruiser small" sideValue="0" fleetnumber="33" />
    <set_special name="X2" ship="2" captain="-1" />
    <add_ai type="POINT_THROTTLE" value1="50000.0" value2="0.0" value3="49500.0" value4="3.0" name="X2" />
    <create type="enemy" x="30000.0" y="0.0" z="30000.0" angle="180" name="X7" raceKeys="Gorgonite enemy" hullKeys="Cruiser small" sideValue="0" fleetnumber="33" />
    <set_special name="X7" ship="2" captain="-1" />
    <create type="enemy" x="70000.0" y="0.0" z="20000.0" angle="180" name="Y4" raceKeys="Gorgonite enemy" hullKeys="Cruiser small" sideValue="0" fleetnumber="33" />
    <set_special name="Y4" ship="2" captain="-1" />
    <create type="enemy" x="90000.0" y="0.0" z="50000.0" angle="180" name="Y10" raceKeys="Gorgonite enemy" hullKeys="Cruiser small" sideValue="0" fleetnumber="33" />
    <set_special name="Y10" ship="2" captain="-1" />
    <create type="enemy" x="50000.0" y="0.0" z="70000.0" angle="180" name="Z1" raceKeys="Gorgonite enemy" hullKeys="Cruiser small" sideValue="0" fleetnumber="33" />
    <set_special name="Z1" ship="2" captain="-1" />
    <create type="enemy" x="40000.0" y="0.0" z="15000.0" angle="180" name="Z6" raceKeys="Gorgonite enemy" hullKeys="Cruiser small" sideValue="0" fleetnumber="33" />
    <set_special name="Z6" ship="2" captain="-1" />
    <set_variable name="X2 Destroyed" value="0.0" />
    <set_variable name="X7 Destroyed" value="0.0" />
    <set_variable name="Y4 Destroyed" value="0.0" />
    <set_variable name="Y10 Destroyed" value="0.0" />
    <set_variable name="Z1 Destroyed" value="0.0" />
    <set_variable name="Z6 Destroyed" value="0.0" />
    <set_variable name="Intro" value="1.0" />
    <set_timer name="Intro" seconds="15" />
    <set_timer name="Game_Timer" seconds="900" />
    <set_variable name="3_Minute_Warning" value="1.0" />
    <set_timer name="3_Minute_Warning" seconds="720" />
    <set_variable name="Time_Up" value="1.0" />
    <set_timer name="Time_Up" seconds="840" />
    <set_timer name="Reload" seconds="20" />
    <set_variable name="Enemies_Dead" value="1.0" />
    <set_difficulty_level value="1" />
    <set_skybox_index index="10" />
    <set_object_property property="nebulaIsOpaque" value="0" />
    <set_object_property property="sensorSetting" value="1" />
    <set_object_property property="nonPlayerShield" value="40" />
    <set_object_property property="nonPlayerWeapon" value="40" />
    <set_object_property property="playerWeapon" value="300" />
    <set_object_property property="playerShields" value="300" />
    <big_message title="Distress Call" subtitle1="B.S. Entertainment" />
    <set_timer name="start_mission_timer_1" seconds="10" />
    <set_variable name="chapter_1" value="1" />
  </start>
  <event name="Intro" id_arme="6730142a-2e86-4a82-a536-cb7de1b76f39">
    <if_variable name="Intro" comparator="EQUALS" value="1.0" />
    <if_timer_finished name="Intro" />
    <incoming_comms_text from="Federation Command" sideValue="2" type="FRIEND">Incoming Gogonites, get to your stations and defend the ship!</incoming_comms_text>
    <incoming_comms_text from="Engineering" sideValue="2" type="FRIEND">Make sure you remember the ship names, it will help our investigation. </incoming_comms_text>
    <set_variable name="Intro" value="0.0" />
  </event>
  <event name="Replenish" id_arme="e345a8b5-0fb5-4753-9ce5-09b7dd7daa3c">
    <if_timer_finished name="Reload" />
    <set_object_property property="countNuke" value="2" name="B.S. Entertainment" />
    <set_object_property property="countMine" value="6" name="B.S. Entertainment" />
    <set_object_property property="countHoming" value="8" name="B.S. Entertainment" />
    <set_object_property property="countEMP" value="8" name="B.S. Entertainment" />
    <set_object_property property="countPro" value="6" name="B.S. Entertainment" />
    <set_object_property property="countShk" value="4" name="B.S. Entertainment" />
    <set_object_property property="energy" value="1000" name="B.S. Entertainment" />
    <set_timer name="Reload" seconds="20" />
  </event>
  <event name="X2 Destroyed" id_arme="6fcd1626-6d81-4b78-a879-fc5d10a379a7">
    <if_not_exists name="X2" />
    <if_variable name="X2 Destroyed" comparator="EQUALS" value="0.0" />
    <set_variable name="X2 Destroyed" value="1.0" />
  </event>
  <event name="Move X7" id_arme="5b8bbae3-20cb-40e6-8d5c-93a92b92059e">
    <if_variable name="X2 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="X7 Destroyed" comparator="EQUALS" value="0.0" />
    <add_ai type="POINT_THROTTLE" value1="50000.0" value2="0.0" value3="49500.0" value4="5.0" name="X7" />
  </event>
  <event name="X7 Destroyed" id_arme="3b2f9eed-54f5-4af6-bf8d-39427c1dcef6">
    <if_not_exists name="X7" />
    <if_variable name="X7 Destroyed" comparator="EQUALS" value="0.0" />
    <set_variable name="X7 Destroyed" value="1.0" />
  </event>
  <event name="Move Y4" id_arme="84fc7088-48a3-4196-b44b-8b31428e74f5">
    <if_variable name="X2 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="X7 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Y4 Destroyed" comparator="EQUALS" value="0.0" />
    <add_ai type="POINT_THROTTLE" value1="50000.0" value2="0.0" value3="49500.0" value4="5.0" name="Y4" />
  </event>
  <event name="Y4 Destroyed" id_arme="f17f3452-8608-4230-863b-61377914e563">
    <if_not_exists name="Y4" />
    <if_variable name="Y4 Destroyed" comparator="EQUALS" value="0.0" />
    <set_variable name="Y4 Destroyed" value="1.0" />
  </event>
  <event name="Move Y10" id_arme="3998af71-4380-4515-9312-9925794b82fd">
    <if_variable name="X2 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="X7 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Y4 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Y10 Destroyed" comparator="EQUALS" value="0.0" />
    <add_ai type="POINT_THROTTLE" value1="50000.0" value2="0.0" value3="49500.0" value4="5.0" name="Y10" />
  </event>
  <event name="Y10 Destroyed" id_arme="93157718-60ab-4674-bc8c-e44616d60e3b">
    <if_not_exists name="Y10" />
    <if_variable name="Y10 Destroyed" comparator="EQUALS" value="0.0" />
    <set_variable name="Y10 Destroyed" value="1.0" />
  </event>
  <event name="Move Z1" id_arme="ceab89b8-157e-4d71-80be-8877fdfb2097">
    <if_variable name="X2 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="X7 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Y4 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Y10 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Z1 Destroyed" comparator="EQUALS" value="0.0" />
    <add_ai type="POINT_THROTTLE" value1="50000.0" value2="0.0" value3="49500.0" value4="5.0" name="Z1" />
  </event>
  <event name="Z1 Destroyed" id_arme="0e4936e9-7622-4087-9baa-64a47bb619e4">
    <if_not_exists name="Z1" />
    <if_variable name="Z1 Destroyed" comparator="EQUALS" value="0.0" />
    <set_variable name="Z1 Destroyed" value="1.0" />
  </event>
  <event name="Move Z6" id_arme="ccec632b-faad-4dd0-98b7-4e20e090fe6c">
    <if_variable name="X2 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="X7 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Y4 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Y10 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Z1 Destroyed" comparator="EQUALS" value="1.0" />
    <if_variable name="Z6 Destroyed" comparator="EQUALS" value="0.0" />
    <add_ai type="POINT_THROTTLE" value1="50000.0" value2="0.0" value3="49500.0" value4="5.0" name="Z6" />
  </event>
  <event name="All Ships Destroyed" id_arme="7ea889db-9d80-4e7e-a5fc-3a3312d9e762">
    <if_not_exists name="X2" />
    <if_not_exists name="X7" />
    <if_not_exists name="Y4" />
    <if_not_exists name="Y10" />
    <if_not_exists name="Z1" />
    <if_not_exists name="Z6" />
    <if_variable name="Enemies_Dead" comparator="EQUALS" value="1.0" />
    <incoming_comms_text from="Federation Command" sideValue="2" type="FRIEND">Great Work Team! All ships have been destroyed. Now focus on getting the warp drive back online.</incoming_comms_text>
    <set_variable name="Enemies_Dead" value="0.0" />
  </event>
  <event name="3 Minute Warning" id_arme="fb30f137-11ff-4b1d-bde3-cccef0a8266d">
    <if_timer_finished name="3_Minute_Warning" />
    <if_variable name="3_Minute_Warning" comparator="EQUALS" value="1.0" />
    <set_variable name="3_Minute_Warning" value="0.0" />
    <incoming_comms_text from="Federation Command" sideValue="2" type="FRIEND">The remaining ships are charging their primary weapons. You have 3 minutes to destroy them!</incoming_comms_text>
  </event>
  <event name="Time_Up" id_arme="d579e0d0-7f08-46fc-9177-22d83c1b54cd">
    <if_timer_finished name="Time_Up" />
    <if_variable name="Time_Up" comparator="EQUALS" value="1.0" />
    <set_variable name="Time_Up" value="0.0" />
    <incoming_comms_text from="Federation Command" sideValue="2" type="FRIEND">Make sure you remember the ship names, it will help our investigation. </incoming_comms_text>
  </event>
  <event name="End Game" id_arme="2bb4698f-d9ce-4fc7-8bf4-2ead4e306eb1">
    <if_timer_finished name="Game_Timer" />
    <end_mission />
  </event>
</mission_data>
Xavier Wise

Registered:
Posts: 1,060
Reply with quote  #2 
Try adding a second trigger to your replenish event e.g.



I have always found that having a single timer as an event trigger can sometimes cause issues. It might not fix it, but it is worth a shot.

Perhaps you could also separate out the replenish event into adding each type of ordnance, only if that type of ordnance is out.

__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community website
starscr3am77

Registered:
Posts: 5
Reply with quote  #3 
What kind of trigger would you suggest using? Creating a flag so that if the int for pro is 0, set to 8?
Xavier Wise

Registered:
Posts: 1,060
Reply with quote  #4 
If I have chance, I'll take a look at write something up. It's tricky to explain, and easier for me to just write.
__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community website
DizzyKungFu

Registered:
Posts: 94
Reply with quote  #5 
You could try setting networkTickSpeed in the script really low, like 20 or 40.

Looks like you are running a mod or a custom vesseldata.XML so you may want to check that for problems as well. E.g. does running a Solo game on Siege have the same problem?
Admiral Legasse

Registered:
Posts: 28
Reply with quote  #6 
Each of your move events trigger every loop the conditions are met.  The longer the simulation runs, the more gets added to the current enemy's ai stack.  Just add another variable, such as [ship name]_moving initialized to zero and set to one when the event fires.  Include the check for [ship name]_moving equals zero on each move event, and your bug should be fixed.
starscr3am77

Registered:
Posts: 5
Reply with quote  #7 
Thank you so much Admiral Legasse! That was it! No more crashing! If I could ask one more bit of advice. The first ship goes to the location and stops but the others do not. Any idea why that might be?
Admiral Legasse

Registered:
Posts: 28
Reply with quote  #8 
Quote:
Originally Posted by starscr3am77
Thank you so much Admiral Legasse! That was it! No more crashing! If I could ask one more bit of advice. The first ship goes to the location and stops but the others do not. Any idea why that might be?


I'm not really sure, have you tried reading their ai stack during playtesting?  I think if you hit F7 on the server and select the ship on the science console, it should show you what they're set to do.  

Also, I tend to be a bit paranoid with my types when it comes to numbers, so if I need to test for equality, I try to be explicit about declaring them as integers everywhere I assign or update them.
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,285
Reply with quote  #9 
Quote:
Originally Posted by Admiral Legasse


I'm not really sure, have you tried reading their ai stack during playtesting?  I think if you hit F7 on the server and select the ship on the science console, it should show you what they're set to do.  

Also, I tend to be a bit paranoid with my types when it comes to numbers, so if I need to test for equality, I try to be explicit about declaring them as integers everywhere I assign or update them.


I agree that using F7 will probably help, but honestly I am not exactly sure what the AI behind Point_Throttle does. Thom has left that somewhat opaque. It may be that once the ship has turned toward the target point it only checks to see if the ship is within a certain range of that point. If it never reaches 0 or .004 or whatever unknown threshold maybe it never adjusts course again. So if an object like another ship is already sitting at that point the ship bounces off and keeps going straight forever.

My suggestions:

Send all five ships to points close to each other but not on top of each other.
or
Add code to check their position and stop within a certain radius of the destination point.
or
Place an invisible generic object at the target point and use Target_Throttle instead of Point_Throttle. We know Target_Throttle does constantly adjust the course because the target's position may change.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.