Drunken Wrestlers 2

Drunken Wrestlers 2

DW2 Workshop
Rate and share maps and game modes created in the game.
Learn More
Synchronise Instantiated Game Objects across Drunken Wrestlers Clients
I have been able to use the [NetworkSync] to synchronise existing objects (position and rotation) in the map for modding.

I have a cannon that shoots a cannonball every X seconds, though I don't have an approach to do this uniformly/consistently across network clients. Doing some research, most engines allow you to use a Network.Insantiate(), Network.Spawn or Photon.Instantiate - this basically makes the engine responsible for synchronisation.

I don't know what network engine/framework Drunken Wrestlers uses, but would you be able to expose this feature to the API for modders to use.

Regards
ApocalypticSoup
< >
Showing 1-4 of 4 comments
Siolfor 2 30 Nov, 2020 @ 4:01am 
I too would like this information.
Oleg Skutte  [developer] 27 1 Dec, 2020 @ 1:28am 
It would be impossible to expose Photon's .Instantiate() API, because it only works for objects that are packaged with the game in the Resources folder.

The game has to know what data to send and receive over the network ahead of the time. If you change the size or order of the data at runtime, it will end up in a wrong place. All clients have to update the mappings at precisely the same moment for it to work, and that's impossible.

If you are fine with having a set amount of synchronized objects and just recycling them, take a look at how this map does it
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1920401610

You can also use [RPC] attribute to call methods remotely, which could be helpful
using UnityEngine; using DrunkenWrestlers2.Networking; public class RPCTest : MonoBehaviour { void Start() { Network.RPC("SendRPC", NetworkTargets.All, new object[] {true}); } [RPC] public void SendRPC(bool argument1) { Debug.LogFormat("Recieved RPC: {0}", argument1); } }


At some point in the future I will probably try making my own solution similar to having a Resources folder in Photon, but it's not going to be any time soon.
Last edited by Oleg Skutte; 1 Dec, 2020 @ 1:32am
Thanks SkutteOleg. I will adopt the approach of pre-creating the cannonballs and just hiding them on the map somewhere.

Thank you for your prompt reply and assistance.
Tested and working, thanks again!!!
< >
Showing 1-4 of 4 comments
Per page: 1530 50