Jump to content

Active Slot Balancing - Proof of concept with video and mission


Recommended Posts

We were puzzling through the bug that prevents an MP CLIENT event firing when he moves into a slot, which is shown here https://www.youtube.com/watch?v=Un9S67NDoLg. The ugly workaround is to iterate the clients that are alive on a regular basis. Sadly the limitation of the Server side API which is properly designed to do this requires a GameGUI.lua in addition, which could be messy, but depending on your point of view, can be done more elegantly.


That said, the use case for needing this work around still exists in the following example. Or in a nutshell; "How do I create content inside a mission that's dynamic according to what slot a client plays in?"


Use cases include, but are not limited to; Player picks a Sabre module in slot, you want to give him a Mig15 to go up against, OR Player picks a Viggen, you want to give him ships to destroy, or Player picks helicopter slot, you want to not have those SAMs. Etc, world is your oyster.


I put together a video showing my workaround and will attach the mission for looking at. Note that, i'm not a developer by trade so if you don't like my script, I don't really care! :) But if you want to show me something better, I'd love to hear how in order to learn. I'm using MOOSE as it simplifies a lot of my learning of LUA and automates a large deal of the tasks I like to do, without repeating code that I wouldnt understand had I started from scratch LUA.



Note that this is quite different from the MOOSE AI Balancer. MOOSE AIB will spawn an AI in all slots and periodically checks for players int he slot then RTB's them. This approach only does something based on the slot that's filled. For air units I RTB them if in the air and if they are on the ground i despawn them. For ground targets, for the demo I chose not to do anything with them at all when the player leaves the slot.

As i said, it's a concept for more interesting play. I like it especially if you have a small group and cannot predict who will show up for a mission. You coudl immediately have an issue with your CAP fighter player not turning up if your CAS dudes are unsuported and you put in horrible CAP. AS a mission designer, I always found that people are fickle. This tackles that problem directly.


  • Like 1



Link to comment
Share on other sites

Hi Pikey. You said that you are not a developer, but the code you put here is quite advanced. I looked into it and I wouldn't change anything (at least until ED corrects the bug), maybe I would use a different indentation style, but that is a personal preference.

Still trying to learn moose.

Intel i5-7600K @3,80 (4,9 OC) + Corsair Vengeance 16GB DDR4@3200 XMP 2.0 + Cooler Master Hyper 212 LED + Asus MAXIMUS IX HERO + Thermaltake Chaser A31 Snow Edition

Geforce RTX 2060 6GB

SSD Samsung 850 EVO 500GB + HDD WDC WD500 500GB

Saitek X-52 Pro & Thrustmaster T.Flight Rudder Pedals & TrackIR 5 & Kingston HyperX Alloy FPS

Oh, yeah, also the Sony PlayStation 4 :happy:

Link to comment
Share on other sites

  • 2 years later...
  • 2 weeks later...
Guys who are just finding this:


This is a very old thread and the functionality has been incorporated into the MOOSE framework and updated by the original author.


You can find more information here and a very helpful community here.



Yeah it's a bit more baffling that that even.



MOOSE AI_Balancer https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/AI.AI_Balancer.html is a module that sends out an AI template instead of a specific Client slot. It then sends that AI back home if the client is there. In effect it's filling up with AI to make up for no players online.




The thing I wrote is subtly different, in that it ONLY spawns AI when a client slot is actually there.




So it's the actual exact inverse, although the concepts of taking away or adding sounds like it should be the same thing and part of AIB to be honest.




Just thought I add to my original post many months later. It's again using SET's to count CLIENTs and doing something as a result.



Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...