Jump to content

PravusJSB

ED Closed Beta Testers Team
  • Posts

    324
  • Joined

  • Last visited

Everything posted by PravusJSB

  1. Something I made to visualise POI's in Syria, although can apply anywhere. In this instance I was looking for helipads and what kind of buildings were around them, highlighting hospitals. It's a simple bit of code and the output can be very robust. POI_with_helipads_syria.lua
  2. @edmuss That sir is a complex topic and I have a lot of information about it, and it's very frame of reference dependant. In general and overclocking aside I'd say ensure you have no hardware bottlenecks and dont be greedy with settings. A common mistake I see people make is with a bottleneck to the GPU, which can be seen with low GPU utilisation, people lower their settings and it gets worse. Instead try to understand the bottleneck and mitigate it and normally upping a GPU related settings much much higher can ease or fix the issue, as it slows the GPU down and brings it back inline with the CPU. I saw a big improvement each step i got the core latency down and stable. For reference i get zero stutters, zero tiny spikes, butter smooth, Syria, RiftS, visual fidelity high.
  3. Hi, I have messed around with settings and setup a lot over the years trying to get the best VR experience and one thing that I did do which made a huge difference is memory overclocking, more specifically I sacrificed speed for tight timings. I have not seen anyone ever talk about timings and I always wanted to write something but I appreciate that this type of overclock is not for the feint of heart. I wondered if anyone else had seen similar results or has the skill and inclination to give it a go and confirm it is indeed a great way to boost performance. i managed to get my timings to 13-15-15-28 @3000 (32Gb) and importantly a 1T command rate.
  4. Also bear in mind that the speeds on the tasking are in metres per second (i think) and the altitude is in metres, so you’ll have to make appropriate conversations when creating a new or modifying existing tasks.
  5. Mission event id 15 fires when birthed on pressing fly i think.
  6. PravusJSB

    Why Lua?

    It's fast, and flexible, and when you have so many fast moving objects to update across clients it works a treat. On the flip side the syntax is easy to learn but much harder to master, and if you have Lua written in a bad way it can bring the whole thing down and debugging it isn't as straight forward as most. I love it, I think it fits DCS well. I tried built a ML application that took mission data at runtime and it was so cool, Python is a cool language and Lua 5.1 feels dated compared, but it was so slow I abandoned it and moved onto other things.
  7. I've not done any kind of robust testing on it, but from experience, yes.. sometimes it can be a performance hit. It depends on the objects used, how many players, what they're doing, what the rest of the mission is doing and scale.
  8. No, you're trying to call a C function that isn't exposed to the mission luaState, you cannot do that. The function above is the correct one for the OP's question, it resides in 'gui' and 'export' luaState so scripting in those states will achieve what he wants. Further to that I've not looking into this at all, just shooting from the hip so to speak.
  9. You cannot just call any function you find, they all exist in different environments. I would hazard a guess that function would reside in the actual code for the module and thus its own lua state youre not going to get access to. And yes, things work on 'self' in MP, but not to call on other Clients.
  10. There are many errors in the way this is written, but I think the key reason it doesn't work is that the net.load_mission is not available to the 'mission luaState'. Try this... local function load_next_miz() local code = [[ _G.net.load_next_mission() ]] return pcall(net.dostring_in, 'gui', code) end
  11. The function behind this is 'a_cockpit_perform_clickable_action' which lives in the global env on a client's 'mission luaState' and whilst I've never had a play with it myself I don't see why you couldn't use it on yourself / your own aircraft with a script but it would not work on a MP server for a client for example.
  12. The getAmmo method called on the unit should return an array of tables (for each pylon and guns), does it not work on players? Here's and example of how i use it.. local function has_air2air(group_name,detail) local GRP = Grp.get(group_name) local UNITS = GRP:units() local details = {} for i = 1,#UNITS do local ammo = UNITS[i]:getAmmo() for pylon = 1,#ammo do if ammo[pylon].count > 0 and ammo[pylon].desc.category == 1 and ammo[pylon].missileCategory == 1 then if not detail then return true elseif detail then if ammo[pylon].desc.displayName then if not details[ammo[pylon].desc.displayName] then details[ammo[pylon].desc.displayName] = ammo[pylon].count else details[ammo[pylon].desc.displayName] = details[ammo[pylon].desc.displayName] + ammo[pylon].count end end end end end end if detail then return details else return false end end
  13. It's harder than you think to keep this thread updated, but we have recently released a large document detailing how to use and what this server offers, you can find it easily on our discord. We have just started to implement the V4 of the core logic which enables the AI to 'think' and make decisions, something pretty special and which the refactor started in Sep '21.
  14. This thread might help you out;
  15. Are you looking to query the ‘Callsign’? If so you’d have to get the group with the group’s name as you have done above, then with each group ask for the Units or a specific unit of the group then query using the method ‘getCallsign’. Otherwise I might not be fully understanding what string you want to match against as if it’s the groups name then what you have already should work fine.
  16. No you get me all wrong, I'm not suggesting what to do, because looking at what you're taking away you're over complicating it. I'm just giving you the information about what's expensive to do. It doesn't mean don't do it, just be mindful and if you need to do it in excess then think about how to phase/schedule/cache/stack it out into the world for the least performance hit. You should really avoid ME as much as possible, make your assets in there is you want/not sure how to make them on the fly without a reference, late activate them and then if you can design with code calling the assets when needed or If you don't know how to do that yet then for sure, design in the ME. Have it all late activated (spawning everything and deleting is mental) and then activate when needed. EDIT: That code wasnt MIST data it was the mission data which is stored in 'env.mission', the same data MIST copies from to store again.
  17. There's a lot of info in here now, and some of it is not quite right or misleading, I don't have time to point it all out but about spawning, some important info; Dynamically spawning an aircraft is expensive, it's expensive at a moment in time but in terms of load on the mission it's transient and is not too much to worry about unless you're spawning more than one-two groups of 4 however, Ground Units for some reason are vastly more so, and they 'reverberate' CPU load for about 20-30 seconds as the units are shared with the clients, spawning 1 or 2 is OK sure, but it gets exponentially more expensive the higher you go and the more clients connected. Especially if there is more than a few units in the group. Consider, it's not only the units, their task, route etc that needs to be shared, but every single radar/datalink etc alive in your mission now needs to pick these up and figure out if they have LOS and know the them etc. Secondly, you don't need much info to spawn a group so it's not hard to build up a DB of info to make a group on the fly. Finally, the Mist framework is good for sure, but why make that DB of existing units when it already exists and isn't hard to iterate for example this is part of a tiny little class I have to retrieve ME declared assets; spmCore.side = { "neutrals", "red", "blue" } -- ME object name, side as an enum -- cats are string, plane, helicopter, ship, vehicle, static function spmCore.find(name,side,cat) if not side then return false end local data = env.mission.coalition[spmCore.side[side+1]] for j = 1,#data.country do if data.country[j][cat] then local Data = data.country[j][cat].group for i = 1,#Data do if Data[i].name == name then return deepCopy(Data[i]) end end end end return false end
  18. Hi guys, I don't have time to fully read the few post's above but want to clarify that it doesn't matter where the codebase lives, if it needs to be shared with clients it will be. Having the code outside the miz file is prob best practice in my opinion, it keeps the miz file size down and negates the need to constantly update code inside it. I and many other servers keep the code seperate to the miz file.
  19. I see. I notice that there is an 'autosave' option in the settings now, could it be you have it checked and are saving at the same time creating an issue?
  20. Sorry I've been struggling to come back to you. cfrag has given you lots of things to think about there for sure. I agree that pathfinding is hugely expensive and there are many ways to mitigate this but I feel those might be far advanced at the minute. I would however, like to point out that sending units over long distances off road (and to be honest indeed on road in Syria depending on the unit and the road) will cause a seemingly infinite number of 'dead' events as the unit/s kills scenery objects on its way to Z. This is a particularly bad situation for a MP server with aspirations of grandeur as all those events will need to be communicated with clients, and unless your code is robust it may destroy the net sync. There as some really quick wins and some fundamentals to consider; Make sure your server is running in a streamlined OS env. Find a way to lock the affinity of the server to 3 physical cores only, and if possible tell everything else to use whatever else is left on the CPU instead. Avoid using tracks, SRS hooks, tacview hooks. At least until you get a benchmark on your performance limitations. Get a benchmark on your performance, this much is very important. I recommend not to use a framework at all. If you must, then refer to MIST, its a great bit of code. If you have to, use MIST. Otherwise, learn the SSE, code things for yourself. This way you learn Lua and DCS SSE/API, using a framework is learning a framework and if you do this you will thank me in a year or two, else if you're still here you'll avoid telling me I was right whilst you secretly try to dig yourself out lol. Learn Lua, there are some great resources to be found with a google search. Localise, re-use and avoid new closures and tables where possible. If you don't get this point see the above point. Have a robust logging system to know what your code is doing. Make a github for your code and branch test and release, test 'test' locally and have extra log outputs for this build. This will avoid pain when clients are connected. Simulate your code and think about fringe cases before deploying to release, be cautious in your exception handling and understand that DCS will stop execution of your code if it throws, and also DCS sometimes doesn't throw and you'll never know there's a problem if you didn't write your own catches. That should give you enough to think about. Honestly I could talk you to sleep with the knowledge I have but it would be too much at this point I think. Go and try things, it won't break beyond what a reboot won't fix, you need to make mistakes to learn for sure, so deff please do think about point 5. I'm actually writing something at the minute for the community which is very much along the lines of this post's theme, I can share with you a draft copy if you hit me up on Discord, it might help you and it might help me getting feedback from you as you are my target audience If you have any questions just ask.
  21. I have a 24/7 mission usually 1000+ ground forces on the Syria map, 20 clients, 70 ish air assets, upto 120 units on the ground moving over a max of 90km 75000 lines of code and my CPU is normally around 60-70% loaded (when the mission is forced to a single core). The only way to achieve that is some clever code and sadly not with the mission editor. Im on the road at the minute but can reply proper when i get home, feel free to hit me up on Discord, there are some other fundamentals that you can be doing with your hosting env and configuration I’ll post in a bit. But the key is to understand what’s expensive and how it affects the netsync for clients to know how to go about scheduling your actions. Regular reboots and other things floating about are a bit of a myth.
  22. I draw a crude mushroom cloud (with explosions) with some loops and some vector math. It works well if not a tad small, you have to be mindful of fps so not a complete creative license. I did make a much much bigger one but i had to scale back the density and it ends up on the verge of looking like a light shade . Easy to do, hard to get the math right at first.
  23. Hey, yea that post is using the same method. I've not tried keeping the files on the same drive, does it still keep them out of memory? My understanding is not complete so it would be great if this works whilst the link folder is on the same drive. Regards update, usually it keeps the link unless (I think) the files being linked are updated, then it might need to be linked again thereafter.
  24. I posted something that might be able to help in this thread:
×
×
  • Create New...