Jump to content

MarkCode82

Member
  • Content Count

    196
  • Joined

  • Last visited

  • Medals

Everything posted by MarkCode82

  1. but isn't it better to partition the data into. initServer.sqf initPlayerServer.sqf initPlayerLocal.sqf ? Rather than use init.sqf ? Because I've successfully kept most code executed locally on the server via initServer.sqf for weather values and then push the updates to the clients server-side via initServer.sqf and [time,value] remoteExec ["setRain",player,false];
  2. This is a tactical HUD that is intended to "try" to be realistic to ArmA 3's specifications. Simply put it is a tactical computer system that displays various information about the environment and wearer. This is completely client side script it does not require mods other than installation, currently I am not going to release it just yet as I am still 1. Working out bugs 2. Improving it's performance 3. Adding features that break it's functionality the current capabilities of the HUD are the following. Compass Bearing in degrees Current elevation Current Task_force_radio long range and short-range channel Current Wind Direction Players current GPS position Current in mission time Compass 16 point heading. Town information (GPS position and current distance to town) (Range limited to 1000M) Nightvision and Dayvision town information modes. Here is some teaser screenshots of the HUD. DayTime data: Nightvision Mode:
  3. How can I achieve this? I've seen Zertys CTI do it, but it uses a bunch of commands I've never actually used. How can I use them to achieve what I'd like? I am working on upgrading my tactical HUD again, Also how could I build a GPS window using Resources? RscText etc? Edit I've got a partial solution.
  4. https://manuals.bisimulations.com/vbs3/latest/manuals/#Intro/Manuals_Title.htm%3FTocPath%3DVBS3%2520Manuals%7C_____0 Remarkably similiar and pretty well documented puts the Biki to shame. Most of the knowledge translates fairly well to ArmA 3 with a "few" exceptions not a lot. Everyone here is probably going to cry poor mouth because it's not ArmA 3 but hey, it explained why terminate doesn't work immediately. Among other things people seem to be bad at elaborating on. Or refuse to elaborate on.
  5. I still think looking over the VBS manual things are much better explained than the wiki. E.g https://community.bistudio.com/wiki/terminate vs https://resources.bisimulations.com/wiki/terminate Which one is better explained? or. https://community.bistudio.com/wiki/exitWith vs https://resources.bisimulations.com/wiki/exitWith
  6. Virtual Entities. "Headless Client" they don't appear to anyone but admins.
  7. MarkCode82

    Looking for ambient plane script

    Okay I've gotten to the root of your problems from what I can see the code in the fsm you are attempting to use unfortunately won't work. The reason for it not working is it is attempting to pull from the cfgWorlds file an entry that actually doesn't exist. "ilsAmbientPlanes" an entry that doesn't exist. _addAirport = {" \n "" \n " //--- Ambient planes allowed?" \n " _ilsRadius = getnumber (_this >> ""ilsAmbientPlanes"");" \n " if (_ilsRadius > 0) then {" \n "" \n " _class = configname _this;" \n "" \n " //--- Position - extract only XY" \n " _ilsPosition = getarray (_this >> ""ilsPosition"");" \n " _ilsPosition resize 2;" \n "" \n " //---Direction - original value is XZY, convert to XY" \n " _ilsDirection = getarray (_this >> ""ilsDirection"");" \n " _airportVector = [" \n " _ilsDirection select 0," \n " _ilsDirection select 2," \n " _ilsDirection select 1" \n " ];" \n "" \n " //--- Convert vector to direction" \n " _airportDir = [_airportVector,[0,0,0]] call bis_fnc_dirto;" \n "" \n " //--- Register" \n " if (count _ilsPosition >= 2) then {" \n " _listAirports set [" \n " count _listAirports," \n " _ilsPosition + [_airportDir]" \n " ];" \n " };" \n " };" \n "};" \n So if there is no ilsAmbientPlanes entry with the allowed planes then the script will fail. as it can't pull an entry from get a value from getNumber() which is ILS. You could modify the FSM completely to use it. instrument landing system (ILS) thats my best guess to what it is, but there is no entries so it doesn't exist so _local variables are undefined so the script fails when trying to call BIS_fnc_spawnVehicle
  8. Depends, if he's working with Symlinks or Junctions. Junctions are very versitile. and can exist on seperate drives. Put ArmA 3's Addons files on my SSD and it's other files on the HDD. And Symlinked it via a junction. Hardlinks via a junction point to a directory OR Folder. Hardlinks via a /H link are to a singular File Softlinks are similar to folders
  9. MarkCode82

    What is faster? .hpp or sqf

    Neat. I now understand what you mean by the scheduler now, but isn't it true there is always something in the scheduler when a mission is running? I mean I noticed every damn vehicle with a clock adds to that script count. Thats why you can't measure them using the scheduler. I see now because it will not provide an accurate time stamp purely because of the scheduler suspending / restarting every so often?
  10. I can't say I've ever dealt with the WorldSize tile information from config files what does it correspond to? How many tiles exist on the map? that are a 100M * 100M?
  11. MarkCode82

    What is faster? .hpp or sqf

    I apologise for what I said before. Can you explain why this works? testCode = {a = [1,2,3,4,5,6,7,8,9,0]}; currentScripts = count diag_activeSQFScripts; startTime = diag_tickTime; for "_i" from 1 to 10000 do {0 spawn testCode}; addMissionEventHandler ["EachFrame", { if (count diag_activeSQFScripts <= currentScripts) then { hint str ((diag_tickTime - startTime) / 10); removeAllMissionEventHandlers "EachFrame"; }; }]; vs my method I thought the "Performance check button" utilised diag_codePerformance command? Not BIS_fnc_codePerformance anymore? But as far as the searching of a config-file goes that performance was a correct measure?
  12. MarkCode82

    What is faster? .hpp or sqf

    Alright whatever. At one point KK I looked up to you now I don't. You are always condescending. Poor role model if you ask me. I'll take my leave and let the "experts" take over. I don't have the time or the patience to deal with this anymore. I really do not. . Enjoy your... Circlejerk. Good bye.
  13. Thats an interesting solution. Looks like it requires some intricate knowledge about how the maps are actually stored though.
  14. MarkCode82

    What is faster? .hpp or sqf

    Yes maintainability would suffer. I would have just done the [] spawn FuncBind in single player but I can't it doesn't show the GUI or the result. Probably because Local Execute is non-scheduled so I had to make it scheduled.
  15. MarkCode82

    What is faster? .hpp or sqf

    Yet when spawn is executed because the variable is global it immediately becomes available. Accessible. So technically you can make it yield a result by giving the variable a global scope correct? Because basically thats all a call really does is change scope from 1 script to another if it's a function and not a proceedure. With a return statement at the buttom then you can change it's scope to either global or local in the next script. Which is nearly the same as the way functions are actually defined using .hpp functions-as-files they're defined into the global scope. And to get a true gauge. 0.0021 ms with a WaitUntil {scriptDone _thisScript;}; Inside the script. 0.0020 ms with a if (scriptDone _thiScript) exitWith {}; To ensure complete script termination. 0.0614 ms with a decrease in search depth to a single class (MissionConfigFile >> "SuperClass" >> "arrayText") 0.0695 ms with a search depth of: (MissionConfigFile >> "SuperClass" >> "parentClass" >> "childClass" >> "arrayText") SQF (call) 0.0891 ms SQF ([] spawn { [] spawn myFunc; } 0.0025 ms SQF [] execVM: 0.41876 ms (Rubbish execVM sucks) (spawn compile PreProcessFileLineNumbers at the same time) The waitUntil and if(scriptDone _thisScript) should eliminate your result yielding issue instead has to wait for a "true" condition on the script to terminate. Which is as good as returning True. Results are still pretty much the same. The additional search depths of the configs is probably what causes the computation time to lengthen.
  16. MarkCode82

    What is faster? .hpp or sqf

    Show us how it's done then? Instead of openly ridiculing me. And did you just nitpick because I executed a single file with a single array? [] spawn executes code into the Virtual Machine thread and does not wait for the result. You say you cannot use it to measure this way? Why or why can you not? I am not going to roll over for the status quo. Give me the reason why you can't? If I am correct if I was to just copy and paste that array directly into the debug console then executed it should produce a pretty similiar result. Possibly faster. Direct execution in debug: 616 element array 0.0888 ms Config file: 0.0695 ms Non-config (call) 0.0891 ms Non-config ([] spawn { [] spawn myFunc; } 0.0025 ms Non-config [] execVM: 0.41876 ms Satisfied now?
  17. MarkCode82

    What is faster? .hpp or sqf

    configFile used: class SuperClass { class parentClass { class childClass { arrayText[] = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n"}; <--- repeated 44 times down the page (Forums won't let me post it) }; }; }; myArray = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n"]; <-- repeated 44 times down the page 616 was run with call by My_func = compile PreProcessFileLineNumbers "thearrayfile.sqf"; was called using [] call My_func; produced the numbers above. config was retrived using the following myArray = getArray(MissionConfigFile >> "SuperClass" >> "parentClass" >> "childClass" >> "arrayText") My_func was also run by Local execution using [] spawn { [] spawn My_fnc; }; to produce the below results. New results are in. Config file: 0.0695 ms Non-config (call) 0.0891 ms Non-config ([] spawn { [] spawn myFunc; } 0.0025 ms
  18. private ["_xyz","_radius","_Objects"]; _xyz = _this select 0; _radius = _this select 1; _Objects = _xyz nearObjects _radius; _Objects; Executes in 4 m/s in kavala 1 m/s faster. private ["_Objects"]; _Objects = (_this select 0) nearObjects (_this select 1); _Objects; Executes in 3 m/s in Kavala With a value of 50 in radius. 1 m/s Thats about as simple as it can get.
  19. It's an extremely simple problem... Although my solution didn't include ignoring non-statics. Unfortunately..
  20. _xAxis = _this select 0; _yAxis = _this select 1; _zAxis = _this select 2; _radius = _this select 3; _convert3D = [_xAxis,_yAxis,_zAxis]; _Objects = _convert3D nearObjects _radius; _Objects;
  21. MarkCode82

    Looking for ambient plane script

    https://community.bistudio.com/wiki/BIS_fnc_ambientFlyby
  22. MarkCode82

    What is faster? .hpp or sqf

    Again: 616 config element array of string values completed in 0.068 m/s 10000/10000 cycles (retrived using configFile >> "") 616 non-config element array of string values completed in 0.211551 m/s 4727/10000 cycles. (executed through execVM) (ExecVM sucks....) 616 non-config element array of string values executed using pre-compiled code completed in 0.0925 m/s (executed using call) 616 non-config element array of string values executed using pre-compiled code completed in 0.0025 m/s (executed using spawn) had to do [] spawn { [] spawn my_BindFunc}; So it looks like spawn wins.
  23. MarkCode82

    What is faster? .hpp or sqf

    terox Is correct if you look inside the functions_f.pbo you'll find in the initFunctions.sqf how arma 3 pulls this off Bohemia added in there their own parsing syntax through the description.ext. Actually very interesting inside that file, I glossed over it once. Bohemia actually use their own way to parse the files. It also shows how the cfgFunctions is retrived from the ext file. Test it see if it is. Make a config file to parse and add another that is a .sqf file with arrays. See which one is the fastest. I might do it too I am interested in 20 array elements in sqf vs hpp And accessing elements on a config is very simple your description.ext is your "root class" Inside that you add an #include "Configs Location" so it becomes for example in scripts Inside the description.ext Is the "super class" that then goes down inside subclasses such as you define e.g inside the cfgFunctions.hpp class CfgFunctions{ class mySubOrdering < -- SubClass { class myFunctionsSubClass < -- subClass { myNumber = 5; tag = "myTag"; //Custom tag name requiredAddons[] = {"A3_Data_F"}; //Optional requirements of CfgPatches classes. When some addons are missing, functions won't be compiled. }; };}; CfgFunctions is the superclass Accessing the classes like so. myTagsString = getText(MissionconfigFile >> "cfgFunctions" >> "mySubOrdering" >> "MyFunctionsSubClass" >> "myTag" >> "tag") <-- This will get the string stored in the tag variable MyTagsArray = getArray (MissionconfigFile >> "cfgFunctions" >> "mySubOrdering" >> "MyFunctionsSubClass" >> "requiredAddons") <--- This will get an array entry defined by the config myTagsNumber getnumber (MissionconfigFile >> "cfgFunctions" >> "mySubOrdering" >> "MyFunctionsSubClass" >> "myNumber") <--- Retrive a number from this entry (just for example this doesn't work in cfgFunctions.hpp with out erroring. Make sense? Oops I apologise MissionConfigFile FOR NON ADDON files. And you make available to the description.ext via #include "scripts/MyFunctions.hpp" Technically you could make any kind of config and append it into the #include which I've seen people do in some instances. As an additional piece of information about Torex said, the issue with spawn'ing and calling. Calls will blockade ALL other execution whether it is used in scheduled or unscheduled environment. Personal experience here I had a function being used in a HUD, didn't realise the call in a while {true} do {} would never end (*facedesk*) So my HUD wasn't updating. It HAD to be spawn'd. To prevent server locks etc. Inside a spawn and you need the result to be complete and finished use WaitUntil {scriptDone "scriptshandle";}; This way it prevents another script being run before this one completes IF it completes. Results are in test 1: 154 Element Array for config completed in 0 ms 1/10000 cycles (.hpp file) 154 Element Array for non-config complete in 1 ms 1/10000 cycles (.sqf file) Results are in test 2: 308 Element Array for config complete in 0 ms 1/10000 cycles (.hpp file) 308 Element Array for non-config complete in 1 ms 1/10000 cycles (.sqf file) Result are in test 3 (Worse case) 616 Element Array for config complete in 0 ms 1/10000 cycles (.hpp file) 616 Element Array for non-config complete in 1 ms 1/10000 (.sqf file) I think we've definitively proven that .hpp is faster. Hmmm. Wonder if I can use getText to store code. and execute it O_o (Nope worth a try though) Configs win.
  24. Threading is not a magic bullet to solve performance issues somethings can be threaded and some can't. The reason somethings can't is just they can't be broken down into meaningful chunks for each core to work on. I have looked at the ArmA 3 Engine using Windows Performance Profiling Toolkit. This will probably explain why or why not threading would improve or would not. http://gamedev.stackexchange.com/questions/7338/how-many-threads-should-i-have-and-for-what For an interesting tid-bit of information. That means as far as multi-threading goes, ArmA 3 favors RAW single-thread high clock performance.
  25. ArmA 3 really annoys me because it lacks a dictionary data type I know you are going to direct me to the BIS_fnc_addToPairs, but there is no actual dictionary datatype in arma 3. The reason i say this is because. Binary search will allow me to traverse a large array data set much quicker than forEach array; Only problem is sorting the data which is mission specific such as town locations is not possible because attempting to sort the array will result in it's meaning lost. _array = _this select 0; _arrayCount = count _array; _requestedElement = _this select 1; _low = 0; _high = _arrayCount; while {_low <= _high} do { //Comupute mid point _mid = round(_low + (_high - _low) / 2); diag_log format ["_mid: %1",_mid]; _indexReturn = {_x == _requestedElement} count _array; diag_log format ["_indexReturn: %1",_indexReturn]; if (_requestedElement isEqualTo (_array select _mid)) then { _pulledData = _array select _mid; diag_log format ["_pulledData: %1",_pulledData]; } else { if (_indexReturn < _mid) then { _low = _mid + 1; } else { _high = _mid - 1; } }; }; _pulleddata Data Pulled: ["Gravia",[14479.8,17614.3,-21.6749], "Telos",[16207,17296.7,-24.3308], "Athira",[13993,18709.4,-25.735], "Lakka",[12282,15732.3,-23.0026], "Frini",[14612.5,20786.7,-47.0032], "Charkia",[18049.1,15264.1,-28.4237], "Rodopoli",[18753.4,16597.1,-32.1656], "Neochori",[12502,14337,-11.5868], "Pyrgos",[16780.6,12604.5,-18.9913], "Paros",[20885.4,16958.8,-49.8089], "Dorida",[19336.9,13252.3,-37.8615], "Poliakko",[10966.5,13435.3,-28.4601], "Kalochori",[21351.6,16361.9,-20.5678], "Agios Dionysios",[9187.95,15947.8,-124.829], "Syrta",[8625.13,18301.6,-179.297], "Chalkeia",[20194.6,11660.7,-45.8388], "Zaros",[9091.81,11961.9,-19.9013], "Kore",[7062.42,16472.1,-116.425], "Sofia",[25680.5,21365.1,-20.7333], "Kavala",[3458.95,12966.4,-6.1822], "Molos",[26943.9,23170.7,-18.0848]] Numerical keys that are sequential are required for this to work. As a binary search is best used on hash-table keys. Any know of any dictionary methods for arma 3?
×