Reflected Posted July 5, 2017 Posted July 5, 2017 How do unspawned, late activated units affect performance? Imagine a mission where you have 500 planes and 1000 ground units activated when you reach a trigger zone. But you haven't reached the trigger zone yet, you're flying all alone around the map. Do the 1500 units cause any performance hit in terms of GFX memory, RAM, or simply loading time? thanks! Facebook Instagram YouTube Discord
Pikey Posted July 5, 2017 Posted July 5, 2017 nope, nothing except the load time initially, mission size and if you can see them, then the gfx element, which isn't bad either, but with a 1000 units will be alot anyway. Go spawn them though..ha that will stop the world. So the question is, why would you have units you would never spawn? Because if you intend to spawn that amount, forget it. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Reflected Posted July 6, 2017 Author Posted July 6, 2017 nope, nothing except the load time initially, mission size and if you can see them, then the gfx element, which isn't bad either, but with a 1000 units will be alot anyway. Go spawn them though..ha that will stop the world. So the question is, why would you have units you would never spawn? Because if you intend to spawn that amount, forget it. I'm asking because I'm working on a mission that can go many different ways depending on what you want. So sometimes some units are spawned, next time another bunch, you see? There aren't many units "live" at the same time in order not to cause performance issues. I was just worried that all the rest that wait unspawned might be a problem too. The 1000 units mission was just an example ;) Facebook Instagram YouTube Discord
FlightControl Posted July 6, 2017 Posted July 6, 2017 Let me guarantee you that the performance impact may be there, but it is minimal. The MOOSE framework uses the late activation heavily. Spawning groups has a performance impact and has all sorts of unwanted side effects (like when a group is spawned dynamically, the group object only becomes "alive" after a few seconds, which is a problem in your logic if you need to object immediately after the spawn). MOOSE has a SPAWN class. This class hides the complexity of spawning groups and provides a lot of additional features. SPAWN prepares ALL the objects in advance, that is, it tries to spawn every object, but late activated, so that when the spawn happens, it is already in the mission and it will be just an activation. This heavily improves the smoothness and the performance of your missions. FC [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Pikey Posted July 7, 2017 Posted July 7, 2017 Or in other words, you could achieve a scalable spawning with minimal impact with a couple of lines of script. But equally you can Activate units on a trigger as you have indicated in batches. The main difference between the two outcomes is this: 1) For activating groups manually in the ME you need to create each and every group you want to activate, then create a trigger and an action. You then have to find the right group by name in the action, so you have to name them uniquely. So for 200 units in 20 groups that's 20 triggers. 2) For using the Moose framework, you create just one group "template" per group type you want to spawn, then write one line of SPAWN:New("MyGroup1"):Spawn() for every one. The advantages then extend to randomising the group, spawning it at intervals, spawning it in random places and so on. You can achieve the same with MIST spawning also, it's slightly more complex though but well used. I suspect the other frameworks do the same. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Recommended Posts