• 🏆 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!

[Trigger] My units cannot move and map crashes during the game

Status
Not open for further replies.
Level 6
Joined
Jul 12, 2017
Messages
139
I have been updating my map quite a few versions already, but this happened out of nowhere. At first it was all working nicely until I hosted online on ent. Everyone desynced and crashes. When that happened, I decided to play the map on single player, but it seemed all units cannot move, and somehow stuck in one place.

I don't know what caused this, so I need your help! I'll leave my map here, very much appreciated!

P.S. Also while you're at it, I want you to take a look at death and revive trigger too. Sometime, when a hero die, they can't be revived somehow.

Uploadfiles.io - Azeroth Heroes Survival Arena.w3x
 
Level 13
Joined
Jul 15, 2007
Messages
763
As i have played this a few times i thought i would take a look.

Unfortunately the map's triggers are somewhat convoluted which makes the problem solving pretty tedious, but i did find that if you delete the Wave Spawn category the game works fine (units can move). I spent about 30 minutes trying to isolate the problem trigger(s) in that category but couldn't find anything solid.

Bizarrely i tried to use a simple DEBUG trigger (unit enters playable area, send a message to all players staying unit's name) and it did not work at all. This is the first time i have ever seen this and suggests to me that there is some kind of critical error in your map's script somewhere which has effectively broken the game. Due to you constantly creating player groups and destroying them throughout your triggers i wonder if its possible you've accidentally destroyed a default global variable (e.g. All Players), which could explain why units behave poorly when they are issued commands.

In single player the game actually crashed for me after 3 minutes.
 
Level 13
Joined
Jul 15, 2007
Messages
763
I combed through all triggers in the Wave Spawn category but couldn't really see anything insidious.. especially as most triggers are off at game start, but the fact that deleting everything in there fixes the problem suggests those triggers are either causing the problem directly or are having a bad reaction with something else.

When i was trying to find the problem i disabled most of the triggers in that category which are turned on at game start (including disabling wave 0) but the problem persisted, so i'm not really sure i'm afraid. If i get some more time later I'll undertake another investigation :p.
 
Level 10
Joined
Oct 5, 2008
Messages
355
Bizarrely i tried to use a simple DEBUG trigger (unit enters playable area, send a message to all players staying unit's name) and it did not work at all. This is the first time i have ever seen this and suggests to me that there is some kind of critical error in your map's script somewhere which has effectively broken the game

I know what causes that and this can certainly lead to very akward behaviour in your map. have you destroyed anywhere the force (allplayers)? (Name could be different, its the standard preset force which has all players in it) This can happen when you seta force = (allplayers) and then try to clean a leak and destroy that force. Normally oyu need to use set force = createforce() and add your player into that to clear that properly.

I cannot check myself, because im currently not at my own pc, but this is something which causes these type of error and can lead to an unstable game.
 
Level 13
Joined
Jul 15, 2007
Messages
763
I know what causes that and this can certainly lead to very akward behaviour in your map. have you destroyed anywhere the force (allplayers)? (Name could be different, its the standard preset force which has all players in it) This can happen when you seta force = (allplayers) and then try to clean a leak and destroy that force. Normally oyu need to use set force = createforce() and add your player into that to clear that properly.

I cannot check myself, because im currently not at my own pc, but this is something which causes these type of error and can lead to an unstable game.

This was also my thought as there are triggers like this:

  • Turn on
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerGroup1 = (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Turn Gives bounty On for (Picked player)
      • Custom script: call DestroyForce(udg_PlayerGroup1)
Which i believe inadvertently destroys All players. But gogeta55 says even with these actions disabled/changed the problem still persists so I'm not really sure what the other causes there could be.
 
Level 10
Joined
Oct 5, 2008
Messages
355
Yeah, this is exactly what i thought. (all players), in difference to many values given by the GUI Editor, a preset force and thus can be, if stored in another variable, destroyed.

I mean even if these aren't the main culprit, these need to be changed for the changes i brought up earlier.


I have been updating my map quite a few versions already, but this happened out of nowhere. At first it was all working nicely until I hosted online on ent. Everyone desynced and crashes. When that happened, I decided to play the map on single player, but it seemed all units cannot move, and somehow stuck in one place.

From how this sounds like ou have done some changes recently that caused this behaviour. Do you have other versions you could look at and compare if there are differences and changes which could cause the behaviour you described?or do you know at which occasions player dropped?

I will have acess to my pc in some days, so then i can take a look at your map.
 
Level 13
Joined
Jul 15, 2007
Messages
763
I had another quick look and found it was possible to have all wave triggers in the game by deleting other categories of triggers, which indicates to me at least that it is cross-talk between triggers that is causing your problem/crashes. With so many triggers it will be very difficult to find the problem.

My honest advice to you is to rollback to an earlier version if you can't remember what you changed that could have broken something.
 
Level 13
Joined
Jul 15, 2007
Messages
763
Honestly i have no clue why that would be the cause. Those triggers don't even fire until a hero walks into a region.

It could be because you have so many nested If, Then, Elses. Supposedly it is bad to do this but i don't remember why.

I tested the map with only your hero selection triggers present (including Hero Picked Icon triggers) and movement was normal. This leads me to still believe you have a greater problem with your map's trigger structure.

I know your map is a beta so it's fine to first create triggers in a pile of mess and then reiterate them as you get closer to release, but you should consider condensing some of them down sooner rather than later to save yourself these kind of problems and to make bug finding much easier. The categories:
  • Hero Tooltip
  • Hero Picked Icon
  • Item Recipes
  • People Leave
  • Respawn Command
Could easily be condensed down into 1-3 triggers each by using variables and a simple system.

Regarding your revive system: I would suggest swapping out your temp variables to dedicated variables (e.g. CircleUnit, CircleInteger, CircleLoc) to avoid the possibility of interference from other triggers.
 
Level 10
Joined
Oct 5, 2008
Messages
355
Could you tell what exactly you have change? Normally, this shouldn'T cause any proiblems, even without that many nested if/then/else (Although you can turn these trigger into 4 liner)

BIG Edit: Ok, i have taken a look into the map and it seems like i found the issue which is causing this.

Just too much "unit enters a region" events.


I heard that the game compares the position of units with all areas for each enters a region event and needs to decide if it has entered a region it hasn't entered before. So think of it as the game constantly running a "pick every unit in the map and do actions" trigger (although much faster and efficient to what we in our arsenal).

Now, the amount of work the game has to calculate is huge when we have an escessive amount of "enters a region" events in the map. and this is defintetly the case in this map (You got over 200 regions in the map and more of these events).

This is why we can solve the problem, like pick-a-chew with the spawn triggers and gogeta with the ion triggers, by simply deleting some of the "enters a region" events. Because you effectively reduce the amount of checks the game has to do constantly.
This also shows, why the problem only came up now. While constantly working on the map you just overshoot the threshold of these events which causes this behaviour in your newest versions now.


Honestly, i have never seen a map hitting a such huge amount that this happens, and seeing this definetively helps me keeping this in mind when i go for very large projects.


So overall, when you try to condense your events and streamline them, you should be able to have a fluid experience. And there is enough room for improvements on them.


Above that, these action:

Unit - Order (Entering unit) to Attack/move to (Position of (Random unit from (Units in (Playable map area) owned by (Random player from (All allies of Player 1 (Red))))))

leaks threefold: "Units in playable map area" leaks a unit group, "All allies of player 1" a force and "Position of ...." leaks a point.


You can really condense down many of these triggers, like you have in the "Income NEW" trigger.

If you need help, i see if i can do anything for you.
 
Last edited:
Level 6
Joined
Jul 12, 2017
Messages
139
Well, that helps quite a lot. I thought that if I did follow everything here >>> Things That Leak, it would help me, but it seems there is still much for me to learn. Well, that's income trigger, I didn't make it. I have someone else did it for me as well as "Death and Revive System". But as this map has -repick system, when u repick a hero, it seemed this trigger ignore it and only put the first hero each player picked as the main one and didn't give repicked hero a revive trigger (If they get revived, they won't resurrect). Wonder if you know anymore thing about this, my helper didn't respond about that info yet though, so maybe you could help with this?

Sorry for asking too much though.
 
Level 10
Joined
Oct 5, 2008
Messages
355
Well, there is always much to learn, so this is more something positive. I can take a look at the triggers and adjust them so they work together. Expect it in a few days :)

Also, i would really like you to learn how to work with loops. With them you can merge your triggers to great result. I will link one or two tutorials in the edit soon.
 
Status
Not open for further replies.
Top