![]() The server then carries out the input and sends back a “picture” of the resulting world. The clients have (almost) no code, they are just dumb terminals sending input (key presses) to the server. The server has the game “world” and the clients just receive a view on this world. To avoid having to wait on the slowest computer, each computer now communicates with a single server. Real Time Strategy games typically use variants of peer to peer lockstep, albeit with better handling of the lag issues. The disadvantage of this networking solution is that each computer has to wait until it has received the move from the last computer, the slowest computer thus determing the pace of the turns (and thus lag). Assuming that all computers started from the same initial game state, this would ensure that all games played out identically across computers. Once all the computers had communicated their next move to all the other computers, each computer carried out the moves after which it was time for the next turn. The game consisted of “turns” and in each turn a computer could choose from a limited number of “moves”. Initially, each computer exchanged game information with each of the other computers in a star topology. A brief history of networkingīefore diving into the networking solution that Unity offers, lets briefly look at the history of multiplayer games and their networking solutions. lossy connections and the handling of lost dataįor real time games the above problems are especially relevant and if not handled correctly will result in players experiencing “lag”.differing network latency between players (round trip time), and differences in the variation thereof (jitter).players with differing connection speeds.players playing on differing hardware platforms (cpu/memory), such as pcs and mobiles.This will require the handling of problems such as: However in order to get it to work in build mode i hade to move one line of codeĭebug.If you are planning to make a multiplayer game in Unity, be it two player turn based or massive multiplayer online, you will have to implement some sort of networking solution capable of ensuring that all players share the same consistent world view. If ( ("player1"))įlameOn1 = playerPrefab1.GetComponent(PlayerMove1) Īnd the debug log was posting fine and it worked in editor mode so i assumed that the script was fine. I had some other code in my Ontrigger function so it looked like t$$anonymous$$s ![]() Okay dokay have t$$anonymous$$s one fixed now sometimes you just have to bash your head against a problem till your head hurts or it goes away. Got to love Unity's infinite usefulness in saying "Strange behavious may occur" as though my computer is going to flip out and start t$$anonymous$$nking it's a toaster or somet$$anonymous$$ng lol. Of w$$anonymous$$ch when googled I found one result w$$anonymous$$ch turned out to be caused by an object being inactive, mine are all active however. Strange behaviour may occurĬouldn't destroy object because the associate network view was not found View ID AllocatedID: 0 not found during lookup. Network.Destroy (GetComponent(NetworkView).viewID) My question is has anyone else experienced problems such as t$$anonymous$$s and if so what steps did you take to solve it? Should I try a different method to calling destroy (gameObject)? Is there particular export settings w$$anonymous$$ch I should adjust? Any help people may provide will be greatly appreciated.Īs per Keith's post I have added t$$anonymous$$s line of code to the script I'm not sure how relevant that is but it may help to give you a bigger picture of my situation. Admittedly our physics does act different during build run but it's alot smoother and more dynamic (w$$anonymous$$ch is a good t$$anonymous$$ng is t$$anonymous$$s case) than in editor mode. ![]() ![]() My game is setup for network play and I had a look around the internet for an answer but mainly what turned up are physics related problems with the car tutorial. I have several of these scripts for different prefabricated objects and none of them work during a build run. W$$anonymous$$ch works perfectly fine when played during editor preview. I have a simple script that saysįunction OnTriggerEnter (collision : Collider)ĭebug.Log ("gameObject should be destroyed") Like the title says, my game is not working correctly when I build and run it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |