Comrades in Arms Discussion Board

Full Version: [MP] Village De-Pacification
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Yay, I finally finished it! More or less. Tongue Multi-player co-op version now available. May have a few bugs. I gave it some tests, but I don't have much experience with how scripting commands work in MP.

Now, to e-mail it to Zwobot or Marto or whoever has an email address I can figure out. ;D

Enjoy!

Village De-pacification

for 12 players

Description: 12-man resistance squad attacks Soviet occupiers in village of Larche. They have the option of retreating after a hit-and-run, or trying to fight off significant reinforcements. Should be fairly short and difficult with lots of chaotic shooting.

Features:

--custom sounds (in one version)
--cutscenes
--tactically significant, but not lavish, gear selection
--a fair bunch of scripts adding ambience and difficulty.
--some random elements
--Sorry, no briefing porn. Big Grin

[Image: overshot4.jpg]

[Image: screen3n.th.jpg]

[Image: screen4br.th.jpg]
Sadly, after some testing, mostly on my own, it seems that my mission is a supermassive black hole of desync. Specifically, whenever I try to play my own mission from the server, I get massively desynced about 5 minutes at most after the shooting starts. Enemy troops jog in place. Basically, everything that isn't local to me is completely stuck. What's more, this last time, Osku and Viking were kind enough to play with me. At first, we didn't seem to be having lag issues, and then all three of our computers froze at once.

Pretty bizarre, and very aggravating. The obvious suspects are the fairly large amount of scripted AI behaviour I put in, as well as ambient sound triggers set to "true."

Does anyone know of any working WGL multiplayer missions that use lots of units, scripts, special features, etc? I want to open up such a mission in the editor and compare it with my Village De-Pacification to find out why mine is such a little lag bomb.

I'm having trouble thinking of a very complicated WGL mission. There's maybe that one on Desert Island with the Navy SEALs. Perhaps it's easier to make a complex BAS/FDF mission that doesn't desync, because WGL's features take up more bandwidth. (Right???)

I'm loathe to take out features, but if the alternative is a useless mission, well.... :-[
Hey Kurtz,

I noticed last night that it looked as though your mission crashed the server. Server was shown down but mission was left hanging.

I don't think it's so much the number of units you have as much as a scripting issue. If you have too many scripts running at the same time or long looping scipts that will cause excessive lag. Looking at your scripts in v2.8 SP, beastcoms and beastcoms2 look normal but the others look they have control characters from a word processor. Take a look and you'll see what I mean. Do you use notepad, wordpad or a script editor to write these? I'm not a scripting expert but that looks suspicous. Of course number of units and map ojects will cause lag too, but not to the extent you are seeing I believe.

