Jump to content
Sign in to follow this  
Lucky44

Guidelines for making MP Missions for Dedicated Servers

Recommended Posts

I'm making missions for The Art of Warfare gang's (TAW.net) Arma2 group, and I have run into some ugly dedicated server issues (or so it seems). We have a 64-slot server that we rent, and I'm making coop missions with up to 50 slots.

Someone suggested I should not use units' INIT boxes, because they don't run well on dedicated servers.

Is there a resource somewhere on how to optimize missions so they work properly on dedicated servers? I searched but can't find any such list/guide/etc. A simple list of "Dos" and "Don'ts" would be a start.

Any suggestions from those who make missions for dedicated server play?

Edited by Lucky44

Share this post


Link to post
Share on other sites

Heres a link I had as reference:

http://community.bistudio.com/wiki/6thSense.eu:EG

not sure if it would help you, I'm used to maiking mp missions for myself and a few guys.

Here is a Script by Rommel:

http://www.armaholic.com/page.php?id=8544&highlight=REDUCER

I use it myself in my missions, this will help optimize your missions as it only spawns in the enemy

with in a certain distance of you and despawns them in another, thereby "reducing"

the demand on the server to render if you will a larger number of Ai all in one sitting.

Works best on a dedicated server, comes with a demo mission that you can see for yourself how it works.

Any questions give Rommel a shout.

Share this post


Link to post
Share on other sites

Thanks, Gunter. I have been looking at that first link; the stuff about Locality is important, but it's not very clear/thorough to me.

I would have thought there'd be more info out there. But maybe the dedicated server folks are hording their secrets!

It would really be great --and help promote the game-- if BIS could put something together that explained what should and should not be done when making missions for dedicated servers.

Share this post


Link to post
Share on other sites

You mean this page cross?

http://forums.bistudio.com/showthread.php?t=78089

I was going to give him this link but it might help, not sure.

I believe there is alot more info out there that alot of us vets dont even know,

I mean I am still learning stuff since OFP started, probably more now that I'm more involved in the forums,

but it helps to be constantly working as an admin and building Mp missions, and doing some scripting all the time.

Thats the thing about these games you can make a career out of it if you will,

as theres so much to learn and do that it only gets funner and more interesting the more you learn,

probably like anything, of course in choice interest.

Share this post


Link to post
Share on other sites

I find this useful starter

F2 Mission Development Framework (BAS f for ArmA 2)

http://forums.bistudio.com/showthread.php?t=81694&highlight=template

Lots of the complicated stuff is in place - lots to be learned from locality reading it or editing the major pieces to fit your situation.

Its a great idea to have standardisation in our maps,scripts or systems..

Seems a shame BIS not promote or suport with more definitive templates like this one.

Share this post


Link to post
Share on other sites

The main thing you have to read about for MP mission creation is Locality. Locality is VERY important and if you know more about it before scripting/designing, it'll help you in the long run.

Share this post


Link to post
Share on other sites
The main thing you have to read about for MP mission creation is Locality. Locality is VERY important and if you know more about it before scripting/designing, it'll help you in the long run.

Yes, I have found this in the BIS Wiki, but it's not very clear/thorough. (At least to me it's not.)

I was hoping someone would have written up some sort of basic guide to what considerations you have to take when making a mission for a dedicated server...maybe someone could sketch something out here, and others could add to it???

Share this post


Link to post
Share on other sites

I've noticed in MP dedicated server play that my AI helicopter pilots take a different approach to landing and subsequently are very poor at landing in small spaces (i.e. in streets in Zargabad). Anyone else seen this? I'm using invisible H next to the TRANSPORT UNLOAD waypoint, but the helicopters take a low approach to the landing and hit other structures. This doesn't happen on locally hosted server play.

Thanks

Share this post


Link to post
Share on other sites
Yes, I have found this in the BIS Wiki, but it's not very clear/thorough. (At least to me it's not.)

I was hoping someone would have written up some sort of basic guide to what considerations you have to take when making a mission for a dedicated server...maybe someone could sketch something out here, and others could add to it???

