HC Experiment and Strongpoints#102
Conversation
If CZA is *also* loaded on any HCs, create a "register" so that units can be spawned directly on HCs
Crowdedlight
left a comment
There was a problem hiding this comment.
I know it is still marked as draft. Just did a glimpse through and put in the comments I got from it.
| private _hcRegister = GETMVAR(GVAR(hcRegister),createHashMap); | ||
| _hcRegister set [clientOwner, diag_fps]; | ||
| SETMVAR(GVAR(hcRegister),_hcRegister); |
There was a problem hiding this comment.
hmm, not sure if it is worth it to sync an entire hashmap across the network, compared to an array of HCs, and then use setVariable[GVAR(hcFPS), round diag_fps, true];
Or even do nested array so [[hc1,fps],[hc2,fps]...]
As I the usage would be to loop through them, not know the key of the one you want, until you have been through them all.
transmitting an entire hashmap every 5 sec, compared to a single int value, should have some impact ;-)
There was a problem hiding this comment.
use
setVariable[GVAR(hcFPS), round diag_fps, true];
That would only work for one HC though, right? Otherwise you'd still need a mapping from HC id to fps.
Or even do nested array so
[[hc1,fps],[hc2,fps]...]
Is it much faster to send a nested array than a hashmap? (It'd definitely make updating slower, because you'd have to iterate through the whole array until you found the right HC, rather than just using a key?)
There was a problem hiding this comment.
Could simply update the register every, say, 60 seconds instead
There was a problem hiding this comment.
Hmm.
So good point that when updating the value a nested array wouldn't be quicker.
Usually I would do player setVariable[GVAR(hcFPS), round diag_fps, true]; as then any other client with a reference to that player, could use the _unit getVariable[] syntax to get the value. So if you have a list of registered HCs, you loop through it and read the public variables placed on the reference to the HC. Thus only needing a list of HCs, as you can lookup the variable saved on that player "object".
I believe that would work with the HC too, as that is the same reference you need to send spawn event to the HC with CBA events?
But I am honestly not sure if there is any real performance benefit in that compared to sending a hashmap over the network. 😅
| if(!isNull _unit) then { _params = _params - ["_composition"]; }; | ||
| if(!EGVAR(main,zeiLoaded)) then { _params = _params - ["_sandbags"]; }; | ||
|
|
||
| _dialogResult params _params; |
There was a problem hiding this comment.
should be commented out when done testing ;-)
There was a problem hiding this comment.
Hopefully by the time I'm finished, that line will be necessary :D
Experiment to incorporate headless clients to improve performance. If CZA is also loaded on any HCs, create a "register" so that units can be spawned directly on HCs.
Demoed with a "Strongpoint" module - garrisons a number of buildings in a radius (using LAMBs, if present)