Looking at your mission.sqm the file size isn't as large as some other missions, there are quite a few units but not excessive it appears. One thing that stood out was this:
Quote:class Item10
{
position[]={6031.349121,125.054993,8606.828125};
a=100.000000;
b=100.000000;
activationBy="EAST";
activationType="NOT PRESENT";
timeoutMin=10.000000;
timeoutMid=10.000000;
timeoutMax=10.000000;
age="UNKNOWN";
name="goodend";
expCond="count thislist < 2 && ""alive _x"" count units armreinf == 0 && ""alive _x"" count units armreinf2 == 0 && ""alive _x"" count units finalspets < 3 && !alive tprt && !alive airreinfor1 && !alive airreinfor2";
expActiv="""3"" objStatus ""DONE""; ""4"" objStatus ""HIDDEN""; [] exec ""celebrate.sqs""";
class Effects
{
voice="Eng35";
track="RTrack9";

One other thing that comes into play in MP missions is the use of Global, Public and Local variables. Something may work fine in single player and be a big problem in multiplayer.

oh another thought, some mission makers use spawn scripts to generate units rather than placing a whole bunch on the map at once and also deletedeadbodies script to unclutter the map. This is an option, but yet more scripts to deal with. Smile
(01-06-2010, 02:10 AM)Zulu1 link Wrote: [ -> ]Hey Kurtz,

I noticed last night that it looked as though your mission crashed the server. Server was shown down but mission was left hanging.

That happens sometimes when I get so utterly desynced that I can't even use admin commands. The first time it happened I freaked out and emailed Lobanak, but as far as I've observed, it always corrects itself in about 20 minutes (or maybe Lobanak is very quick on the ball Tongue ).

(01-06-2010, 02:10 AM)Zulu1 link Wrote: [ -> ]I don't think it's so much the number of units you have as much as a scripting issue. If you have too many scripts running at the same time or long looping scipts that will cause excessive lag.

This is probably it. Sadly, it seems that I'll have to either get rid of some scripts--at least in the multiplayer version--or overhaul them completely. The reason I put so much stuff in looping scripts is so that I could control how often they loop. I believe triggers will always update every 0.5 seconds or so, but they may only need to check every 10 or 20. But clearly this level of desync isn't acceptable. (Hopefully I can get this all fixed before Lobanak yells at me for crashing the server too often!)

(01-06-2010, 02:10 AM)Zulu1 link Wrote: [ -> ]Looking at your scripts in v2.8 SP, beastcoms and beastcoms2 look normal but the others look they they have control characters from a word processor. Take a look and you'll see what I mean. Do you use notepad or a script editor to write these? I'm not a scripting expert but that looks suspicous.

??? I use Geany. In Geany, it looks to me like my scripts don't contain any odd characters.

Now that you've mentioned it, though, I've copied and renamed as .txt both beastcomms.sqs and celebrate.sqs (the final cutscene). Beastcomms is fine, but celebrate has weird square things where there should be line breaks. You might be on to something there. What sort of odd characters do you see?

Pretty bizarre.

(01-06-2010, 02:10 AM)Zulu1 link Wrote: [ -> ]oh another thought, some mission makers use spawn scripts to generate units rather than placing a whole bunch on the map at once. This is an option, but yet another script to deal with. Smile

Tsk tsk, yes, I noticed that when I was snooping around through others' missions. ;D

EDIT: About my mission.sqm, thanks for the thought. Many parts of that file were rewritten for the multiplayer version, though. If you give me your email I can send you an attachment with the latest version.
Quote:Now that you've mentioned it, though, I've copied and renamed as .txt both beastcomms.sqs and celebrate.sqs (the final cutscene). Beastcomms is fine, but celebrate has weird square things where there should be line breaks. You might be on to something there. What sort of odd characters do you see?

Yeah those squares and everything was in one long line that wraped the screen, insted of individual lines. Each line I guess was separted with a square box.
Well, I've done some more tests (Zulu was there) and observed that the mission seems to work allright now. Perhaps it was a server problem. After some minor tweaks which should hopefully reduce the lag even further, I've submitted what should (hopefully) be the final version. Hope ye-ins like this...  ;D
And, as I feared, the mission once again falls into desync after between 5 and 10 minutes or so. :'(

Well, maybe, it could be the server is having a bad day, or I could need to cut out even more stuff. I can't understand how too many triggers and looping scripts could be at fault, because some working missions (e.g. Linoleum) definitely have more triggers, at least. This isn't the most units I've ever seen, either.

I would think that looping scripts would be even less laggy than triggers, but maybe I'm wrong about this. By my count, this mission should have 4 looping scripts running simultaneously, at most. That doesn't sound like a lot to me.

One thing I did notice: I did use an @ command on at least one occasion. Maybe that updates too fast to handle in MP?

Would anyone be interested in beta-testing this mission with me again?
Search your MPMissionsCache for co16_wgl_liberation_of_loukov.noe and check out the spawning scrip inside (makesquad).
(01-11-2010, 10:00 PM)RKDmitriyev link Wrote: [ -> ]One thing I did notice: I did use an @ command on at least one occasion. Maybe that updates too fast to handle in MP?
@ Should have about as much impact on performance as a trigger with the same condition.
(01-11-2010, 11:05 PM)Overlord link Wrote: [ -> ]Search your MPMissionsCache for co16_wgl_liberation_of_loukov.noe and check out the spawning scrip inside (makesquad).

Thank you, that may help.

(01-11-2010, 11:35 PM)Zwobot link Wrote: [ -> ]@ Should have about as much impact on performance as a trigger with the same condition.

Yeah, now that I think of it, I don't think that's a major factor.

Another possible cause that I just thought of is randomness. I used placement radii for many units and waypoints, and gave a few waypoints random countdowns, too. Perhaps this causes an excessive amount of server traffic as the random locations and times have to be synchronized.

I have some rather large condition fields, as Zulu noticed earlier. Do you suppose that's a factor?

This is pretty frustrating. I'm still not completely sure it's the missions fault, since, at least in previous versions, the mission would sometimes get sucked into desync hell and sometimes run fairly well. ???
(01-11-2010, 11:05 PM)Overlord link Wrote: [ -> ]Search your MPMissionsCache for co16_wgl_liberation_of_loukov.noe and check out the spawning scrip inside (makesquad).

Are you sure that script works Overlord? ??? I copied co16_wgl_liberation_of_loukov.noe from my MPMissionsCache, decrypted the PBO, opened "makesquad.sqs", and there seems to be at least one error that keeps it from working.

_group is being used inconsistently as an object or a group, and this results in "type group, expected object" errors, and no units are created. I verified this in the mission editor.

Note the getpos and group commands that are being directed at _group, but it is also used to define the group for createUnit.

Code:
;Create a lock in case our calling script needs to wait for our completion
MakeSquad = true

;Get args
_squadtype = _this select 0
_group = _this select 1
_behaviour = _this select 2
_combatmode = _this select 3
_formation = _this select 4

;Loop through _squadtype reading in each unit and creating it
_itemnum = 0

#MakeSquad
    _unit = _squadtype select _itemnum
    _unitClass = _unit select 0
    _unitCount = _unit select 1
    _unitType = _unit select 2
    _unitInit = _unit select 3
    _unitSkill = _unit select 4
    _unitRank = _unit select 5

    _count = 0

    #CreateUnit
        _unitClass createUnit [getpos _group, _group, _unitInit, _unitSkill, _unitRank]
        _count = _count + 1
        ; small delay to avoid server lag
        ~0.2
        ?(_count < _unitCount): goto "CreateUnit"

    _itemnum = _itemnum + 1
    ?(_itemnum < count _squadtype): goto "MakeSquad"

;Set the various group attributes with some delays to avoid server lag
~1
group _group setbehaviour _behaviour
~2
group _group setcombatmode _combatmode
~2
group _group setformation _formation
~1

;Remove lock
MakeSquad = False

exit

EDIT: This mission appears to be extremely temperamental. I just played it twice and saw extremely little lag. ???

I deem this mission ready for normal play on the server. It's much readier than the dozens of broken ones we have lying around. Wink
You declare squads (units, size and so on) in init.sqs
You'll also need to select which script (makesquad/ makesquadmove) you wanna use in mission.sqm

They seems to work well but I guess they are pretty useless if all units are spawned at once Smile
Hope you get your mission to work correctly, I suspect you got some new greys?  ;D
If you have problems with too many units/groups, CoC AI on demand may be worth a try. I'll send it to you if you want because it's hard to find a working download link for it these days.
(01-12-2010, 04:15 AM)RKDmitriyev link Wrote: [ -> ]_group is being used inconsistently as an object or a group, and this results in "type group, expected object" errors, and no units are created. I verified this in the mission editor.

You are not supposed to call the script with a group, hence the error message. In that script, _group is not supposed to be type group, but type object (aka unit). This is evident from the lines like:
group _group setbehaviour _behaviour

...which return the group of the unit referenced by _group.

Createunit accepts an unit as the second parameter. For example:
"SoldierWB" createunit [getpos player, player]
(01-13-2010, 12:54 AM)Pulverizer link Wrote: [ -> ]Createunit accepts an unit as the second parameter.

Ohhh, now I get it. Big Grin

I guess that I'm not smarter than Overlord and Sheepie and Tricky after all.  Tongue

That's useful to know, I'm going to add a comment to OFPEC's Comref. Thank you. Smile

Is there any purpose for the "_unitType" parameter in the script above? _unitClass is obviously the type of soldier, and I can't see where _unitType is used anywhere in the script, and it seems to work without it. ???

(01-13-2010, 12:06 AM)Zwobot link Wrote: [ -> ]If you have problems with too many units/groups, CoC AI on demand may be worth a try. I'll send it to you if you want because it's hard to find a working download link for it these days.

Thanks, I'll consider it.

(01-12-2010, 11:18 PM)Overlord link Wrote: [ -> ]Hope you get your mission to work correctly, I suspect you got some new greys?  ;D

Thank you, but what are greys? Tongue

EDIT: Grey hairs? It hasn't gone that far, but headaches from too much computer use, oh yes. ;D
Pages: 1 2