Jump to content
Sign in to follow this  
carlostex

Mission editor vs Script editing:

Recommended Posts

(Questions for MP missions only)

Allright, these may sound as a weird questions but i searched for a while and found nothing on the subject and i do want to know everybody's opinion on this:

How much use do you make of the mission editor when doing these things:

1- When you want to populate a map with enemy do you place enemy groups via the editor or do you prefer spawn scripts?

2- What are the advantages/disadvantages of each methods?

Pretty much this is a editor placing vs script placing when doing MP missions, so i would like to know everyone's opinion and most of all LEARN the advantages / disadvantages of each methods in MP mission making.

Looking forward to the explanations.

Share this post


Link to post
Share on other sites

1- When you want to populate a map with enemy do you place enemy groups via the editor or do you prefer spawn scripts?

2- What are the advantages/disadvantages of each methods?

Always by script, why? Well, there is nothing wrong on placing enemies on the editor for a MP mission, but when you want to make them do stuff like, place a group on a building, this becomes not only frustating because you can't really place anything right on the 2D editor, but also it will bring huge loads of unwanted network traffic, while limiting what you can do a lot.

Imagine you want to place a guy higher on the editor, so you would use his init line, this init line, no matter what you put inside of it, will always be broadcasted over the network, JIP included, even if that object does not exist anymore.

So I guess the advantages on doing this stuff by script are pretty much obvious.

_neo_

Share this post


Link to post
Share on other sites

Editor first - always for me

With a few syncronised triggers or way points i can create much of the theatre im looking for.

Objects are on the map from the start. Easier to 'see' and learn how these things interact and how the game engine moves along.

Generally less problems in multiplayer too - everything on the map is the server. Fewer locality issues for me.

Triggers/ waypoints etc are global, again keeping it simple.

Small code snippets at the right time are very powerful, nudging AI into the scanario. Default behaviours when understood can create much fun and mayhem easily/ visually on the map.

My scripting capabilities are limited. Will use it when its neccessarry - say a parachute eject script, or some fancy way of dealing with a specific dead entity.

Generally i 'borrow' snippets or code thats proven itself - GDT respawn scripts, Norrins excellent chopper suite - easy to link into and add a sophisticated edge to your maps.

I like to 'see' my map, the flow and density of objects etc - guess im just that kind of visual head type.

All of the visual things we see on the map when editing are 'easily' reproduced with script. But its not easy building logic and code when the simple load a helicopter scenario is not understood properly.

Some things are best done with script - its a brave man that scripts everything. Using Benny's warfare as an example, thats the only way to do it.

The rest is probably done in Editor, Keeping it simple, linking into scripts as and when neccessary. Keeping elements of the scenario apart helps bug stomping

Neo 's post is from a code head's perspective -

What im trying to say is take your time - understand the basics properly - concepts of locality - default AI behaviour - then find your own way ;)

Share this post


Link to post
Share on other sites

depends on what you want.

i like editor placement for precise, small jobs.

but when it comes to the rough i love to use DAC, define a few zones and have the ability to trigger them when i need them.

that keeps the mission light until you need the spawns to occur.

Share this post


Link to post
Share on other sites

To tell you all the truth i do have the impression that is somewhat better to use scripts while using conditions to limit where you want that code to run, either server or clients. I do understand that stuff.

The thing is, stuff in the editor is global, and AI should be local to the server, so i have a feeling that it makes a difference spawning 20 groups by script or placing the exact same 20 groups in the editor. I do write scripts myself, but i'm not an advanced scripter.

I guess i should have asked differently. I'm more interested to know about the efficiency of methods. I mean, placing a lot of stuff in the editor that could be local only will take up a lot of network traffic. I just finished implementing something for a friend's mission. He wanted to hide editor placed markers and make them appear again using triggers that would activate on certain events. Of course this would not work with JIP, so i used publicVariable command to have those variables values broadcasted. Everytime a player joins in progress there's code in the init.sqf that will check the variables values and show the correct markers according to what went on in the mission.

