Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: how the heck is my map lagging
how the heck is my map lagging
Nov 13 2009, 11:44 pm
By: PearS  

Nov 13 2009, 11:44 pm PearS Post #1



My age of empires map runs fine when i test it by myself but its laggy with four people in the game. All the triggers consist of are conditions regarding 'bring unit to location' and replacing units. I even changed the Age gas limits from 'always set to 150' to 'set to 150 when player has at most 149' so it isn't constantly firing. The map runs hypers but i'm having trouble fixint his lag issue.

This is the map thread if you want to check the game out

http://www.staredit.net/topic/8971/

thanks yall



None.

Nov 14 2009, 12:23 am rockz Post #2

ᴄʜᴇᴇsᴇ ɪᴛ!

Modifying death counts, and other simple "invisible" values (like 4 byte values) don't lag. When you constantly modify a lot of units (each unit takes up 336 bytes), you'll end up with some serious lag. Ordering, moving, and creating/removing units creates lag. Have you looked at the test map for lag?

These only lag for people with a)slow connections, or b)slow computers.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Nov 14 2009, 12:27 am scwizard Post #3



Lag has several causes. If it's lag due to running out of CPU power (which was a serious problem in old versions of astrogears for instance), then it should lag with even a single player if you have a slow computer.

If you have a fast computer, you're playing a map like that with four players, and one of those four players has a slow computer, that will also cause lag.

Lag is also caused by high latency between the players in the game. So if it takes a packet half a second to get from player 2's computer to player 3's computer, then everyone will experience lag.

What makes you think the lag in this case is being caused by the map and not by the players?



None.

Nov 14 2009, 12:41 am PearS Post #4



i think it is the map because i've played 1v1 with a few people. But when i get them all into the same game....sluggish as all hell. I had recently added a way to upgrade pylons which act as walls. to make this viable i had to give the pylons shields and w/o the upgrade the shields are set to zero. I guess this could make the lag...although there are only 6 pylons when the game first starst and it is laggy from there on.

I understand how moving, creating, and removign units could make lag but should this lag occur as soon as the map starts (before anyone is even at the point of building units that get removed and replaced by another unit)?

also i've played and hosted other maps without a problem but this one is being a pain.

ill take a look at this lag map. is it in the dldb?



None.

Nov 14 2009, 12:43 am scwizard Post #5



Quote from PearS
also i've played and hosted other maps without a problem but this one is being a pain.
With those same 3 other people?

If the lag starts immediately, and doesn't change based on how hard the map is working, then my guess would be that one of the people in your group conflicts with one of the other people in your group.

Also in terms of latency, when there's two players there's never lag.

I'm going to host the map on battlenet now and tell you if I experience any lag.



None.

Nov 14 2009, 12:48 am scwizard Post #6



Yup, it's your map for sure.



None.

Nov 14 2009, 12:51 am scwizard Post #7



Found your problem. Pretty much every one of your triggers has two or three give actions. Give actions lag like heck, avoid them if at all possible!



None.

Nov 14 2009, 1:03 am PearS Post #8



dang ya i figured it was the map. i mean i dont see that many gives man. they are used in the random locations thing...because when i used create it would create units for players that weren tin the game and i couldnt remove them w/ neutral/neutral players triggers for some reason. Also give is used when ppl purchase technologies that are represented by powerups and resource chunks because as i'm aware you cant create them with triggers. there are however an assload of create/remove actions in most triggers which seem to be laggy as well according to Tux's map.

so i'm just boned and the map is worthless pretty much.......

sigh



None.

Nov 14 2009, 1:07 am scwizard Post #9



Quote
Also give is used when ppl purchase technologies that are represented by powerups and resource chunks because as i'm aware you cant create them with triggers
Instead of using giving powerups to represent such a thing, you can use daethcounts. That would be like 10000x faster than giving powerups.



None.

Nov 14 2009, 1:13 am PearS Post #10



ya i could totally do that. origionally i was using switches but decided to do a bring to location thing so i would only have to do the triggers once instead of once for each player. but counts could work too. ARG retriggering is such a pain. I dont know if i shoudld even bother....could be a lot of work for something that proably wouldnt solve the problem..

but i guess i should keep at it in stead of just quitting because it is ilke done and 75% balanced !

thanks for the help yall



None.

Nov 14 2009, 1:18 am scwizard Post #11




This trigger is probably the prime example of what's making your map lag.

Instead of saying something like:
Current player has suffered exactly 0 deaths of Chinese
Current player has suffered exactly 1 deaths of horse collar

You're using units to keep track of variables. This is just straight up bad practice. Using death counts like that would make the conditions not lag even the tiniest bit.

Then for the actions, you have like three give actions, this wouldn't be such a problem if this trigger wasn't running EVERY CYCLE. Like 15 give actions per cycle, multiplied by 4 players will bring your map to a halt pretty much immediately.

Finally you have full speed hyper triggers. Is there any good reason that you NEED your triggers to run 12 times a second? Cutting your hypers down to running four times a second is a quick fix that's likely to drastically reduce lag. With your map though, I don't think it would be enough. You need to completely refactor.

Completely refactor does NOT mean give up in despair and never map again, it means that you have a good base of a good map, and if you restructured it to run more smoothly and efficiently, then you could eventually end up with an enjoyable map people can play on battlenet together.

It will be retriggering, you will be rewriting a lot from scratch, and it will take a very long time. However look at it this way, it is guaranteed to fix your problem, and it will take less time than making what you'd made from scratch took.



None.

Nov 14 2009, 1:25 am scwizard Post #12



Ok I looked over your triggers some more. You actually don't really have that many gives, I'm just paranoid about them.

It's just the sheer number of unnecessary brings that's probably causing the lag.



None.

Nov 14 2009, 1:31 am PearS Post #13



Ya thanks guys. Really the only reason i put hypers in is because i hate when you play gas set maps and you spam a unit and you run out of gas because it doesnt refresh the gas soon enough. i could trim that down. I'm starting to reconfigure with death counts. honestly i dont think it will take too long. maybe like 4 days. but ima get on it because i want this map to work....

Yall are a great help!



None.

Nov 14 2009, 1:37 am scwizard Post #14



Hmm, that is a good reason for wanting max speed hypers.

There's an alternative to gas setting though. If you don't want the player to make zealots, you can just go:
Has suffered at most 50 deaths tech
Brings at least one zealot to anywhere
--
Remove 1 zealot from anywhere for current player
Set resources for current player add 20 ore

Instead of:
Has suffered at most 50 deaths of tech
Current player has at most 1 gas
--
Set gas to 2 for current player

I'd actually say that the alternative system is faster, because in that case the trigger will only fire if the player creates a zealot (which they shouldn't be doing since they can't create zealots yet, whereas the triggers for the other system will fire whenever the player builds any unit.

And if you factor into this, the fact that you don't need full speed hypers under the alternative system, it makes it so that it's much faster.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:27 am]
m.0.n.3.y -- Maybe because it's an EUD map?
[03:27 am]
m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
[2024-4-25. : 7:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
Please log in to shout.


Members Online: Moose, Roy