There is a map I have been working on for a while. I've been slowly pecking away at the map giving every inch of it as much love and detail as I possibly can. I can't even remember when I actually started building this map as I have been working on it for quite a while.
Anyway, as you could imagine working on a large map and giving it lots of details will add to that doodad count quite a bit. The in game lag is starting to get a bit noticeable. I'm starting to think maybe I will have to start looking for any doodads I can dispose of, but I'd rather that be a last resort so I am wondering if there are any good techniques to increase fps in big maps.
I mostly want to do this for detecting structures that would cause the hero unit to path around. Basically if a player moves into a structure I want them to come to a complete stop instead of pathing around.
PolarOffsetPointMovementEventsLocalVariablesMaxOffsetDistance=0<Integer>ConditionsActionsGeneral-While(Conditions)aretrue,do(Actions)ConditionsMaxOffsetDistance<45(Clifflevelof(PositionofPlayer1Hero))==(ClifflevelofPointB)ActionsVariable-SetPointB=(PointBoffsetby(+(3.0))towards(FacingofPlayer1Hero)degrees)Variable-SetMaxOffsetDistance=(MaxOffsetDistance+3)General-If(Conditions)thendo(Actions)elsedo(Actions)IfMaxOffsetDistance==45ThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Clifflevelof(PositionofPlayer1Hero))==(ClifflevelofPointB)((ClosestunittoPointBin(Anyunitsin(Entiremap)ownedbyplayerAnyPlayermatchingRequired:Structure,withatmostAnyAmount))isin(Region(PointB,1.0)))==falseThenUnit-OrderPlayer1Heroto(MovetargetingPointB)(ReplaceExistingOrders)UI-Display("Moving To Max Distance of "+((Text(MaxOffsetDistance))+"!!!"))for(Allplayers)toSubtitleareaPing-PingtheminimapatPointBfor(Allplayers)over5.0seconds,usingthecolor(0%,100%,0%)ElseVariable-SetPointB=(PointBoffsetby(-(3.0))towards(FacingofPlayer1Hero)degrees)General-Wait0.1GameTimesecondsUnit-OrderPlayer1Heroto(MovetargetingPointB)(ReplaceExistingOrders)UI-Display("Moving To Max Distance of "+((Text(MaxOffsetDistance))+"!!!"))for(Allplayers)toSubtitleareaPing-PingtheminimapatPointBfor(Allplayers)over5.0seconds,usingthecolor(0%,100%,0%)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfMaxOffsetDistance<45ThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Clifflevelof(PositionofPlayer1Hero))!=(ClifflevelofPointB)ThenVariable-SetPointB=(PointBoffsetby(-(3.0))towards(FacingofPlayer1Hero)degrees)General-Wait0.1GameTimesecondsUnit-OrderPlayer1Heroto(MovetargetingPointB)(ReplaceExistingOrders)UI-Display("Moving To Cliff Detected At "+((Text(MaxOffsetDistance))+"Distance!!!"))for(Allplayers)toSubtitleareaPing-PingtheminimapatPointBfor(Allplayers)over5.0seconds,usingthecolor(100%,0%,0%)ElseElse
It's a movement trigger for a wasd movement system I'm working on. The idea is to use a point to check various positions in front of the hero unit and move it straight forward. If a cliff is detected the unit will only move up to the cliff other wise it would move straight to a max of 45 distance.
The reason I wanted to move the unit forward in this way it simply to limit trigger use which is a huge problem with other wasd movement people have created. I came up with the idea to try to move the unit up to the furthest position it could move until its path was redirected.
The first step of this was to detect cliffs and I actually have this part down. In fact its very solid, but now I want to implement detecting units which seems a bit more complicated.
I have this trigger I'm working on that dynamically sets the value of a point variable using a While Loop. I want to check for units around the point every time the point variable's value changes. I also want to store the first unit found into a unit variable.
Variable - Set Point B = ((Position of Player 1 Hero) offset by 50.0 towards (Facing of Player 1 Hero) degrees)
So I need to make that?(Can't test atm)
Edit: It works perfectly!!!
I'm going to try to implement this into a WASD movement system via triggers.
The idea being that the trigger can check various distances in front of the unit then order them to move based on the distance to the nearest cliff, unit, doodad that blocks path, etc etc.
This will prevent people from having to constantly run a trigger over and over again using a periodic event. I'm hoping that maybe this will result in significantly less lag using this type of movement via triggers.
Anyway with that said this was the first step I felt I needed to take.
Make a "set variable" action. Use the "random integer" function for each number and set between whatever amounts you want. I think that will work, but then again I am not very familiar with how arrays work.
Edit: I think that might just randomize the index numbers lol. I'm not sure how to manipulate the values for each index, but I'm going to assume you might so after the = you would probably wanna find the option that lets you change array index values then use the random integer function there.
Set the point to the function "Unit rally point target point"
Now I took a look at the hatchery rally point ability in the data editor and apparently both rally points are from the same ability, but are labeled as rally 1, rally 2. I'm pretty sure rally 2 is the worker rally point.
With that said I would set the point in the function to 2 and I'm not sure what the number for target is.
Then of course you wanna set triggering unit to your hatchery unless triggering unit is your hatchery for the trigger. Of course set the position to whatever you want, but I'm guessing you want to set it to some mineral cluster so you would leave it as position of unit and change the unit to a mineral or whatever.
Edit: I actually tested some stuff out and there seems to be a few issues. I created the action and condition I described.
When a player presses a key the Point B variable is set via action from the above post. Right after the set variable action there is a "if, then, else" statement.
If the player units cliff level is not equal to Point B it will tell me via text message and if it is equal then it will tell me that as well via text message.
Here is the trigger.
EventsUI-PlayerAnyPlayerpressesTabkeyDownwithshiftAllow,controlAllow,altAllowLocalVariablesPointB=NoPoint<Point>ConditionsActionsPoint-MovePointBTo((PositionofPlayer1Hero)offsetby50.0towards(FacingofPlayer1Hero)degrees)General-If(Conditions)thendo(Actions)elsedo(Actions)If(Clifflevelof(PositionofPlayer1Hero))!=(ClifflevelofPointB)ThenUI-Display"Cliff Detected at 50."for(Allplayers)toSubtitleareaElseUI-Display"Cliff Not Detected At 50."for(Allplayers)toSubtitlearea
Player 1 Hero is actually a Global Variable if your wondering why its not set in this trigger.
I get this error message in game.
'PointSet' (value:0)
Trigger Error in gt_Polaroffset_Func: Could not get 'point' from Parameter in 'PointPathingCliffLevel' (value:0)
If anyone knows what this means then any info would be much appreciated.
WOW, I can not freaking believe I solved the answer to my second question without knowing anything about what I was doing.
This is the Action.
Point - Move Point B To ((Position of Player 1 Hero) offset by 10.0 towards (Facing of Player 1 Hero) degrees)
Point B is a point variable and Player 1 Hero is a unit variable which also represents Point A in my above post. Obviously the offset can be set to whatever the desired distance is between the unit and Point B.
Anyway, apparently what I was looking for was called a Polar offset which is the distance from something at an angle.
All I need to do now is figure out how to determine cliff levels at Point B.
1. Is there a way via triggers I can check cliff levels at certain points? I would like to store cliff levels into a variable integer.
2. I want to know if its possible to create coordinates at a distance from where a unit is facing. Imagine (Point A aka unit facing) is an arrow pointing a certain direction and at a certain distance is (Point B). How do I get the X and Y position for Point B assuming I know the distance between the two points?
If your wondering if these two questions are related then the answer is yes. My goal is to check cliff height certain distances from where the unit is facing.
Edit: Hmm, I guess the second question is sort of like trying to find the coordinates of the edge of a circle on a big grid at an angle from the center of the circle. The distance between Point A and Point B represent the radius of the circle.
I'm assuming it has something to do with plugging in the position of the center of the circle, the size of each unit of the grid, the angle, and the circumference into some sort of equation.
0
@JakeCake26: Go
Thanks a lot for your tip. More tips would be highly appreciated! :)
0
There is a map I have been working on for a while. I've been slowly pecking away at the map giving every inch of it as much love and detail as I possibly can. I can't even remember when I actually started building this map as I have been working on it for quite a while.
Anyway, as you could imagine working on a large map and giving it lots of details will add to that doodad count quite a bit. The in game lag is starting to get a bit noticeable. I'm starting to think maybe I will have to start looking for any doodads I can dispose of, but I'd rather that be a last resort so I am wondering if there are any good techniques to increase fps in big maps.
0
@deathtorn: Go
thanks
0
@deathtorn: Go
I mostly want to do this for detecting structures that would cause the hero unit to path around. Basically if a player moves into a structure I want them to come to a complete stop instead of pathing around.
0
@deathtorn: Go
Hmm, How about I show you exactly what I'm doing.
It's a movement trigger for a wasd movement system I'm working on. The idea is to use a point to check various positions in front of the hero unit and move it straight forward. If a cliff is detected the unit will only move up to the cliff other wise it would move straight to a max of 45 distance.
The reason I wanted to move the unit forward in this way it simply to limit trigger use which is a huge problem with other wasd movement people have created. I came up with the idea to try to move the unit up to the furthest position it could move until its path was redirected.
The first step of this was to detect cliffs and I actually have this part down. In fact its very solid, but now I want to implement detecting units which seems a bit more complicated.
0
I have this trigger I'm working on that dynamically sets the value of a point variable using a While Loop. I want to check for units around the point every time the point variable's value changes. I also want to store the first unit found into a unit variable.
0
I want to check if unit is a structure. How would I do this?
Edit: Thanks, that worked.
0
@LazyCoder: Go
When you say building placement are you talking about in the editor or players building in game?
0
@Usernameisntworkingright: Go
Variable - Set Point B = ((Position of Player 1 Hero) offset by 50.0 towards (Facing of Player 1 Hero) degrees)
So I need to make that?(Can't test atm)
Edit: It works perfectly!!!
I'm going to try to implement this into a WASD movement system via triggers.
The idea being that the trigger can check various distances in front of the unit then order them to move based on the distance to the nearest cliff, unit, doodad that blocks path, etc etc.
This will prevent people from having to constantly run a trigger over and over again using a periodic event. I'm hoping that maybe this will result in significantly less lag using this type of movement via triggers.
Anyway with that said this was the first step I felt I needed to take.
0
>.< lol, I tried to help at least. I'm not sure how to solve your prob either then :(
0
@akaGrimm: Go
Make a "set variable" action. Use the "random integer" function for each number and set between whatever amounts you want. I think that will work, but then again I am not very familiar with how arrays work.
Edit: I think that might just randomize the index numbers lol. I'm not sure how to manipulate the values for each index, but I'm going to assume you might so after the = you would probably wanna find the option that lets you change array index values then use the random integer function there.
0
@Moooyaah: Go
Can I see your trigger.
Edit: Create a action and go to Move Point.
Set the point to the function "Unit rally point target point"
Now I took a look at the hatchery rally point ability in the data editor and apparently both rally points are from the same ability, but are labeled as rally 1, rally 2. I'm pretty sure rally 2 is the worker rally point.
With that said I would set the point in the function to 2 and I'm not sure what the number for target is.
Then of course you wanna set triggering unit to your hatchery unless triggering unit is your hatchery for the trigger. Of course set the position to whatever you want, but I'm guessing you want to set it to some mineral cluster so you would leave it as position of unit and change the unit to a mineral or whatever.
0
Edit: I actually tested some stuff out and there seems to be a few issues. I created the action and condition I described.
When a player presses a key the Point B variable is set via action from the above post. Right after the set variable action there is a "if, then, else" statement.
If the player units cliff level is not equal to Point B it will tell me via text message and if it is equal then it will tell me that as well via text message.
Here is the trigger.
Player 1 Hero is actually a Global Variable if your wondering why its not set in this trigger.
I get this error message in game.
'PointSet' (value:0) Trigger Error in gt_Polaroffset_Func: Could not get 'point' from Parameter in 'PointPathingCliffLevel' (value:0)
If anyone knows what this means then any info would be much appreciated.
0
@Writhes: Go
WOW, I can not freaking believe I solved the answer to my second question without knowing anything about what I was doing.
This is the Action.
Point - Move Point B To ((Position of Player 1 Hero) offset by 10.0 towards (Facing of Player 1 Hero) degrees)
Point B is a point variable and Player 1 Hero is a unit variable which also represents Point A in my above post. Obviously the offset can be set to whatever the desired distance is between the unit and Point B.
Anyway, apparently what I was looking for was called a Polar offset which is the distance from something at an angle.
All I need to do now is figure out how to determine cliff levels at Point B.
0
1. Is there a way via triggers I can check cliff levels at certain points? I would like to store cliff levels into a variable integer.
2. I want to know if its possible to create coordinates at a distance from where a unit is facing. Imagine (Point A aka unit facing) is an arrow pointing a certain direction and at a certain distance is (Point B). How do I get the X and Y position for Point B assuming I know the distance between the two points?
If your wondering if these two questions are related then the answer is yes. My goal is to check cliff height certain distances from where the unit is facing.
Edit: Hmm, I guess the second question is sort of like trying to find the coordinates of the edge of a circle on a big grid at an angle from the center of the circle. The distance between Point A and Point B represent the radius of the circle.
I'm assuming it has something to do with plugging in the position of the center of the circle, the size of each unit of the grid, the angle, and the circumference into some sort of equation.