|
Post by lifevirus on Feb 7, 2016 18:54:05 GMT
My team has been trying to use Photon Network to create multiplayer and we're coming upon a issue where when we load a test level/pre-game level with networking the first spawned killable player plane isn't acknowledging the world variables we have set up in a playmaker script. However when we have a second plane spawn, it will recognize them. If we delete the first one, the second one loses the connection and won't recognize the world variables for some reason. Is there a specific reason why the script wouldn't recognize then?
We have the LevelWaveSetting prefab set up with all the proper variables and stuff and in a normal single player instance it works just fine. It seems that the network loading causes issues or it's a timing issue. Does CGK have any issues with Photon that I may have missed or anything you can think of that may be the issue? The only thing I can think of is that I have to spawn the killable plane after everything else has loaded including the camera or the LevelWaveSetting needs to have a network script on it too.
Any help is appreciated.
|
|
|
Post by lifevirus on Feb 7, 2016 19:02:21 GMT
Not sure if this is related either but this shows up when we load the multiplayer level too.
ArgumentException: Key duplication when adding: KWStat_J20 Score System.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Hashtable.cs:831) System.Collections.Hashtable.Add (System.Object key, System.Object value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Hashtable.cs:474) PreviewLabs.PlayerPrefs.Deserialize () (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Utility/PlayerPrefs.cs:239) PreviewLabs.PlayerPrefs..cctor () (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Utility/PlayerPrefs.cs:50) Rethrow as TypeInitializationException: An exception was thrown by the type initializer for PreviewLabs.PlayerPrefs DarkTonic.CoreGameKit.InGameWorldVariable.get_CurrentIntValue () (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/WorldVariables/InGameWorldVariable.cs:45) DarkTonic.CoreGameKit.InGameWorldVariable.set_CurrentIntValue (Int32 value) (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/WorldVariables/InGameWorldVariable.cs:60) DarkTonic.CoreGameKit.WorldVariableTracker.Init () (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/WorldVariables/WorldVariableTracker.cs:111) DarkTonic.CoreGameKit.WorldVariableTracker.Awake () (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/WorldVariables/WorldVariableTracker.cs:47)
|
|
|
Post by DarkTonic Dev on Feb 8, 2016 0:14:47 GMT
We are currently trying to do the same thing. There are several problem with using CGK as is with multiplayer games.
1) Each client will spawn the stuff set up in Syncro spawners, making X times as many. 2) Pooling doesn't work. 3) Killables will try to take damage on each client. 4) World Variables are pretty much useless. 5) Probably some other issues as well. Haven't found them yet.
There is a line at the top of PoolBoss.cs that you can uncomment to fix 1-3, but #4 needs a custom solution. That line is this:
//#define PHOTON_NETWORK
This is not supported and is pre-beta, but you can try it if you want. The reason World Variables are useless is because Killables are only destroyed on the client they were created on. In most cases that means player #1 gets all score and other WV from destroyed Killables, regardless of who killed it.
There's a couple other things that need to be done via code with this setup, like telling LevelSettings to Initialize after the first player has joined a room. So like I said this is unsupported and pre-beta. Basically you're on your own, but a few things have been taken care of.
|
|
|
Post by lifevirus on Feb 25, 2016 6:27:31 GMT
I know you said that Photon stuff isn't supported but I figured I'd let you know. When you activate the Photon define in the script this error appears:
Assets/Plugins/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs(16,2): error CS0246: The type or namespace name `Photon' could not be found. Are you missing a using directive or an assembly reference?
At least there's a framework in place which makes me happy. Not sure what's causing it currently, a friend said he moved all the files to the main asset folder and it fixed it but I'm not getting the same result.
Figured I'd let you know.
|
|
|
Post by DarkTonic Dev on Feb 25, 2016 6:34:03 GMT
You probably need to move Photon plugin into the Plugins folder for the code to be able to "see" Photon Code.
However, I noticed that the Photon code in CGK isn't all in the released version on the Asset Store, so it's not going to work anyway right now.
|
|