| 01-04-2006, 06:18 AM | #1 |
Hello everyone. I am working on a tower wars superspeed map. Units have no stock replenish interval so you can send infinite. Right now I face a problem where units do not want to move after so many are spawned. So to explain my dilemma in a little more detail... Below I use "rect" instead of "region" because I use WEU. A player creates a unit. That unit is instantly moved to a rect and converted to a neutral player. From that rect it is to move to the next rect, and so on and so on, until it reaches the final rect. Right now I am just using a basic trigger to move the units, but after so many units are summoned at a time, everything gets clogged up and the units move really slow and in clumps. I've experimented with breaking the units up into unit groups and moving the groups, which works without clumping. But the problem is I cannot seem to make the trigger work in the manner I want it to. Some units always end up stopping at a rect before they reach the final rect. Is it possible to make a trigger, that allows constant massing without the movement lag? I want to make it so even if 100 units are summoned, all will run to the end at the same time (rect to rect to rect to finish), without stopping in huge clumps. My idea: Maybe this will work if possible to do. Make it so you have 3 global unit groups. When a unit is built, it enters the first, the next unit will be added to the second, the next to the third, then it cycles back to the first. If anyone with a little more experience is willing to help i would be most thankful. |
| 01-04-2006, 06:31 AM | #2 |
If you have too many units, you have too many units. Warcraft was made to work with a certain ammount of them, anything above that can cause lag. It's a simple limitation of the pathing engine. |
| 01-04-2006, 07:46 AM | #3 |
I found a way to do it. I made an integer variable to act like a switch and switch between ownership to multiple computer players. In other words, the first unit goes to player 10, the next to 11, the next to 12. The lag is only caused when a large number of units are trying to be moved by one player. So now I guess my question is, is it possible to hide visible computer players from the game screen? |
| 01-04-2006, 10:30 AM | #4 |
why not just balance the map better to prevent this massive number of units from being spawned in the first place? or do spawning like in "tower wars", where you can spawn a million units at once, but they only come out 1 by 1. (this is done by placing spawned units in a reigon, and with a periodic event, grabing 1 at a time and putting it on the path) i cant understand wy people decide more units = harder... all it doas is cause lag... if you balance a map well, you can cause the same effect with 1 unit as you could cause with 50. and disalowing players to summon really cheap creeps at a certant point during gameplay also helps.. (like in hive revenges TD) |
| 01-04-2006, 06:17 PM | #5 | |
Quote:
very true, quality over quantity, this happened in many zombie games that have a poor spawning engine where at the end it gets so clogged up that it doesnt matter how many there are |
| 01-04-2006, 08:24 PM | #6 |
I thought hard of a solution, and i figured out a way to make tons of units, without adding any game lag. The upside of it is, it's not a huge trigger and it works. The downside is that it takes more than 1 computer player, 2 or 3 limiting you to 6-8 human players. The map I am creating is a huge remake of WMW. Yeah I know, there are 1000's of versions, but I decided to finally make a balanced version, with every race that ever existed and balanced. After about a month of working on it, it's gotten pretty sophistocated. And the irony is so far it's the most intense version and the least lag free. Way off of topic, here is my trigger. I am posting it for people to see and evalutate, I would like a second opinion :) // Represents a comment. There are 2 forces so one of this trigger had to made for each force. So I pretty much chose 3 computer players per 3 human players. Trigger: ![]() Events:![]() Unit enter Rect <gen>![]() Conditions:![]() (Entering unit) is A peon-type) Equal to False![]() (Entering unit) is A structure) Equal to False![]() Actions:![]() Unit Group - Pick every unit in (Units in Rect1 <gen>((Matching unit) Equal to (Entering Unit))![]() and do (Unit - Create 1(Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Center of![]() Rect2 <gen>) facing blah blah....![]() Set Income ((Player number of (owner of (entering unit))) = (incomeIncome ((Player number of![]() (owner of (entering unit)))) + (Point Value of (Entering Unit)).![]() If (Integer Variable Equal to 3) then do (Set "Integer Variable" = 0) else do (Do Nothing)![]() If (All conditions are True) then do (Then Actions) else do (Else Actions)![]() [b]If - Conditions[/b]![]() (Integer Variable Equal to 0)![]() [b]Then - Actions[/b]![]() Unit - Change ownership of (Entering Unit) to Player 7 (Green) and Retain Color.![]() Unit - Change ownership of (Last Created unit) to Player 7 (Green) and Retain Color.![]() [b]Else - Actions[/b]![]() Do nothing![]() //This mess changes the ownership depending on what part of the cycle it is on. The Integer![]() If (All conditions are True) then do (Then Actions) else do (Else Actions)![]() [b]If - Conditions[/b]![]() (Integer Variable Equal to 1)![]() [b]Then - Actions[/b]![]() Unit - Change ownership of (Entering Unit) to Player 9 (Green) and Retain Color.![]() Unit - Change ownership of (Last Created unit) to Player 9 (Green) and Retain Color.![]() [b]Else - Actions[/b]![]() Do nothing![]() If (All conditions are True) then do (Then Actions) else do (Else Actions)![]() [b]If - Conditions[/b]![]() (Integer Variable Equal to 2)![]() [b]Then - Actions[/b]![]() Unit - Change ownership of (Entering Unit) to Player 11 (Green) and Retain Color.![]() Unit - Change ownership of (Last Created unit) to Player 11 (Green) and Retain Color.![]() [b]Else - Actions[/b]![]() Do nothing![]() Unit - Move (Entering unit) Instantly to (Center of Rect2 <gen>)![]() Unit Group - Add (Entering Unit to UnitGroup1)![]() Unit Group - Add (Last created unit) to UnitGroup2)![]() //The Unit Groups are what i use to determine what units move where.![]() Unit - Order (Entering unit) to Move To (Center of Rect3 <gen>)![]() Unit - Order (Last created unit) to Move To (Center of Rect4 <gen>)![]() Set Integer Variable = (Integer Variable +1)![]() //Finally, this creates the next phase of the loop.Events: Map Initialization Conditions: None Actions: Player Group - Add Player 1 (Red) to Player Group Variable 1. //Do this for players 1-3. Player Group - Add Player 3 (Red) to Player Group Variable 2. //Do this for players 4-6. Player Group - Add Player 7 (Green) to Player Group Variable 3. //In this example, players 7, 9, and 11 would be added here. Player Group - Add Player 8 (Pink) to Player Group Variable 4. //In this example, players 8, 10, and 12 would be added here. Player Group - Make Player Group Variable 1 treat Player Group Variable 4 as an Enemy. Player Group - Make Player Group Variable 2 treat Player Group Variable 3 as an Enemy. The only problem is the units colors on the minimap, it gets colorful. If there is a way to change minimap colors, please let me know. I haven't found a way, it's probably impossible. This trigger is long and probably an extra 5-10kb but it works flawlessly and laglessly. Depending on the position the Interger Variable of the loop means it skips certain parts of the trigger, making it able to be repeated fast with no added lag. It will also help to split it into 2 triggers, making one run the next. |
| 01-04-2006, 08:31 PM | #7 | ||
im sorry, something is wrong here... Quote:
Quote:
so.... you have a balanced map.... that spawns enuf units to f*** up the WC3 pathing system? :-/ thats oxymoronic. (or in lamen terms: UNBALANCED!) |
| 01-04-2006, 08:51 PM | #8 | ||
Quote:
The income gain, the unit pricing, the above trigger, weak unit killing towers, are all leveled out to keep it so there isn't a crazy ammount of units at all times. There is a balance to it, there are just several game modes. One is super fast income, and I managed to keep it balanced throughout every game mode. I have played it online many times and never once got any form of complaint, always "good work, best WMW ever". Quote:
The pathing does not f*** up so you would like to put it. It spawns enough units to be able to be stopped or not stopped depending on skill. I spent a lot of time on balance. Here is a link to download a beta of it, it should be stable and almost ready for release. You can play 6 people and mass as many as you want. Plus there are weak unit killing towers that come after awhile to whipe out the smaller units, making less lag. I defeated lag in many ways, if you don't believe me play it: http://bmgcl.emuxhaven.net/downloads.htm The link is at the bottom. It's my N64 emulation site given to me by emuxhaven but I post my map download on there. |
| 01-04-2006, 08:56 PM | #9 |
http://bmgcl.emuxhaven.net/files/WMW%20SS%20(SE)%20Beta5%20v5.2.w3x%3Cb%3EDownload%20this%20File%3C/a%3E%3C/b%3E%3C/center%3E%3C/b%3E%3CHR%20SIZE=4%20color= 404 not found edit: this ones cause you got some HTML in the URL of the download link.... :-/ http://bmgcl.emuxhaven.net/downloads.html 404 not found |
| 01-04-2006, 09:01 PM | #10 |
http://bmgcl.emuxhaven.net Just click the downloads page Edit: Oh ok, i see what you mean. My FTP program is messed up and my text overlaps. Ill fix the link right now. Edit Again: It works now. |
| 01-05-2006, 12:20 PM | #11 |
issue #1: 1/3 of the time, the units yellow summons belong to yellow and spawn in is area, giving him insane defensive abilitys. |
| 01-05-2006, 12:47 PM | #12 | |
Quote:
yeah i found that out not long after I posted my Beta lol. my most recent version is Beta9 and it should be as stable as a release. When i implemented the unit/player swap method it created a huge problem with several other triggers. also a quick question for anyone who can answer this. if the event (every xx seconds of game time) is used, will it cause lag? I created a trigger that makes units anti stick and i am firing it every 7 seconds. I have a relatively fast computer so it wont hurt me that much if it will cause any lag. My trigger: Trigger: ![]() Events:![]() Every 7.00 seconds of game time.![]() Conditions:![]() None![]() Actions:![]() Player Group - Pick every player in "PlayerGroup1" and do Actions![]() Loop Actions![]() Unit Group - Pick every unit in (Unit owned by (Picked Player)) and do (Actions)![]() Loop Actions![]() If (Current order of (Picked Unit)) Equal to (Idle) then do (Unit - Order (Picked Unit) to Move![]() To (Center or Rect1) else do (Do Nothing).![]() Player Group - Pick every player in "PlayerGroup2" and do Actions![]() Loop Actions![]() Unit Group - Pick every unit in (Unit owned by (Picked Player)) and do (Actions)![]() Loop Actions![]() If (Current order of (Picked Unit)) Equal to (Idle) then do (Unit - Order (Picked Unit) to Move![]() To (Center or Rect2) else do (Do Nothing).![]() //Unsticks the bottom team. PlayerGroup2 are players 8, 10, and 12.Browsing the forums i noticed some people made even larger triggers fire every like .5 seconds of game time. I can imagine that would lag after awhile. |
| 01-05-2006, 01:31 PM | #13 |
actually, the only reason periodic events cause major issues (unless you are doing insane ammounts of stuff at an insanely low interval) is memory leaks. Tat trigger is full of em :) but considering that its only every 7 seconts, it should cause few issues. a better way to do tat woul be firing a trigger everytime a unit is issued a stop order. just to clarify about memory leaks: te major cause of memory leaks are: player groups unit groups locations these must all be removed with certant functions. (im too lazy to open JASS Shop pro to post em. search the forums.) |
| 01-05-2006, 02:34 PM | #14 |
I know it's annoying to remind you all the time, but please use [trigger] tags for triggers. It will make triggers easier to detect, because they will get separated from normal text. There is a sticky for a reason in this forum. |
| 01-06-2006, 06:14 AM | #15 |
I put all my triggers in the tags, sorry about that. And thank you earth fury for pointing out memory leaks. I took awhile and learned how to avoid them, and applied a lot if it to the map. Although I understand it relatively well, I was wondering if anyone can now help me with removing one type of memory leak. Basically I pick every player in All Players, and do an action. This trigger has to run at the end of a 9 or 15 second timer depending on the game mode, so it runs often enough it may be a concern. What I can't seem to figure out is, how would I destroy this player group directly. I had one idea and I am wondering if this will work: (Timer is a timer variable and Defeat is a boolean variable to determine the game ended or not. The player group variable is TempGroup) Trigger: ![]() Events:![]() Time - Timer expires![]() Conditions:![]() Defeat equal to False![]() Actions:![]() Player Group - Pick every player in (All players) and do (Player Group - Add (picked player) to TempGroup![]() Player Group - Pick every player in (TempGroup) and do "Actions"![]() Custom script: call DestroyForce(udg_TempGroup)It just seems to me im creating 2 groups here, and the first one I don't know exactly how to destroy (the one with "All players") Edit: Ignore the above problem, I fixed that one. I am having trouble finding something... Is it possible to use a line of script to create a player group? |
