Iam starting multiplayer functionality and followed a few tutorials and read quite a bit at this point but am running into issues. The symptoms I have currently are this; 1-> Starting as a server or setting it up to click as server does not impact authority
2-> The host client gets full authority (I put this hear because when I instantiate them both at same time, they both are hosts until I click join, I later changed it to neither are hosting and start it lobby style but same errors creep up)
3-> lots of errors,
when I try to give my camera set_multiplayer_peer, or similar it really doesnt like it, and if I make the camera a child of the character body things get alot more messed up lol. any advice on how to get both spawners to have permission?
Your set authority looks wrong. There would be no way for the replication to take effect that way on the remote side. This is because after you give authority on the host, that player will wait for info from remote. Then the remote side is spawned waiting for the host to send info. They both wait on each other.
I have confirmed that the MultiplayerSpawner can spawn multiple things together. I dont have enough time to test everything tonight, but by sunday I should be able to take more of a look at what needs to be done. Free time is a luxary!
I think i found the source of most of my issues. I had the idea since I was running both clients as Host first and then they both generate a body while they are host that might of been the root issue. So following the advice I just simply had the body delete itself before hosting (visual under).
Host->Spawn body->waiting->(still has body)+spawn new body->host controls body
I created a chatbox just to type and have a bigger picture.
what I think is happening is rather odd. The host starts off as 1 (they all technically do). A new one joins in, loses its 1 number and gets unique id (all good, this is why I thought it was done and good). add client 2 and Host + client 1 have the same name now? add client 3 and host does the same thing but client 1 and 2 all have matching names with client 3 being the only unique.
to me this tells me thier names are changing after being set up but according to Godot they still have the same names
I started doing print functions and added some new code to try and narrow down to problem once and for all
The thing im following uses 3 tags here and it doesnt complain for them.
(at this point I am trying to follow a tutorial to try and increase my understanding but seems my attempts just are narrowing the problems)
I still seem to be failing to set the name properly? I tried putting it in an index but it just shows the problems ive been having more obviously.
I found some time to mess with the code today. I still am so confused about the whole authority thing. I have a body being generated by the spawner, and according to the prints they are being named correctly. All clients (host included) see all bodies but only the host moves (the clients arent moved by the host now though). The camera of the clients moves automatically to the host. I put in an ingame chat to see what is going on with the whole authority thing.
Just so you are aware when running multiple windows from the editor they will share the output for print statements, it will be hard to separate messages unless they have identifying information which game instance they come from.
You are potentially checking too early for the client instances authority will still be host auth at this point. Client instance operator_id will not have been set yet? (Unless there is code, not shown, setting the operator_id on the spawned client instance?)
were there is a real multiplayer game that i can play in my consoles connected via jacdac, but that game is made using JavaScript instead of using blocks, so users learning makecode arcade with blocks can not make their own multiplayer games.
Is this class which make possible to have a real hardware multiplayer game done using blocks without doing any more, or anybody has any sample on how to use jacdac-game extension or this class ?
Nope, we do not have blocks yet for hardware multiplayer. The only sample we really have for jacdac right now is the game you linked. There is some more info about jacdac and some helpful debugging tools here:
Let's learn how to get started with Netcode for Game Objects which is Unity's Official Multiplayer solution.
This is possibly the longest tutorial I've ever done and it's the only tutorial you need to get started making Multiplayer games!
1. Jester currently has M4 off during normal startup, and keeps it off throughout the sortie, and this results in other aircraft's IFF not getting friendly returns through their datalink
2. My group is considering implementing IFF codes into our deployments, and part of that is using LotATC to automatically recognize specific codes to display mission type, package number, etc. for specific aircraft/flights and part of the discussion inevitably ended up being that Jester crewed tomcats would just read (00)0000 with no indication of what that aircraft is, are they a friendly, what it's mission type is, or what his package he is a part of.
3. Further development of IFF inside of DCS may call for this at some point, and having Jester be able to set it up now for single human crewed tomcats may make life easier for the future.
4. Switches are already working and have values set to each, just an action to change it from the front seat as a "Jester" pilot would be helpful for multiplayer.
The fundamental (and most interesting in my view) part of any online game is the network model - i.e. how is the game state replicated between different players, and how do you go about letting all the players affect their shared game world.
I think snapshot interpolation is the best option, though it does have some downsides. The interpolation itself does introduce some extra latency (i.e. the client always needs at least 2 state packets in hand, to interpolate from and to.)
State synchronisation however can be a real pain - you have to carefully pick which parts of the state to send to the client (you want to save bandwidth). A change to game code can require a change to network code, this is very brittle, and asking for multiplayer bugs which are difficult to diagnose. In order for the client to run the simulation for replicated objects, the state sent from server to client is larger than with snapshots. In addition to this, the data sent to the client has to be more accurate, and cannot be as compressed as snapshots can be. As a result of both of these points, individual objects have to be updated less frequently, this means that when the client and server do diverge, it will take longer to correct - resulting in unsightly popping.
Sending data from one machine to another is done by bundling together a series of bytes in a packet, and sending it via a socket on the sending machine, to another socket on the receiving machine. That packet might reach its destination, or it might not. It might even arrive multiple times. A series of packets could very well arrive in a completely different order from which they were sent. This sounds pretty chaotic, which might lead you to consider using TCP sockets, which guarantee that packets will arrive reliably at their destination, once, in the order in which they were sent.
The assignment of INADDR_ANY is to allow the socket to accept packets on all interfaces. We could if we wanted, bind the socket to only receive packets from other processes running on the same machine. In our case though, we want to accept connections from other processes on the same machine, or machines on the local network, or other machines via the internet.
Hello guys! i am trying to make my first game that involve multiplayer and singleplayer. The game is a shooting game, you can move and shoot other players. in singleplayer you will shoot AI and in multiplayer you will shoot other real players.
Right now i am designing the code (UML) and i ran into a problem - I am trying to design the Player class, the problem is that this class is different between singleplayer and multiplayer. why? lets give an example:
The moving function on singleplayer will just move the player on the screen. in multiplayer it will move the player & send the new location to the server
Another example is when shooting players. In singleplayer when the player shoots another player It will just damage the other player, in multiplayer when shooting other player, the client will send to the server the action of shooting and the server will tell the client if the player actually hit the target and how much should it damage. In both single&multi of course you will play sound and trigger blood animation and so on
My point is that although you have similar code between multi&single the implementation is still different between single&multi
how can you design class like the Player class in these kind of games? Is inheritance is the correct answer? if so how would you design it?
You can design games so that they are always handled the same way. Whenever I review designs at work I frequently remind the team that if a game is single player, that means that TODAY it is single player, but might not be tomorrow. I remind them that a single player game should still be written as a multi-player game, it happens to currently have a player count of one, but designs can change over time.
There's no reason not to use the same class, just keep track of whether or not the game is in single player mode or multi player mode, and if in single player mode, don't try to execute multi-player only code.
The difference is that server constantly serialises the entire game-state and synchronises it over to each client (usually as state-deltas/patches), while the client deserialises the game state and either rewinds into the past with interpolation, or fast-forwards into the future with extrapolation. Some small parts of the code might then be marked as client-only / server-only / not-run-during-extrapolation / etc... But most of the gameplay code is unaware of the networking.
3a8082e126