http://www.ofpec.com/tutorials/index.php?action=show&id=44

MP, especially DS, scripting is not easy and there's no step by step method for doing it. :) Read everything, ask specific questions as you come across them, read some more, and then read more. Eventually things will start to click.

Share this post


Link to post
Share on other sites

Init lines have nothing to do with dedicated servers. They have something to do with units that get created during the mission (disabled AI slot that had a player join into it and maybe respawning units) - Their init lines often simply don't run at all.

Other than that, you need to realize that every computer (server and clients) can and will run scripts separately and you need to take that into consideration. It's really hard to give advice here without knowing what scripts you're trying to actually run. Init lines run (when they actually run, that is) on every machine as soon as the mission is loaded on that machine, and init.sqf (as well as all scripts execVMed from init lines) run after that, so make sure server-only stuff in init.sqf are only run on the server (using if (isServer) then {....}; )

Share this post


Link to post
Share on other sites

@Kylania: <sigh>, yeah, I know what you mean about 'eventually it all starts to make sense' kind of thing. -I just keep waiting for that to start! Thanks for the post. I've read the OFPec MP Tutorial, and it was a bit helpful for my Locality issues.

@Galzohar: Good info about the init boxes; thanks.

Here's a concrete question: if I run a mission on a dedicated server with maybe 3 players connected, and things go fine, could things get weird if there were simply more players connected? Is there a way to avoid that "false positive" test experience? (I fear the answer to the first question is just "maybe", and that it all depends on the details!)

Share this post


Link to post
Share on other sites

Of course it all depends on the details. For example if you have a script spawning 3 bombs per player instead of 3 bombs total, with 3 players you might think 9 explosions was just the thing triggering 3 times, then when you play with 20 players and get 60 explosions you'll realize something is just wrong. Also if you're spamming the publicVariable command like crazy (intentionally or accidentally) it'll eat up the server's bandwidth but will likely only be noticeable with a large number of players.

If you make sure server-only scripts run only on the server and don't spam the publicVariable command extremely often and don't make the server spawn stuff based on number of players, then it would be much harder to make a mission that works for 3 players but fails for 20+ ;)

Another note is that if you're making a PVP mission it's usually best to test it with at least 4 players.

Of course remember to always test JIP and if your mission doesn't run disabledAI=1 in description.ext make sure it works even if the admin disables AI slots in the slot selection screen.

Share this post


Link to post
Share on other sites

Thanks again, Galzohar, for that.

I suspect I need to really REALLY get down and dirty and learn about local vs. global variables (and public too!), in a more thorough way than I understand them now. So much to learn, so little time :)

Share this post


Link to post
Share on other sites

It's actually quite simple. Local variables start with _ (ex: _myVar) and are only applicable to the script that defined them. So I can run 5 different scripts with _myVar in them and in each of them it can have a different value and will not overwrite eachother. There are certain cases where private variables can leak into called functions, though, so you generally want to add at the start of each script:

Private ["_myVar1", "_myVar2"]

Of course with the names of variables that you actually want to use in this script. This isn't necessary but guarantees that you will not be overwriting values of a variable of the same name that was defined in a previous script.

Global variables are global to the entire mission, so if you set myVar=1; in one place, then it's value is changed to 1 every time you use that variable (until you assign a different value for it). Vehicle names and stuff are also variable names, so if you give a vehicle a name myVeh in the editor, myVeh will always refer to it. If myVeh is a respawning player, then it will always point at the most recently respawned player unit.

Public variables aren't really a type, it's just that any global variable can be synchronized across the network by using the publicVariable "varName"; command, which will broadcast the current value of varName on your machine to all other machines and make them set this as the new value of this variable (and define it if it wasn't already defined, if it was defined then the new value overwrites). "varName" addPublicVariableEventHandler {....} can run code every time varName is publicvariabled (though I don't remember if it only runs when the value is actually changed or every time the publicVariable command was used somewhere). This event handler will not run on the machine that executed the publicVariable command.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×