But again, i'm interested to know especially from those very experienced, about the efficiency possibilities of using scripts vs editor placed. On the mission i talked above, my friend likes to place groups on the editor and use the init lines for a lot of stuff including givin custom loadouts and using norrin's respawn for those groups. I don't feel it is necessary to have all that stuff in the editor, there are tons of markers there, almost 50 triggers, which were like almost 90 triggers before i implemented a script myself so he could delete about 30 triggers that were not necessary anymore.

I'm really looking forward to more answeres here especially regarding optimization, and what you can or cannot do in the editor before you start to waste network bandwith. Even though the experience might be good for some players, others don't have such good internet connections or powerful PC's. So i strongly believe if the mission maker can optimize and save resources, he should.

What would be the difference between using a server side script to spawn let's say 30 groups of enemy AI vs just dropping those 30 groups in the editor? Again it's not that i think that there is something wrong about using the editor, i just rather want to better understand the efficiency of those methods specially performance wise.

Share this post


Link to post
Share on other sites

Listen to what Neokika says. It's good mission design and limiting whats broadcast prevents the lag that occurs when people JIP. The good mission designers always try to keep as much server side as possible with minimum network broadcasting.

Share this post


Link to post
Share on other sites
What would be the difference between using a server side script to spawn let's say 30 groups of enemy AI vs just dropping those 30 groups in the editor?

No difference at all, judging you would spawn the units on the server (They can be spawned on a client machine by script, and they will remain local to that machine while it's connected, although they exist everywhere).

While what you asked would not make any difference, if you would make the groups do stuff, by doing so on the Editor you are very limited on what you can do, and with the problem of spamming the network (See my first post).

Also note that my comments on this matter may also be due to my personal preferences, so do not take my word for it and do some tests/research yourself. ;)

Edited by neokika

Share this post


Link to post
Share on other sites

While what you asked would not make any difference, if you would make the groups do stuff, by doing so on the Editor you are very limited on what you can do, and with the problem of spamming the network (See my first post).

Yeah that's the problem every unit in all groups have their init lines with tons of stuff, triggers doing stuff that should be server side only or client side only, i feel it's just a waste of resources.

Anywayzz, appreciated all your answers.

Share this post


Link to post
Share on other sites

OK, yes slightly different question. I'm not qualified to give a real answer on server efficiency in that way.

I understand enough to stagger my scripts inits, usually with waypoints calling them (on map and global/ server) - randomly coming online over a few seconds as a unit gets to a point, avoiding the glut of traffic that Neo describes above. Quite a few problems with init lines MP, most have a solution.

The server still has to have the basic capacity for what your doing, 30 groups suddenly active, local or global, can be a big lag. Again there are ways around this by disableFSM/ enableFSM tricks or staggering it with intelligent pauses.

PELHAM

Listen to what Neokika says. It's good mission design and limiting whats broadcast prevents the lag that occurs when people JIP. The good mission designers always try to keep as much server side as possible with minimum network broadcasting.

Big yes, good basic mission design - you have a good grasp of what Arma can do - script/ editor meh who cares, I would realy like a definitive answer myself but experiment is the nature of the game. Its such a flexible engine there must be ten ways to achieve anything.

Good luck.

Share this post


Link to post
Share on other sites

The thing is, stuff in the editor is global, and AI should be local to the server, so i have a feeling that it makes a difference spawning 20 groups by script or placing the exact same 20 groups in the editor. I do write scripts myself, but i'm not an advanced scripter.

Stuff placed in the editor is not global, it is local to the server (except the player unit and AI units in the player group or a vehicle which is driven by a player group member are local to the player)

The server is the instance which creates those objects.

Only triggers and markers are created on all machines when placed in the editor (triggers still are only local and markers are somehow global).

Xeno

Edited by Xeno

Share this post


Link to post
Share on other sites

Spawned mostly. I write my own functions from time to time to handle stuff like this. It gives me finer control of mission flow as well as keeping performance good.

Share this post


Link to post
Share on other sites

@Xeno

I thought it was the other way around. Triggers global and markers local.... :confused:

---------- Post added at 02:48 PM ---------- Previous post was at 02:46 PM ----------

Stuff placed in the editor is not global, it is local to the server (except the player unit and AI units in the player group or a vehicle which is driven by a player group member are local to the player)

The server is the instance which creates those objects.

Xeno

Yes i do understand that, in other words, on single player the player's computer is indeed the server.

Share this post


Link to post
Share on other sites
@Xeno

I thought it was the other way around. Triggers global and markers local.... :confused:

Not at all, when you create a Trigger in the editor, the game creates a Trigger on each machine, each one of those triggers can activate independently.

Markers indeed do not behave how one would expect, that's why I always use local markers (createMarkerLocal).

Share this post


Link to post
Share on other sites
Not at all, when you create a Trigger in the editor, the game creates a Trigger on each machine, each one of those triggers can activate independently.

What do you mean independently? If i create a trigger where the condition is !alive vehicle1 and activation is {_x setdamage 1} foreach [airplane1, airplane2], and if like you say this trigger is created with the same parameters on all the other machines, how can it activate independently? Won't the triggers activate in each machine as soon as vehicle1 is destroyed?

Share this post


Link to post
Share on other sites
What do you mean independently? If i create a trigger where the condition is !alive vehicle1 and activation is {_x setdamage 1} foreach [airplane1, airplane2], and if like you say this trigger is created with the same parameters on all the other machines, how can it activate independently? Won't the triggers activate in each machine as soon as vehicle1 is destroyed?

Only if all machines know what vehicle1 is. Depends what you mean by "as soons as". The triggers might be out of sync. Assuming you have a decent fps a trigger's condition is checked 2 times per second. So there might be up to 0,5s difference between 2 machines, disregarding network latency.

However, are more clear example of independtly is, if you create a trigger in the editor, "myTrigger". And you also create a script if:

waitUntil {time > 10}; 
if (name player == "CarlosTex") then  {
   deleteVehicle myTrigger;
};

Then the trigger on your machine would be deleted. The trigger on everybody elses machine wont.

Share this post


Link to post
Share on other sites
Only if all machines know what vehicle1 is. Depends what you mean by "as soons as". The triggers might be out of sync. Assuming you have a decent fps a trigger's condition is checked 2 times per second. So there might be up to 0,5s difference between 2 machines, disregarding network latency.

However, are more clear example of independtly is, if you create a trigger in the editor, "myTrigger". And you also create a script if:

waitUntil {time > 10}; 
if (name player == "CarlosTex") then  {
   deleteVehicle myTrigger;
};

Then the trigger on your machine would be deleted. The trigger on everybody elses machine wont.

Got it.

And you got me interested about deleting triggers, how could i delete the triggers for all machines then? Something like this:

[nil,nil,"per",rDELETEVEHICLE,myTrigger] call RE;

Share this post


Link to post
Share on other sites

The question here should be, how to create the triggers where they are needed, not how to delete them after their creation.

CreateTrigger

The following will create a trigger on the server only:

if (isServer) then
{
_trg=createTrigger["EmptyDetector",getPos player];
_trg setTriggerArea[5,5,0,false];
_trg setTriggerActivation["CIV","PRESENT",true];
_trg setTriggerStatements["this", "hint 'Civilian near player'", "hint 'no civilian near'"];
};

Share this post


Link to post
Share on other sites

Thanks, I am learning a lot from all the discussions on these forums.. Hopefuly I can start making SP missions soon.:yay:

Share this post


Link to post
Share on other sites

On a dedicated machine, with a trigger with condition BLUFOR Present.

If one player enters the trigger, would it be true on all machines or just the server and the local client entering the trigger?

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  

×