CaptainBravo 0 Posted September 24, 2010 Having the same AI groups under UPSMON and without, makes a differene. There is more demand on CPU with UPSMON = more lag. So number of AI units is not only factor. Scripts in background and how often they are run makes a big difference. Share this post Link to post Share on other sites
galzohar 31 Posted September 24, 2010 Just try running a million infinite loops of script code and see what happens. Your FPS won't drop, even by a single frame. Scripts just can't do that. The only thing UPSMON does for your CPU is make AI do more stuff, but you could tell them to do stuff with waypoints or any other method and it would require the same CPU power. Share this post Link to post Share on other sites
Muzzleflash 111 Posted September 24, 2010 Just try running a million infinite loops of script code and see what happens. Your FPS won't drop, even by a single frame. Scripts just can't do that. The only thing UPSMON does for your CPU is make AI do more stuff, but you could tell them to do stuff with waypoints or any other method and it would require the same CPU power. Then why does putting in Civilians and Vehicles modules produce about 5s of lag (low fps) when game has started? Those 2 modules is just a bunch of scripts. If I don't use them I don't get the low fps at start. Share this post Link to post Share on other sites
galzohar 31 Posted September 24, 2010 Because they spawn a lot of units and spawning units causes lag? It's not the script that causes the lag, but what the script is making the engine do outside of the script that causes the lag. Make a script that spawns a million bombs and you'll sure get massive lag, but even if those bombs were spawned without a script you'd get the same lag. If the script would just do some mathematical calculation instead of spawning bombs, you would get no lag (as in, no FPS drop, the heavy script will still "lag" other scripts). Share this post Link to post Share on other sites
Muzzleflash 111 Posted September 24, 2010 (edited) Then what about stuff like getPos/buildingPos? That would have to interact with the engine? Or nearestBuilding for example, it would have to interact with the engine since buildings may have been spawned or destroyed, and i'm pretty sure I saw a nearestBuilding call in UPSMON some place. The more AI's the more calls to nearestBuilding for example. Regardless in order for something to affect the game in most cases (AI excepted most likely) it has to interact with the engine. How much slowdowns such checks as nearestBuilding cause I don't know, almost zero probably (but do it rapidly enough and it will cause slowdown whether noticeable or not) Or am I missing something? Edited September 24, 2010 by Muzzleflash Share this post Link to post Share on other sites
galzohar 31 Posted September 25, 2010 (edited) I highly doubt that (though you could easily make a script that spawns many loops that keep running the command you're worried about to test). The whole point is that the engine doesn't allow scripts to take up more than a small fraction of the total CPU power or something so that scripts don't cause FPS drop due to too intensive CPU usage. However it doesn't limit necessary actions such as making bombs explode or making AI keep moving. Example test: for "_i" from 0 to 10000 do { [] spawn { while {true} do { blah = nearestBuilding player; }; }; }; Ran the above and couldn't notice any effect on FPS. Edited September 25, 2010 by galzohar Share this post Link to post Share on other sites
lightspeed_aust 681 Posted September 26, 2010 (edited) Some help please - I have to rescue a group of blufor from a taki operated base at which point I give them a weapon each and they will begin a upsmon fortify of the base. They get the weapon and seem to move to fortify however they will not fire at opfor even if they are standing right in front of them. It seems like they don't see them or they don't see them as being enemy. Note - the opfor will fire on them. disregard this post - i had assigned weapons but not the magazines properly so they were firing but had no ammuntion - sorted now. damn i love this script! Edited September 26, 2010 by Lightspeed_aust UPDATE Share this post Link to post Share on other sites
galzohar 31 Posted September 26, 2010 Doesn't seem like a UPSMON-related issue, more likely something you did in your mission or a more general bug. Share this post Link to post Share on other sites
CaptainBravo 0 Posted September 26, 2010 I had a mission where AI utilized UPSMON. I ha 10 AI group within a city. The mission lagged a bit. Removed UPSMON and replaced with WP and a couple of Triggers and the mission (framerate) was very smooth. So scripts certainly can lag a mission and UPSMON is very resource hungry. Share this post Link to post Share on other sites
Nordin 0 Posted September 26, 2010 Is it possible to turn off auto "get in vehicle" for AI? Quite annoying when your randomly spawn troops decides to get in a truck and then drive around in it... Share this post Link to post Share on other sites
galzohar 31 Posted September 26, 2010 Well did you have some units sitting around not doing anything until a trigger is activated? If you were to use waypoints and no triggers (like I did in my comparison test) you would probably get the same FPS with and without USPMON, same as I got. And no, sorry, couldn't find a way to truly disable AI from taking over vehicles. Increasing their searchVehicleDist is supposed to do it, but for some reason it doesn't seem to work (at least not always). :( Share this post Link to post Share on other sites
spyhunter82 10 Posted September 27, 2010 hi all sorry if this has already been posted is there away to activate this by trigger ? what i want is the units to stanby until opfor is present then when opfor is detected the ai units start to advance on the town what ive done 1. created a marker and named it chakchak. 2. created a group but left the init field empty. 3. created a trigger and in the on activation i put: nul=[this,"garmsar"] execVM "ups.sqf" then synced the trigger to the group leader but it didnt work :( any help would be appreciated thanks mark Share this post Link to post Share on other sites
galzohar 31 Posted September 27, 2010 Not "ups.sqf", but rather "scripts\UPSMON.sqf". Marker name is different than the one you created. Also, you're trying to make the trigger patrol... Instead, in the group leader's init field type: groupPatrol1 = group this; And instead of using nul=[this, "garmsar"]... use nul = [(units groupPatrol1) select 0, "chakchak"]... Share this post Link to post Share on other sites
spyhunter82 10 Posted September 27, 2010 nope it wont work. i dont no whats going rong zohar, can you put it down in a few simple steps 1. 2. 3 etc all i want is a group on stanby waiting for the trigger to be activated by opfor. when it is activated the group then starts to move towards the town. Share this post Link to post Share on other sites
galzohar 31 Posted September 27, 2010 (edited) Create a rectangle/circular marker named "chakchak" and make it cover the area in which you want the units to patrol. leader's init line: groupPatrol1 = group this; trigger's onAct field: nul = [(units groupPatrol1) select 0, "chakchak"] execVM "scripts\UPSMON.sqf"; If you want them to run, in the trigger's onAct field use nul = [(units groupPatrol1) select 0, "chakchak", "NOSLOW"] execVM "scripts\UPSMON"; instead Of course make sure your init.sqf file has: if (isServer) then {call compile preprocessFile "scripts\Init_UPSMON.sqf";}; And that the scripts folder is actually inside the folder where you saved your mission (same place where the mission.sqm file is). Edited September 27, 2010 by galzohar Share this post Link to post Share on other sites
spyhunter82 10 Posted September 27, 2010 (edited) nope its still not working,i followed your instructions to the letter and nothing :( could you take a look at my mission please if you have time. thanks mark EDIT: mission on rapid share now, link sent Edited September 27, 2010 by spyhunter82 Share this post Link to post Share on other sites
galzohar 31 Posted September 27, 2010 (edited) Obviously, it's "scripts\UPSMON.sqf" not "scripts\UPSMON" - Were you not getting a "script not found" error? Make sure the trigger actually activates at some point. Add a player sideChat "trigger activated"; command to your trigger so that you get a message when it activates. Also, your trigger is set to repeatedly, while you obviously do not want to run UPSMON multiple times, so set the trigger to run one time only. Also, don't give a unit the same name you give the group. You have a lot of units trying to patrol "garmsar" marker, but there is no such marker!!! Create one for the zone you want them to patrol, or else how do you expect them to patrol? UPSMON should give you a message that the marker doesn't exist. Many of your units are trying to run ups.sqf, but that script doesn't exist in your mission. Next time run the game with the -showscripterrors parameter (see startup parameters) or else you'll never know what is wrong with your missions (though "script not found" errors should display regardless, there are many other errors you'll never find if you don't use it). Alternatively you can check your rpt file for errors after you run your mission, but it's much easier to also enable -showscripterrors so you can see exactly when the error is occuring. Anyway, this is starting to really not have much to do with UPSMON. For generic questions of how to run scripts you may want to start a thread more specific to your problem... Bottom line is when things aren't working, checking out the errors you're getting goes a long way towards fixing them up. You should really consider making a small simple mission so that you can become confident in using the various scripts and only then trying to make bigger projects like editing big missions that have lots of scripts in them already. Edited September 27, 2010 by galzohar Share this post Link to post Share on other sites
spyhunter82 10 Posted September 27, 2010 (edited) deleted!! check your PMs galzohar EDIT: hi @ galzohar could you take a look at the mission im working on ? im still getting a few errors in the .rtp concerning the back pack which i cant seem to fix. any ideas ? (lower priority) now for the upsmon troubles. ok just take a look at chak chak. the rest of the towns im still ading squads to, i added most of the squads just to see how it performed, quite well i might add. now what im trying to do is when the 4 squads are spawned they move to there waypoints and then i want upsmon to take control. can this be done ?, i have tried a couple of attempts with no success heres the link to the mission http://rapidshare.com/files/423341920/TvT_Domination_warefare.Takistan.rar thanks mark Edited October 6, 2010 by spyhunter82 Share this post Link to post Share on other sites
galzohar 31 Posted October 6, 2010 Again you're trying to modify a mission, which would make it very difficult for you to figure out where those RPT errors are coming from. Would be much easier if you first learn how to use the scripts in a fresh new mission and then try to apply what you've learned that works into a new mission, or else you'll take a very long time understanding what the hell you're doing wrong, and it will be very hard to help you as well since I can't guess what you added to the mission that could cause errors. All in all, RPT errors are quite self-explanatory most of the time, or at least a lot more often than one might think. Share this post Link to post Share on other sites
spyhunter82 10 Posted October 6, 2010 really dude, you are makein this dificult for me, the backpack error is xenos work not mine, all i have added is the spawn script, everything else is xenos work not mine, so them errors belong to him :) the back packs still work fine so its not to much of a problem. and please i dont want to here "you need to make a new mission and start from there because ive already done that and had upsmon working as intended but i cant seem to get it to work with the 4 spawning squads i set up at chak chak. im not a rocket scientist, im not a master scripter or mission maker and i love to cut corners (xenos TvT domi template) as i dont have time to make a full mission as it would propbably take the rest of my natural life. all i wanted to no, is it possible to add upsmon to the four squads i added at chak chak ? thanks mark Share this post Link to post Share on other sites
galzohar 31 Posted October 6, 2010 It should be very possible (and simple). But I don't know what else is going on there to be able to tell you what is going wrong. Share this post Link to post Share on other sites
spyhunter82 10 Posted October 6, 2010 hi thank you that was a much better reply :) now you say it should be very possible and simple. how do i go about it ? what code goes were, waypoint script ? on activation of waypoint ? maybe a seprate trigger, ive tried a few combos with no success thanks mark Share this post Link to post Share on other sites
galzohar 31 Posted October 6, 2010 Depends how you want to activate it. Probably best approach would be to add it at the end of the script that is spawning them, assuming you actually know how to spawn them already... The spawning commands return the units that get spawned, and then you can use those to activate the script normally, aka [_spawnedUnit, "markerName"] execVM "scripts\UPMSON.sqf"; Share this post Link to post Share on other sites
spyhunter82 10 Posted October 7, 2010 (edited) ok im gunna take a step back from the last post, i have 4 triggers on each town one for each squad, now befor i experiment again :eek: do you think this would work in just one trigger ? is it the correct format ? "fith_group = true","sixth_group = true","seventh_group = true","eighth_group = true" each one of those groups reprisents one trigger now i have over 64 groups and the amount of triggers is getting silly. so what i want to do is combine 4 squads onto 1 trigger. those groups above are from chak chak Edited October 7, 2010 by spyhunter82 Share this post Link to post Share on other sites
Woodpeckersam 18 Posted October 7, 2010 yes that would wrk in a trigger activation field. Just make sure that in each groups unit it has for example... Group Leader Activation/Init: fifth = group this; fifth_group = false; If you want a trigger to check if a group variable is true you could do this.... Condition field: fifth_group == true More groups.. fifth_group == true && sixth_group == true Check if two groups or the other two groups are true fifth_group == true && sixth_group == true OR seventh_group == true && eigth_group == true No sure u need these but it's good to know them :) Share this post Link to post Share on other sites