Unity Community


Page 18 of 21 FirstFirst ... 81617181920 ... LastLast
Results 341 to 360 of 417

  1. Location
    Sweden
    Posts
    1,418
    Quote Originally Posted by imphy View Post
    I know - that's a problem. Only solution would be to have dedicated hosts but I couldn't afford hosting a large amount of servers =) At least clan matches could be hosted by a third party server to reduce foul play.
    You could just have all clients verify all the "important" commands like loosing health, max speed, et , to detect cheating. You don't even need to verify every command, but something like every X, or verify them all in a batch.
    My Open Source Projects: UdpKit, IronJS, Free Unity Assets
    Need unity consulting? Contact me over PM or Here


  2. Location
    Pennsylvania
    Posts
    2,954
    Quote Originally Posted by strtok View Post
    How do the buffered RPC messages for the Network.Instantiate get destroyed if they're owned by the server? Is unity smart enough to know that if you're destroying the object associated with a Network.Instantiate then it should destroy the buffered RPC associated with its creation too?
    You could always put all server's Network.Instantiates in a different group for each player, and use RemoveRPCs() and specify the group. You'd just need to keep a lookup table somewhere to remember what group is associated with what player.


  3. Location
    Nynashamn Sweden
    Posts
    251
    Is there a way I can check if a NetworkViewID exists?

    When two bullets are fired at a non-player-object (in my case a rigidbody asteroid) the first bullet may destroy the object where the server executes Network.RemoveRPCs(networkViewID) and Network.Destroy(networkViewID).

    The second bullet that hits a split second later generates two error messages:
    Code:  
    1. View ID SceneID: 8 Level Prefix: 0 not found during lookup. Strange behaviour may occur
    and
    Code:  
    1. NullReferenceException
    2. script_GameManager.ApplyDamageToObject (Single damage, NetworkViewID target_NetworkViewID, NetworkPlayer inflictor) (at Assets/Scripts/script_GameManager.cs:111)
    3. script_Bullet.Update () (at Assets/Scripts/script_Bullet.cs:102)

    The first error I can't seem to do much about - I believe Unity may have cached network traffic to the object and it's natural for this error to occur? Can anyone confirm this?

    The second error I could eliminate by checking if the NetworkViewID exists - but I haven't found a way to do this. I tried
    Code:  
    1. if (networkViewID != null) // doesn't work
    2. if (networkViewID == NetworkViewID.unassigned) // doesn't work
    Any suggestions on this?

    UPDATE:
    I solved the second error, I had to use if (target_NetworkView != null) before I tried to get the transform of networkViewID.

    The first error remains though and I think this is standard Unity behavior if two bullets register a hit in the same Update() and the first bullet has enough power to destroy the object.
    Last edited by imphy; 09-23-2011 at 12:38 AM. Reason: Solution for error 2 and more info on problem 1
    SPACE for Unity - Space Scene Construction Kit - Extend Unity, create unique space scenes with a mouse click
    Imphenzia Soundtrack - I make non-exclusive music, exclusive music and sound effects for your games.

  4. Administrator



    Location
    London, UK
    Posts
    3,308
    imphy: Huh...

    http://unity3d.com/support/documenta...tworkView.html

    implies that your solution should work when it says:
    The NetworkView attached to this GameObject (Read Only). (null if there is none attached)

    I think that the problem is, looking at this page, by saying:
    Code:  
    1. if (networkViewID != null)

    ... you are checking if the network view exists on this object.

    Looking at the sample code:
    Code:  
    1. public class example : MonoBehaviour {
    2.     public GameObject other;
    3.     void Awake() {
    4.         other.networkView.RPC("MyFunction", RPCMode.All, "someValue");
    5.     }
    6. }

    ... you need:

    Code:  
    1. ther.networkView...

    Now you may have tried this in your actual code, but from reading what you've posted this seems to be a possible issue.


  5. Posts
    561
    I'm still not able to get networking through a master server to work on mobile devices using 3G. Mobile devices work just fine on wifi, but once I switch to 3G they continue to show up in the server list but cannot be connected to.

    Any insight would be appreciated.


  6. Location
    Metro-Detroit
    Posts
    1,068
    I bought this tutorial a few months ago in hope to getting around to it and I am getting this error-

    Connect.js(40,33): BCW0012: WARNING: 'UnityEngine.Network.InitializeServer(int, int)' is obsolete. Use the IntializeServer(connections, listenPort, useNat) function instead

    Not sure what needs to be done to fix this????


  7. Location
    Nynashamn Sweden
    Posts
    251
    All_American: You can probably download an updated version of the tutorial files if you have purchased it before. Go to the Unity Asset Store and click on the "downloads" button at the top (next to the house icon)
    SPACE for Unity - Space Scene Construction Kit - Extend Unity, create unique space scenes with a mouse click
    Imphenzia Soundtrack - I make non-exclusive music, exclusive music and sound effects for your games.


  8. Location
    Rio de Janeiro, Brazil
    Posts
    21
    Hi
    I bought your package and I have to say congratulations. Your job was great.
    However, I am having a problem and I would like to know if you can help me.
    My game is going to run only in a LAN with no internet connection.
    In my case, the server computer has to run the server application and the unity Master Server (according to what I understood about unity network)
    The problem is: if I have the Master Server running, when I try to run the server game unity returns a error message:
    Failed to initialize network interface. Is the listen port already in use?
    UnityEngine.Network:InitializeServer(Int32, Int32, Boolean)
    Did anybody have this problem already? How can I fix it?

    Thanks a lot


  9. Location
    The Netherlands
    Posts
    881
    Quote Originally Posted by diegomazala View Post
    Failed to initialize network interface. Is the listen port already in use?
    UnityEngine.Network:InitializeServer(Int32, Int32, Boolean)t
    This can only really be the case when the same port is already in use on the same pc. Make sure that you're not running two unity servers on this same PC (e.g. when editor and a build both ran .InitializeServer with the same port)
    Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames

    Unity 3D game portal: Wooglie.com
    Free Unity resources/projects M2HCulling, Networking tutorial and more


  10. Location
    Rio de Janeiro, Brazil
    Posts
    21
    Hi Leepo. Thanks for your attention

    In my case, I have only the Master Server app (downloaded from unity website) running and after that I run Unity Editor.
    My pipeline is as follow:

    1) Start Master Server

    $MasterServer.exe -p 20000
    24-11-2011 10:53:14 LOG Unity master server version 2.0.1f1
    24-11-2011 10:53:14 LOG Master server port set to 20000
    24-11-2011 10:53:14 LOG 1000 connection count limit
    24-11-2011 10:53:14 LOG To quit press Ctrl-C
    ----------------------------------------------------
    2) Start Unity Editor -> Example2_menu

    3) Edit MultiplayerFunction script at method SetupMasterServer

    MasterServer.port = 20000;
    MasterServer.ipAddress = "127.0.0.1";
    4) Play app

    5) Error message popup


    Again, any help is welcome


  11. Location
    The Netherlands
    Posts
    881
    For all multiplayer devs: the GEE game development contest is also open for Unity networking projects(!), see: http://forum.unity3d.com/threads/112...-USD-in-prizes
    Mike Hergaarden - M2H Game Studio - http://twitter.com/M2Hgames

    Unity 3D game portal: Wooglie.com
    Free Unity resources/projects M2HCulling, Networking tutorial and more


  12. Posts
    87
    Does this also cover lan games?
    Vector Quaternion Genius - Unity Noob


  13. Location
    Sooke
    Posts
    3,218
    Quote Originally Posted by Rush3fan View Post
    Does this also cover lan games?
    Lan games work the same way so yes.
    -Insert quote here
    ---Famous Person


  14. Posts
    18
    Will this work with a (very simple) Android project?


  15. Location
    Sooke
    Posts
    3,218
    Quote Originally Posted by Sunrift View Post
    Will this work with a (very simple) Android project?
    Yes
    -Insert quote here
    ---Famous Person


  16. Location
    Seattle, WA, USA
    Posts
    84
    "Jump" serialization in Tutorial 2A2 not working:

    Hi, just bought the tutorial and I'd like to provide a bit of feedback to help improve it, if that's all right

    In tutorial 2A2, the docs post the question "what if we want to move the cube in the Y-direction?", but the code for this in Tutorial_2A2.js is commented out, and you never actually mention the solution. Unfortunately, uncommenting this in both places in the OnSerializeNetworkView results in the following error:

    Code:  
    1. Assets/M2HNetworking/Tutorial 2/Tutorial_2A2.js(41,21): BCE0067: There is already a local variable with the name 'jumpBoolean'.

    From a tutorial standpoint, this is kind of confusing since you are introducing the new concept of serialization. I would assume one would define the jump variable outside the function and then check it's value and serialize it if it's true in the serialize sections, but since in the docs you also say, "The OnSerializeNetworkView fuction always looks as strange as this.", it seems to imply that maybe this is done differently here?

    What's the correct way to make this work?


  17. Location
    Germany
    Posts
    527

    Networking and physics

    Hi, i just bought and ran this UUNP, read through the pdf and had a look at the sample scenes. Without even building and testing it so far i can already say that it already shed light on a lot of my questions. GREAT!

    I am actually interested in more information concerning network games using physics and unfortunately this is not covered at all.

    So maybe somebody can give me some hints, or the author is willing to create another demo scene .

    As an example, though not very realistic but somewhat easy to set up imagine a multiplayer pinball game, where player one controls the left flipper (bumper, wing, excuse my english, i mean the thing that a pinball player usually controls with a left and right button) and player two the other one.
    Then of course there is the ball rigid body, affected by gravity. And there are some automatic bumpers, which are not controlled by a player (you know, those round things which push the ball themselves when hit).

    Thats it.

    From what i learned so far one can do it mainly like this:

    1. The procedures of starting and joining the game are just like all the other demo scenes.
    2. The flippers of the players can also be controlled as described in the other demo scenes.
    3. The ball is a rigid body with network view, its transform state is observed and broadcasted by the server to the clients.


    and now the tricky parts:
    All in common: Where are the collisions being processed? Is this necessary on both machines?

    Example:
    - The ball hits a static bumper. such a bumper is just a collider. It either alters the movement of the ball by its physics material or by applying a force. Now, such a game object is usually in a scene, which the author calls "hard coded". He states this GameObject is thus owned by the server. So what does this mean now? Is the collision detected only on the server now? That would be desired. Or on both? That should not be necessary, as in the end, the balls transforms are observed. Which also means, that the colliders are not necessary on the client at all. So should the clients Gameobject remove its collider component on start?

    On the other hand, the collision could also fire more things, like a visual feedback or some sound. For this the collider would be still useful. Or the server has to send some bumberdidhit RPC, to fire that.

    Same thing would be even more tricky if those bumpers would move in some way...

    Also, applying forces to the ball should only happen on the server. Not on server + clients.

    And all this explained in a best practice way (avoid unnecessary physics calculations, or do those on the client as well and if for what reason?, keep network traffic low).

    The pinball idea isn´t important, basically it could be anything that has:
    - multiple players effect a rigidbody directly
    - the rigid body gets affected be some forces on some event NOT controlled by the players.


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

    And now my dumb question of the day:

    Lets say you develop any game that could also work in network coop mode (lets say a topdown shooter). Would it be a good idea to create this as a network game from the beginning? I mean, the stand alone version of this could just be a start of the server without other players logging in.
    I am asking because i cannot see to much of a drawback for this except the work to set everything up for network and maybe a slight performance hit. What do you think? ( -- ducks --- )
    Last edited by marjan; 12-18-2011 at 03:32 PM.


  18. Location
    Seattle, WA, USA
    Posts
    84

    GUI in Examples 2-5 not working correctly?

    Upon building each of the examples from a fresh project and testing by connecting on two seperate machines:

    Example 2:
    I'm able to connect okay, but the server description and message of the day never show up on the client. Not a major issue, but the big problem is that if I set a password on the server, there is no way to enter this password on the client, thereby making it impossible to join the game. Watching closely, I'm guessing that the password field is being drawn on the client and then immediately being overdrawn by the server name button, but it goes by too fast to be sure.

    Example 3:
    The password problem is the same as in Example two: The server can enter a password, but there's no field in the client GUI to enter it. In both examples there is the text "PW" to the left of the button to join. I don't know if this is just an indictor telling me that there needs to be a password or if it's a label to a password field that is no longer in view because the join button has been drawn over the top of it.

    Example 4:
    This one is actually a bit worse. Again, the server description and message of the day never show up, either in the lobby or the game, though I do realize the functionality may just have not been written in. In this case, however, the name of the server is also not displayed in the client multiplayer menu. Instead, all I see is "gevarres game" no matter what is typed in on the server (gevarre being the player name I'd typed in from a previous example).

    This example also has the same problem of there being no field in which the client can enter a password.

    A further problem with this example is that when there actually is a game running, once a player sends a chat (by hitting enter, entering their text, and hitting enter again to send it), they will be unable to move again until after pressing one of the mouse buttons. Not really a good thing when you've just taunted the sniper on the other side of the room and you are stuck out in the middle!

    Example 5:
    Obviously this one doesn't have the lobby problems because there is no lobby, but it does have the same chat problem as Example 4: once a player sends a chat, they will not be able to move until they click in the main window with one of the mouse buttons. It doesn't matter which one.

    Has anyone else seen these problems, or is it just me? I'm using the current version of Unity (3.4.2f2) and the current version of the projects downloaded two days ago.


  19. Posts
    2

    Help Needed To: Mod Example 4 FPS - & - Create New Maps

    Hello Leepo and Unity3D Community…

    I’m thankful for the Ultimate Networking Project as 1) it works :] and 2) it seems basic enough for a newbie like me to understand. I’m a programming instructor for 6th-12th graders, and I’m hoping that Unity3D would be a good gaming engine to teach development of multi-player networked games. As I'm studying Example 4 FPS, I need help in two basic areas:

    1) When trying to tweak the initial values in Machinegun.js (such as my script values of “var damage=10.0; var bulletsPerClip=50; var clips=20”), such values get lost and are overridden in runtime when inspecting “PlayerPrefab(Clone).CrateCamera.Weapon”. First of all, I can’t find where “PlayerPrefab(Clone).CrateCamera” adopts “Weapon” as a child. Also, where do the new overriding values come from (such as “damage=20.0; bulletsPerClip=30; clips=5”)?

    2) Also, does anyone have any recommendation regarding a good software/process (ideally low-cost or free to develop other level maps? It would be fun to have my students start by developing their own maps for this game.

    Thanks again for any help. Anyways, I hope that this thread is still being supported. jay


  20. Posts
    2,603
    Quote Originally Posted by jay1025 View Post
    1) When trying to tweak the initial values in Machinegun.js (such as my script values of “var damage=10.0; var bulletsPerClip=50; var clips=20”), such values get lost and are overridden in runtime when inspecting “PlayerPrefab(Clone).CrateCamera.Weapon”. First of all, I can’t find where “PlayerPrefab(Clone).CrateCamera” adopts “Weapon” as a child. Also, where do the new overriding values come from (such as “damage=20.0; bulletsPerClip=30; clips=5”)?
    Inspector values have precedence over the ones in the script. So you need to edit the ones you want in the inspector also or make the values private in the script.

Page 18 of 21 FirstFirst ... 81617181920 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •