Jump to content


Photo

Solving Out of sync Errors


  • Please log in to reply
29 replies to this topic

#1 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 04 April 2009 - 09:49 PM

EDIT : Changed Topic Title !!!!

Hi what's the trick with Notification Boxes
I want only a certain Player to see
Eg -If PLAYER 1 has unit type Rohan Frodo in WAYAREA Then
Show Hint Box to Player 1 ONLY

I still see if I'm player 2 ;)

Also Camera Movements
Eg -If PLAYER 1 has unit type Rohan Frodo in WAYAREA Then
Camera Moves for Player 1 ONLY

Thanks a bunch :p

Edited by JUS_SAURON, 09 April 2009 - 11:28 PM.


#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 04 April 2009 - 09:51 PM

Did you put the scripts in the Player's script area? IF you did i believe the scripts only work for that player, but i may be wrong :p
Ridder Geel

#3 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 04 April 2009 - 10:14 PM

Did you put the scripts in the Player's script area? IF you did i believe the scripts only work for that player, but i may be wrong ;)

I did but still everybody sees
CHECK SCREENSHOT

[attachment=22485:SCRIPT_HELP.JPG]

PS THE MAP IS 99% finished ,This secret is not much a hint if Everybody Knows LOL :p

Any Testers welcomed !!

I will upload screenshots after a week of testing

#4 m@tt

m@tt

    #######

  • Project Team
  • 4,056 posts
  • Location:England
  • Projects:The Dwarf Holds
  •  T3A Chamber Member

Posted 04 April 2009 - 10:59 PM

Also Camera Movements
Eg -If PLAYER 1 has unit type Rohan Frodo in WAYAREA Then
Camera Moves for Player 1 ONLY

Thanks a bunch :p


I think just the regular camera scripts will do this.

The RJ Cam uses scripts to change the camera angle, and that only affects the player who activates it (it's been tested in online matches). I imagine the same applies for moving the camera.
Posted Image

#5 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 05 April 2009 - 02:00 AM

Thanks I got it to work // both camera and objective screen

#6 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 05 April 2009 - 11:41 PM

If you put the scripts in the different players' folders it won't make any difference (they work for everyone)
There's a method to make scripts work for a particular player instead of everyone, here's the tutorial.

Be careful how you use this, as you may cause Out-Of-Sync errors during online play if you make, for example, spawn a creature for one player only. (The other player's computer goes "wtf?" :crazed:)

Posted Image


#7 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 06 April 2009 - 11:42 PM

If you put the scripts in the different players' folders it won't make any difference (they work for everyone)
There's a method to make scripts work for a particular player instead of everyone, here's the tutorial.

Be careful how you use this, as you may cause Out-Of-Sync errors during online play if you make, for example, spawn a creature for one player only. (The other player's computer goes "wtf?" :thumbsupsmiley:)

Yes thanks again CRUSARD .Used that same tip which is pinned above also.

Interested in Out-Of-Sync errors as the map is intended for 7-player online
each player as one different faction (men split into Rohan and Gondar )
I would like to know about what may cause these Out-Of-Sync errors
and subsequently how to correct them .Thanks

1. Spawning a unit - Can this be solved by using Team builder for player
and then adding this team to gameplay

2.What else causes errors ??

#8 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 07 April 2009 - 03:21 AM

OOS errors are caused by events that all players should be able to see, but only fire in one computer.
Some examples: Unit spawning, add resources, trigger a commandbutton ability, remove an unit, etc.
(You don't really need to make these events for one player anyway, since you can especify "spawn unit for player_2", "add money to player_4", etc)

The events that don't affect gameplay don't cause these errors. They are any form of text, camerawork and sounds.

Posted Image


#9 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 08 April 2009 - 04:11 AM

OOS errors are caused by events that all players should be able to see, but only fire in one computer.
Some examples: Unit spawning, add resources, trigger a commandbutton ability, remove an unit, etc.
(You don't really need to make these events for one player anyway, since you can especify "spawn unit for player_2", "add money to player_4", etc)

The events that don't affect gameplay don't cause these errors. They are any form of text, camerawork and sounds.

I am hoping that using tihis method will eliminate OOS errors
I build teams for the different Factions / Players
There are scripts in CivilianPlayer Folder that spawn recruitment team (that belongs to a certain player from BUILD TEAMS )
These scripts are inactive
There are then scripts in the individual players folders that enable these scripts
I hope this solves OOS errors as I cannot test this myself (no network computers )

in civilian folder :
OATH_BREAKERS_SPAWNING1 : ns na D
*** IF ***
True.
*** THEN ***
Spawn an instance of Team 'Player_1/ARMYOFDEAD' at Waypoint 'ARMYOFDEAD'.


in player_1 folder :
OATH_BREAKERS :ns A D

*** IF ***
Unit 'MINAS_TIRITH_TOWER' Health IS Less Than 250 percent.
*** THEN ***
Player 'Player_1' fires Special power 'SuperweaponSpawnOathbreakers' at Waypoint 'ARMYOFDEAD'.
Play Sound 'AragornVoiceSummonOathbreakers' at Waypoint 'ARMYOFDEAD'.
The map is permanently revealed at Waypoint 'OSGILIATH' with a radius of 300.00 for Player '<All Players>'. (Afterwards referred to as Reveal Name: ARMYOFDEAD_REVEAL).
Player 'Player_1' fires Special power 'SpellBookArmyoftheDead' at Waypoint 'ARMYOFDEAD'.
Player 'Player_1' fires Special power 'SpellBookArmyoftheDead' at Waypoint 'ARMYOFDEAD2'.
(DISABLED) Spawn an instance of Team 'ARMYOFDEAD' at Waypoint 'ARMYOFDEAD'.//****disabled for possible OOS****
Enable Script 'PlyrCivilian/OATH_BREAKERS_SPAWNING1'.*****hope this solves OOS******
A radar event occurs at Team 'ARMYOFDEAD' of type Information
A radar event occurs at (3134.00,3195.00,0.00) of type Information
Player 'Player_1' fires Special power 'SpellBookArmyoftheDead' at Waypoint 'OSGILIATH'.
Player 'Player_1' fires Special power 'SpellBookArmyoftheDead' at Waypoint 'OSGILIATH'.
Move Team 'ARMYOFDEAD' to Waypoint 'ARMYOFDEAD_MORE2'.

----------------------------------------------------------------------------------------------------

I you are willing ,Check out the map in SHOWCASE under New Map For BFME2
I am hoping that spawning TEAMS that are already known by WB /MAP at startup
will solve OOS errors but can't know for sure

Try the Map and rate ,THANKS TO ALL :good:

Edited by JUS_SAURON, 08 April 2009 - 10:31 AM.


#10 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 08 April 2009 - 07:03 PM

That script will cause a nasty OOS :S
Here are the reasons:
  • Fire Special Power: The Player_1 "entity" fires a special power in Player 1's computer, but for the other players' computers nothing will have happended, this is a possible desync.
  • Enable Script: In player 1's computer a script that spawns units is enabled, while on the other computers it isn't. Enabling the script is exactly the same as trying to spawn the units directly. Unit spawns in P1's computer, and it doesn't in the others'.
  • Reveal Map: This one is tricky. On its own, it's just visibility. But since some skills require line of sight to be used, if an enemy unit (one of the other players' units) can fire an ability for P1's computer, but on the other players' computer there'll still not be LoS for that unit to fire, so you have another nasty out of sync here.
Remember: All computers must know what's going on in the game (if an unit spawned, if something used a special ability, etc).
Other players' computers don't care if there's something like text, a radar event, or a sound in Player 1's computer (these don't affect gameplay), so you can make individual-player scripts for these effects.

This is what your script should be like:

SCRIPT 1: Fires the special powers and spawns team. Reveals map at waypoint for player 1 only. (For all players. Place in (neutral), PlyrCivilian, etc)
*** IF ***
		Unit 'MINAS_TIRITH_TOWER' Health IS Less Than  250  percent.
*** THEN ***
	The map is permanently revealed at Waypoint 'OSGILIATH' with a radius of 300.00 for Player '<Player_1>'. (Afterwards referred to as Reveal Name: ARMYOFDEAD_REVEAL).
	Set Player 'Player_1's Special power 'SpellBookArmyoftheDead' to  0  seconds.
	  Player 'Player_1' fires Special power 'SpellBookArmyoftheDead' at Waypoint 'ARMYOFDEAD'.*
	Set Player 'Player_1's Special power 'SpellBookArmyoftheDead' to  0  seconds.
	  Player 'Player_1' fires Special power 'SpellBookArmyoftheDead' at Waypoint 'ARMYOFDEAD2'.
	Set Player 'Player_1's Special power 'SpellBookArmyoftheDead' to  0  seconds.
	  Player 'Player_1' fires Special power 'SpellBookArmyoftheDead' at Waypoint 'OSGILIATH'.
	 Spawn an instance of Team 'ARMYOFDEAD' at Waypoint 'ARMYOFDEAD'.**
	 Move Team 'ARMYOFDEAD' to Waypoint 'ARMYOFDEAD_MORE2'.
*SuperweaponSpawnOathbreakers is a special power of the aragorn object, so it will not work if you make "player_1" use this special ability (This is not the special ability of its spellbook, use SpellBookArmyoftheDead instead)
**Why did you use the specialability AND spawn the units? Using the special ability should spawn the units already...




SCRIPT 2: Plays a sound and displays two radar events. Only works for player 1. (Place in Player_1's special inactive folder, you've read the tutorial, right?)
*** IF ***
		Unit 'MINAS_TIRITH_TOWER' Health IS Less Than  250  percent.
*** THEN ***
	A radar event occurs at Team 'ARMYOFDEAD' of type Information
	A radar event occurs at (3134.00,3195.00,0.00) of type Information*
	Play Sound 'AragornVoiceSummonOathbreakers' at Waypoint 'ARMYOFDEAD'.
*You were just trying out two radar event different methods, I'm guessing? you should only leave one of them in the final version!



Lesson of the day: Only use player-selective actions for text, camerawork, screen effects, and sounds.

Edited by Crusard, 08 April 2009 - 07:10 PM.

Posted Image


#11 Devon

Devon

    Dark Nerd of the Sith

  • Global Moderators
  • 5,886 posts
  • Location:Colbert Nation
  • Projects:RJ RotWK, Twilight of the Republic, HDLH
  •  T3A Chamber Member
  • Division:Community
  • Job:Global Moderator
  • Donated

Posted 09 April 2009 - 12:00 AM

There is definitely a tutorial for this somewhere...


Aha!

http://www.the3rdage...tem-109?addview



Oh, wait, that'll still cause an OOS. Crap...

Edited by Yoda_, 09 April 2009 - 12:02 AM.

yodasig2.png
My political compass
There's a story that the grass is so green...what did I see? Where have I been?


#12 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 09 April 2009 - 05:01 PM

There is definitely a tutorial for this somewhere...
(...)
Oh, wait, that'll still cause an OOS. Crap...


Yoda, read the whole topic before posting :)

Posted Image


#13 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 09 April 2009 - 11:43 PM

I will definitely try what you recommended !

Some questions :

So I put in the same script in each Player Folder eg
PLAYER_1 :
If UNIT-MinasTirith < 100% Health then
Spawn Team_1 for player_1
Use Spell Book power for Player_1

PLAYER_2 :
If UNIT-MinasTirith < 100% Health then
Spawn Team_1 for player_1
Use Spell Book power for Player_1

Will this not Spawn Team_1 7 times (once for each player ?!?)--Will Test !

-------------------------------------------------------------
Will this work :

I set the units off map owned by player neutral
When I need them for one player

In player_civ folder

If UNIT-MinasTirith < 100% Health then
Unit_Horde for player_1 goes to waypoint on_map
Unit_Horde owned by player_1
Fire special_power Spell_book_x for Player_1




Thanks again CRUSARD !!! :p

Edited by JUS_SAURON, 10 April 2009 - 03:51 AM.


#14 Devon

Devon

    Dark Nerd of the Sith

  • Global Moderators
  • 5,886 posts
  • Location:Colbert Nation
  • Projects:RJ RotWK, Twilight of the Republic, HDLH
  •  T3A Chamber Member
  • Division:Community
  • Job:Global Moderator
  • Donated

Posted 10 April 2009 - 03:34 AM

There is definitely a tutorial for this somewhere...
(...)
Oh, wait, that'll still cause an OOS. Crap...


Yoda, read the whole topic before posting ^_^




Yeah, read the title and jumped the gun. My bad ;)

yodasig2.png
My political compass
There's a story that the grass is so green...what did I see? Where have I been?


#15 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 10 April 2009 - 08:53 AM

With the limitations on what can be achieved via scripts on multiplayer maps, start figuring out existing triggers in codes. If you are working on a map that is part of a mod, this should be easy, since you can quickly adjust code sequences that will be relevant to every player.
For example:

Have an object on the map (invisible, unattackable) with multipurpose behaviors at hand. Any sort of thing happening on the map, the object can react, by, for example, firing a weapon ( code works for all players), using a specialpower (especial OCL-powers to create new objects), it can be used as a reference point to determine proximity of this or that player's unit to strategic points, etc.

The Important thing is that this object must be placed on the map by hand (or spawned for all players by code), but cannot, obviously, be spawned by script.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#16 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 10 April 2009 - 04:39 PM

Sûlherokhh: Not sure I understood ^_^

JUS: You don't need to make a copy on each player's folder. Remember that the worldbuilder runs scripts for ALL PLAYERS no matter on which folder they are. It's the same if a script is on (neutral) or Player_2. It'll run in all computers and for all players.
The scripts are player-selective only by using the method mentioned in the tutorial.

The SpawnTeam-FireSpecialPower script should be in only one folder (I use (neutral) for my global scripts).

The other script should work. I'd put the unit ownership change before the move order, just in case.

Edited by Crusard, 10 April 2009 - 04:47 PM.

Posted Image


#17 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 10 April 2009 - 09:13 PM

Take the BfMe1-AI scripts as a template of what scripts you can use in multiplayer mode without desynch errors.
You will note that the AI never uses the spawn scripts, for instance.

The solution is this: Start the map with 2-8 (# of players) specially designed TriggerObjects. Just make a ChildObject of one of the TacticalMarker objects (found in 'data/ini/object/system/ai.ini'). These objects need to be inherited by script to the specific player. Just modify the basic inherit-scripts in the inherit-library.

Give these objects a new behavior that spawns objects on the spot like Aragorn:
Behavior = OCLSpecialPower ModuleTag_OCLSpecialPower
  SpecialPowerTemplate = SuperweaponSpawnOathbreakers
  OCL = OCL_GondorArmyofTheDeadEggSmall
  CreateLocation = CREATE_AT_LOCATION
  StartsPaused = Yes
  SetModelCondition = ModelConditionState:USER_1
  SetModelConditionTime	= 8.1
End

You will need a new OCL, by replacing 'OCL = OCL_GondorArmyofTheDeadEggSmall' with an OCL of your own making, with a list of objects to be spawned. You can either create an Egg (an object that spawns several different objects and adds FX upon expiring [via LifeTimeUpdate and SlowDeathBehavior-DeathOCL + an additional OCL]) or just create the objects you want right away.

Next you place a named waypoint on the map (or several, depending on where you want the objects to spawn, which could be different places for each player)

Then you proceed, like in the tutorial i think, with having the scripts (one set for every player) define certain trigger conditions. Those will in turn activate the TriggerObject's SpecialPower, aimed at the specific waypoint. It's called something like 'Fire SpecialPower at waypoint'.
If there is no script like that, i am not exactly sure and don't want to check right now, there is a script called ~ 'Fire SpecialPower at object'. If you want to use the latter, just replace the waypoints with another set of custom named 'TargetObjects'. The AI will find them and fire the OCLSpecialPower at exactly those waypoints (or objects).

Since the spawning will be done by code, there isn't going to be any desynch.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#18 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 10 April 2009 - 10:42 PM

- You can make any scripts work without any desyncs in multiplayer.

- To spawn, as in the example, the army of the dead (with proper summon FX) you can use a global script* that spawns the army of the dead Egg that comes with the game (This is how I'd do it). No need to do any map.ini! :rolleyes:


* Global/normal scripts run for all players, no out-of-sync occurs.

Posted Image


#19 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 11 April 2009 - 02:03 AM

- You can make any scripts work without any desyncs in multiplayer.

- To spawn, as in the example, the army of the dead (with proper summon FX) you can use a global script* that spawns the army of the dead Egg that comes with the game (This is how I'd do it). No need to do any map.ini! :p


* Global/normal scripts run for all players, no out-of-sync occurs.

THANKS for all the help !! :rolleyes:
I put the scripts in ONLY Civ Folder
The Spawn seems to be good as it hopefully is registered as GLOBAL
When I play as Good / Evil the scripts work as required
------------------------------------------------------------------------------
Remember ,If you want to preview the map it is in showcase

ABOUT MAP :

It is a SEVEN player Skirmish map
It has all the main places in Middle Earth
It has TWO TOWERS Helms's Deep and March of Ents Script (from BFME2)
It allows Men to be Split into Rohan and Gondor

Main Gameplay :
---------Good--------------------
Frodo starts as the Ring-Bearer
Get Him into Mordor to win the game
Hold Osgiliath and Helms Deep
-----------Evil ------------------
Protect the Dam or Isengard will fall
Find Frodo an get the ONE RING !!

Control Mordor AND Isengard as Player 2 if Player 3 is not present !
Control Minas tirith AND Helms Deep as Player 1 if Player 4 is not present
Minas thirith -player 1
Mordor - 2 // Isengard -3
Helms Deep -4 // Elves - 5
Dwarves - 6 // Wild 7

#20 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 11 April 2009 - 05:02 AM

It has all the main places in Middle Earth

Crazy stuff you got there, gonna check it out next week :blush:

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users