Question about Lag Spike

Level 12
Joined
Mar 30, 2013
Messages
668
Hello.

Im creating an game called The Legions Defence.
The game can be played with; 2v2v2v2.
The game is about building towers and sending creeps.
So when we are full house and starting the game and after 5 mins of in-game game time the lag spike is huge. Because there are way too many units on the map.
But when its; 1v1v1v1
And we send a lot, the lag ain't there.

So, does some one know how to fix this? If not i got a huge problem! :/
-Duty out
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,639
Please better describe your lag. Is this latency/waiting for player sort of lag? Or is it 0/low FPS lag?

Latency lag would be caused by commands creating net traffic or if the host is on dial up. FPS sort will be caused by per-player periodic leaks or badly scaling with player algorithms.
 
Level 11
Joined
Jul 25, 2014
Messages
490
Do you clean location/group leaks when you spawn units? They may be the main source of the problem due to mulitple locations being set up because of full house players -> locations are never removed -> permanent memory space used up -> the memory stacks up -> lag.
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,639
Do you clean location/group leaks when you spawn units? They may be the main source of the problem due to mulitple locations being set up because of full house players -> locations are never removed -> permanent memory space used up -> the memory stacks up -> lag.
Using more virtual address space does not make the game run slower. It runs slower due to the leaks having algorithmic overhead. Best example is strings where after creating enough even a single string operation can cause frames to be dropped due to the hashtable used to prevent duplicate strings starting to degrade towards O(n) complexity.
 
Level 12
Joined
Mar 30, 2013
Messages
668
So what exactly do you need? Like the movements or when players send creeps?

But i got another questions. When 1 players builds the Hero Tower. And when someone else is trying to build theirs, they cant. It looks like it is only 1 players that can build his hero, and when he has builded it, it looks like it becomes invisible for the others when they want to build theirs. Triggers below.
  • Hero Construction
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cffff0000The Juggernaut|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cffff0000The Juggernaut|r Unavailable for training/construction by (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cFF0080FFThe Captain|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cFF0080FFThe Captain|r Unavailable for training/construction by (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cff8a2be2Daemonic King|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cff8a2be2Daemonic King|r Unavailable for training/construction by (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cffffd700Orc Lord|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cffffd700Orc Lord|r Unavailable for training/construction by (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cff7fff00The Warden|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cff7fff00The Warden|r Unavailable for training/construction by (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cffff1493Damned Princess|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cffff1493Damned Princess|r Unavailable for training/construction by (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cff00ffffIce Lord|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cff00ffffIce Lord|r Unavailable for training/construction by (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to |cffdeb887Creep Lord|r
        • Then - Actions
        • Else - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make |cffdeb887Creep Lord|r Unavailable for training/construction by (Picked player)
23.04.2016; Please reply!
 
Last edited:

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,639
The trigger looks like it is working as intended? It should be disabling the training/construction of towers of a certain type for all players once a single player finishes building one.

To stop players from finishing such towers once another player builds one (and it is disabled for them) you will need to forcefully cancel its construction otherwise after the foundation is placed they may be able to build it to completion.
 
Level 12
Joined
Mar 30, 2013
Messages
668
The thing is that when for an example YOU are building your Hero tower. And it has finished construction. And then i as another player want to build my Hero tower, but i cant since you have already built it.
It looks like when one player builds the hero tower, the other players hero towers is being removed because you have build your Hero tower.
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,639
The thing is that when for an example YOU are building your Hero tower. And it has finished construction. And then i as another player want to build my Hero tower, but i cant since you have already built it.
It looks like when one player builds the hero tower, the other players hero towers is being removed because you have build your Hero tower.
Yes which is exactly what the trigger does, except it might not remove already in construction towers of the other players.

If you want to limit it for the building player only then remove the pick every player loop and replace picked player with owner of triggering unit. Alternatively at map initialization limit training of all those unit types to 1 so only 1 may ever be built.
 
Level 3
Joined
Dec 19, 2015
Messages
43
If you have a spawn trigger, it would be very helpful as I assume it is periodic. If you are able to use the "movement" trigger multiple times or in short succession, that one would be worth posting as well. Trigger leaks can be devastating in this type of map.
 
Level 12
Joined
Mar 30, 2013
Messages
668
The map is this: http://www.hiveworkshop.com/forums/map-development-202/legions-defence-249495/
I got an picture of the entire map.

Back to business.
Here is an picture;
227524-albums6507-picture108229.png
 

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,639
The Create Unit actions.

Instead of passing a new location object as an argument, assign it to a variable, pass the variable's contents as an argument then remove the location with RemoveLocation.

Like i said earlier, i did not make these triggers.
Neither did I, that still does not stop one from seeing the leaks.
 
Top