Long read ahead... sry 
so I have been working on an epic sized map to create a special kind of RPG. over 1200 triggers later and im almost done... but i have just realized a huge problem and i dont know what to do. The entire time i have been creating this, i have been testing it in classic mode because i want it to be 100% compatible (in models and trigger functions) with classic as i am creating this for a friend of mine who only has classic. While testing in reforged the other day i realized one of the biggest functionalities of my game is choppy in execution, but only in reforged. Ill try to explain as best i can what im trying to do.
So i have it set up so when you kill an enemy unit of a specific owner and of a specific type that 6 of those same types of units will spawn throughout the immediate area. I have accomplished this by dividing said immediate area into 6 regions and having 1 of the specific unit type spawn in a random location in each of the 6 regions. i have had to use some script magic to make sure units dont spawn in walls and stuff (typically my condition involves terrain height and terrain type as well as "walkability on or off" but because the terrain is so diverse and rugged there is no consistent condition script for each region, theyre all kinda tailored to the specific regions.) Im using "if then else" action scripts to accomplish this task. At first i thought it was because i gave my script a total of 4 attempts to place a unit before i tell it to do nothing (if the point the unit is supposed to spawn on meets the right conditions, it replaces the point to another random point in the region and rechecks conditions. if the conditions arent met it will place the unit.... kinda backwards from what youd logically expect but i dont think that is the issue). Turns out if i give my script only one chance, i still get the choppiness. You can experience it every time you kill a unit, there is a short choppiness that occurs. It does not seem consistent among my 3 areas (6 regions each), it seems to happen most with orc units...
Is this choppiness the result of trying to simultaneously place 6 units at once every time an enemy dies? It doesnt seem to be the case because when i took away the script for all regions but one (meaning only 1 unit gets potentially placed) i still get the choppiness.... I have run out of ideas at this point. all i know is i do not have this problem in classic, only reforged.... There is a LOT going on in my game. all kinds of moving parts, a bunch of things happening in the background and scripts are constantly running so i am aware there might be something not directly related to the scripts in question that may be causing the issue. could it be im just overwhelming the system with too much stuff? If that is the case, why do i only experience the choppiness when i kill units? will try to show you the exact script im using.
Lastly, im a total newb and this is my first real project and im learning on my own so im aware there are probably dozens upon dozens of things im doing wrong. if you happen to see something blatantly wrong with my script that may be unrelated, please let me know. i want to do this right.
Thanks for reading and i hope i may be able to learn something from yall. This community has been nothing but awesome to me ever since i discovered it and i have a lot to be thanking yall for already
EDIT: It should be noted i have kill-triggers in place to stop the unit count from getting out of control. as soon as unit count for a given enemy player reaches a certain point (500) all scripts relating to placing enemy units turns itself off. once the number of units drops below 400, the triggers turn back on
Also, the image posted is for 1 unit placement. each of these triggers contains 6 of these segments of script so you are only viewing 1/6th of the trigger you're looking at... Im sorry i do not know how to post the script normally for yall
so I have been working on an epic sized map to create a special kind of RPG. over 1200 triggers later and im almost done... but i have just realized a huge problem and i dont know what to do. The entire time i have been creating this, i have been testing it in classic mode because i want it to be 100% compatible (in models and trigger functions) with classic as i am creating this for a friend of mine who only has classic. While testing in reforged the other day i realized one of the biggest functionalities of my game is choppy in execution, but only in reforged. Ill try to explain as best i can what im trying to do.
So i have it set up so when you kill an enemy unit of a specific owner and of a specific type that 6 of those same types of units will spawn throughout the immediate area. I have accomplished this by dividing said immediate area into 6 regions and having 1 of the specific unit type spawn in a random location in each of the 6 regions. i have had to use some script magic to make sure units dont spawn in walls and stuff (typically my condition involves terrain height and terrain type as well as "walkability on or off" but because the terrain is so diverse and rugged there is no consistent condition script for each region, theyre all kinda tailored to the specific regions.) Im using "if then else" action scripts to accomplish this task. At first i thought it was because i gave my script a total of 4 attempts to place a unit before i tell it to do nothing (if the point the unit is supposed to spawn on meets the right conditions, it replaces the point to another random point in the region and rechecks conditions. if the conditions arent met it will place the unit.... kinda backwards from what youd logically expect but i dont think that is the issue). Turns out if i give my script only one chance, i still get the choppiness. You can experience it every time you kill a unit, there is a short choppiness that occurs. It does not seem consistent among my 3 areas (6 regions each), it seems to happen most with orc units...
Is this choppiness the result of trying to simultaneously place 6 units at once every time an enemy dies? It doesnt seem to be the case because when i took away the script for all regions but one (meaning only 1 unit gets potentially placed) i still get the choppiness.... I have run out of ideas at this point. all i know is i do not have this problem in classic, only reforged.... There is a LOT going on in my game. all kinds of moving parts, a bunch of things happening in the background and scripts are constantly running so i am aware there might be something not directly related to the scripts in question that may be causing the issue. could it be im just overwhelming the system with too much stuff? If that is the case, why do i only experience the choppiness when i kill units? will try to show you the exact script im using.
Lastly, im a total newb and this is my first real project and im learning on my own so im aware there are probably dozens upon dozens of things im doing wrong. if you happen to see something blatantly wrong with my script that may be unrelated, please let me know. i want to do this right.
Thanks for reading and i hope i may be able to learn something from yall. This community has been nothing but awesome to me ever since i discovered it and i have a lot to be thanking yall for already
EDIT: It should be noted i have kill-triggers in place to stop the unit count from getting out of control. as soon as unit count for a given enemy player reaches a certain point (500) all scripts relating to placing enemy units turns itself off. once the number of units drops below 400, the triggers turn back on
Also, the image posted is for 1 unit placement. each of these triggers contains 6 of these segments of script so you are only viewing 1/6th of the trigger you're looking at... Im sorry i do not know how to post the script normally for yall
Attachments
Last edited: