• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Crash] Frequent Crashes in Multiplayer

Status
Not open for further replies.
Level 6
Joined
Jul 1, 2012
Messages
188
When playing online the game crashes frequentely. Both the case where everyone crashes, and individual crashes.

I gladly take any advice on how how to make triggers cause less lag. But my main concern is the triggers that make the game crash.

If you need any further information just ask.

Thanks for reading things
Linkin
 

Attachments

  • AC Reborn 0.71.w3x
    8.4 MB · Views: 38
Level 39
Joined
Feb 27, 2007
Messages
5,010
You need to be more specific: what happens immediately before the crash? Can you repeat the crash with a certain series of actions? Your map has many triggers.
  • Read this, internalize it, apply it to every map you make: Things That Leak

  • You leak a lot of points. Something like this can potentially leak up to 12 points every time it is checked:
    • Or - Any (Conditions) are true
      • Conditions
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching ((((Matching unit) is A town-hall-type unit) Equal to True) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Settlement) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to City) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Town) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Fort) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Garrison) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Town (England)) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Settlement (England)) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to City (England)) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Settlement (Nordic)) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Hojo Garrison) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
        • (Number of units in (Units within 500.00 of (Position of (Constructing structure)) matching (((Unit-type of (Matching unit)) Equal to Hojo Fort) and ((Matching unit) Not equal to (Constructing structure))))) Greater than or equal to 1
  • I wouldn't destroy your initialization triggers with DestroyTrigger(GetTriggeringTrigger()); you don't gain much from it and I believe I remember something about destroying triggers being funky. In any case you don't even do it consistently for all your init triggers.

  • The "Income" and "Ship N City Upkeep Income" triggers should use Time - income expires as their events, since you've already made the timer that does that.

  • In Income you are improperly destroying groups inside the loop. It needs to be destroyed after the loop (outside of it).

  • In general you would be able to simplify your triggers greatly if you used array variables with each index [1]..[24] corresponding to different players. Then you can loop over the array instead of having a different named variable for each player. Most of the triggers under the Economy category are just... yikes level of unnecessary code.
  • You never, ever need to use Do Nothing. It's pointless, just literally don't put anything there if you want to do nothing.

  • You leak lots of groups in your income triggers with things like:
    • Player Group - Pick every player in Dutch and do (Actions)
      • Loop - Actions
        • Unit Group - Pick every unit in (Units owned by (Picked player) of type |cffffa500Amsterdam|r) and do (Actions)
          • Loop - Actions
            • Player - Add 300 to (Owner of (Picked unit)) Current gold
  • You also leak lots of locations in income triggers with things like: Unit - Create 2 Spearbearer (Chinese/Korea) for Ayutthaya at (Center of AyutthayaStart <gen>) facing Default building facing degrees
  • All the 'capture mechanics' triggers leak locations: Unit - Create 1 (Unit-type of (Dying unit)) for (Owner of (Killing unit)) at (Position of (Dying unit)) facing Default building facing degrees
  • The "Plantations Wrong Tile" trigger leaks locations: ((Unit-type of (Constructed structure)) Equal to Native Plantations) and ((Terrain type at (Position of (Constructed structure))) Not equal to Sunken Ruins - Grassy Dirt)
  • The plantations trigger also leaks Player Groups (forces): Game - Display to (All players matching ((Owner of (Constructed structure)) Equal to (Matching player))) the text: It is not the good... Instead of "Display text to force" you can use "display text to player".

  • Some of the triggers in "Diplomacy" and "Names" have duplicate events.

  • Every trigger in the "Faction System" category leaks a lot of locations with things like Center of SomeRegion <gen>. These would also benefit massively from using array variables for player names, or names of colors, etc.

  • All but the Native triggers in Faction System leak unit groups:
    • Unit Group - Pick every unit in (Units of type |cffff69b4Rewel|r) and do (Actions)
      • Loop - Actions
        • Unit - Change ownership of (Picked unit) to (Owner of (Triggering unit)) and Change color
  • A vast majority of your triggers could be improved in efficiency by saving things like Owner of (Triggering Unit) or Unit-type of (Triggering Unit) or (Triggering Unit) into variables at the start of the trigger and then referencing those variables throughout the trigger.

  • "Guide Names" leaks lots of locations.

  • All of your Travel triggers leak locations: Unit - Move (Triggering unit) instantly to (Random point in AsiaFromAfrica <gen>)
  • "Mauling" leaks locations: Unit - Create 1 Slave (Lumberer) for (Owner of (Killing unit)) at (Position of (Triggering unit)) facing Default building facing degrees
  • "Spawn 2 Ashigaru" leaks two locations. (Rally point of <unit> as a point) is a leak that shows up in other triggers too.
    • Then - Actions
      • Unit - Create 1 (Unit-type of (Trained unit)) for (Owner of (Trained unit)) at (Position of (Trained unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack-Move To (Rally-Point of (Triggering unit) as a point)
  • All of your Banner triggers leak many locations and incorrectly destroy the group inside of the group loop rather than after it.


I didn't see anything that immediately jumped out to me as "causes a crash" so more information will be needed to narrow it down.

It's possible that something like Player - Set the current research level of Ranged Attack (Tier 2) to ((Current research level of Ranged Attack (Tier 2) for (Triggering player)) + 1) for (Triggering player) is causing crashes by trying to set an upgrade level higher than the highest possible level. But I don't know for sure that it would actually crash. You can use Min(<whatever the max is>, ((Current research level of Ranged Attack (Tier 2) for (Triggering player)) + 1)) to always pick the lower of the two values if it goes over the highest possible tech level.
 
Status
Not open for further replies.
Top