Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Crazy lag from 'Give Units' trigger.
Crazy lag from 'Give Units' trigger.
May 22 2010, 10:28 am
By: Ranzear  

May 22 2010, 10:28 am Ranzear Post #1



Its the damn score!

I was blinking buildings to a different player so they could be used as pre-reqs for building stuff but not upgrades (by making upgrades not instant), but it was resulting in horrible game-crushing lag a few minutes after someone enabled the system, even playing alone! Even getting rid of the unit that enabled prereq buildings didn't make the lag go away, and I caught on that the only thing persistent would be the score accumulated from acquiring buildings so fast and often.

Looked at the score table after a game for once, the cpu player that the buildings were blinking to had over 90 million points from buildings alone. I added resetting of building scores to zero to one of my multitude of 'always' triggers and viola, no more lag.

Thought this might be helpful info and easily overlooked as many systems use 'kills and razings' score but oft ignore 'units constructed/created/acquired' scores and apparently the latter score running rampant (for units or buildings) causes this immense lag most apparent and mentioned in the wiki entry for grid systems.

tl;dr The lag from 'give units' triggers can be easily abated by reducing or removing the points in the 'units' or 'buildings' categories.



None.

May 22 2010, 12:50 pm Aristocrat Post #2



I remain highly skeptical of this since a larger number does not impede integer arithmetic speed for adding scores. May just be a coincidence.



None.

May 24 2010, 1:56 am Lanthanide Post #3



I concur with Aristocrat. Please post the triggers (or map) involved, and we can see if there was really something else going on. Like maybe setting your score back to 0 is preventing some other, unrelated trigger firing, and it was that trigger that was causing lag.



None.

May 25 2010, 1:50 pm Ranzear Post #4



Yup, even skeptical myself now, since I can't reproduce it in a standalone map with the bare minimum.

I'll investigate further as to if my lag is solved by doing this or not. Nothing in the map uses Buildings or Units scores directly though, just kills and razings for the cash/exp system.

I'd bid you good effing luck at finding anything in my spaghetti triggers. The map in question can be found here, particularly version 1.46+ wherein obtaining an SCV blinks building ownership to allow building of missile turrets and causing the lag attributed in the OP.

Let me give you a brief overview of everything going on in this map when it starts lagging without this qurky little 'fix' I found:

Firstly, full speed hyper triggers.

One player obtains an SCV and potentially builds a CC as well, this grants him control of prereq buildings for Missile Turrets and/or Comsat/Silo addons. These buildings in the upgrade pen are blinked to Player 6 (allied computer, but separate force) and back to him once per cycle to prevent them being used for upgrades unless a unit is at the beacon to do so.

300+ units on Junk Yard Dog AI
300+ units on attack or patrol orders to locations possibly completely across the map
A dozen or so allied computer units moving about with attack orders

Locations centered on each player's primary unit giving attack commands to particular friendlies and patrol commands to enemies

Probably two dozen switches randomizing each cycle.

Score to resources system for each player.
Score to resources system for computer ally.
Constantly updating system to show player's gas equal to a total shared by all players on Player 8.
Bonus distribution system by one-each'ing Player 7's ore to players.


The biggest symptoms seem related to having some chump with a throwaway laptop pushing a measly gigahertz or so chugging on just about all of that, and then triggering the building-blink system just loads it down too much. However, if the player loses his SCV (and CC if applicable), the lag doesn't go away when the buildings stop blinking, it persists until that player leaves the game. This is the part I can't duplicate. Though I can indeed lag my own nothing-to-sneeze-at system by passing about 600 CCs between players, stopping the give triggers eliminates the lag immediately.

I did have the lag when playing solo though before zeroing Buildings scores. I haven't encountered any major lag since making the fix, but that doesn't mean I've yet encountered one of these po-dunk-puter players yet again either.

Post has been edited 1 time(s), last time on May 25 2010, 2:00 pm by Ranzear.



None.

May 25 2010, 11:19 pm Lanthanide Post #5



You're talking about 'blinking' buildings to satisfy pre-reqs, but to prevent players from researching upgrades?

If you create a Disabled unit sprite of the building you want, such as the engineering bay, it will be Unpowered and the player will be unable to research things (or lift off), but will still meet pre-reqs for other buildings to be built.

If you want the player to also be able to do upgrades, when on a certain beacon, then simply have 2 of each building - one in an out-of-the-way place that is disabled unit sprite, and the other where you currently have it owned by P6 or whatever, and do your 'giving' of that one when required.



None.

May 26 2010, 7:45 pm rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

You can actually disable most buildings.



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

May 30 2010, 6:22 am UnholyUrine Post #7



Actually, I remember experiencing this before too

I made a Defense called "INsane Defense" and I smuggly put buildings shaped into a word "INSANE" on the top left :P
Then I thought, wouldn't it be cool if it was flashing crazily all the time in the mini-map?

So i decided to make it give to p1, then p2, then p3, and etc. etc.

It lagged the fuck out of the game... so I removed it...
I have no idea why tho, so my advice for you is to avoid it ^^



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:44 pm]
NudeRaider -- can confirm, staff is terrified of Devlin
[03:33 pm]
Vrael -- I see Devlin has been up to some shenanigans lately
[2024-6-02. : 5:47 pm]
Ultraviolet -- zsnakezz
zsnakezz shouted: ultra you have any thought or notes on undead invasion?
I still haven't gotten a chance to play it yet unfortunately. I just downloaded, but today I'm working on a project with a deadline so won't be able to play it today
[2024-6-02. : 4:59 am]
zsnakezz -- >:)
[2024-6-02. : 4:59 am]
zsnakezz -- :)
[2024-6-02. : 4:58 am]
zsnakezz -- somebody gets it
[2024-6-02. : 4:58 am]
zsnakezz -- and its not all just numbers in my file screen
[2024-6-02. : 4:57 am]
zsnakezz -- thank you for your comment though, good to know some people out there tried my map out
[2024-6-02. : 4:57 am]
zsnakezz -- just kidding
Please log in to shout.


Members Online: NudeRaider