• Unity3D - Discussion
    5,004 replies, posted
[QUOTE=thomasfn;43285236]I can confirm, it does use uLink - unless the libraries for it are included but not used.[/QUOTE] Excellent thanks gents have a happy holiday if you celebrate one.
[img]https://dl.dropboxusercontent.com/u/3715122/Coding/Uv_help.PNG[/img] Playing around with creating a procedural equilateral triangle mesh. Anyone got an idea on how to UV this thing? Trying to make some flat shaded terrain and couldn't figure out how to make the default unity terrain not share vertices.
after 4 days of work, networking is "done". Time to port this into my lander game for multiplayer :v: [t]https://dl.dropboxusercontent.com/u/13781308/ShareX/2013-12/2013-12-23_19-51-31.png[/t] [t]https://dl.dropboxusercontent.com/u/13781308/ShareX/2013-12/2013-12-23_19-53-26.png[/t] Working chat that displays the 8 most recent chat messages. [editline]edit[/editline] shit, forgot chat names [editline]23rd December 2013[/editline] [t]https://dl.dropboxusercontent.com/u/13781308/ShareX/2013-12/2013-12-23_20-14-22.png[/t] ok names working.
[url=http://learnunity2d.com/]http://learnunity2d.com/[/url] Website with some tutorials for Unity's 2D systems. I haven't has a proper look at it yet, but some of you might find it useful!
Are Unity's inbuilt physics (or at least RigidBody2D) a bit lacking, or is it just me? Terminal velocity doesn't seem to be affected by weight, and seems like momentum for horizontal jumps is a bit off too (again, doesn't seem affected by weight).
The whole physics system is really dependant on the scale of your objects. I kind of wish they had a global var you could use to adjust the physics scale.
[QUOTE=acds;43296489]Are Unity's inbuilt physics (or at least RigidBody2D) a bit lacking, or is it just me? Terminal velocity doesn't seem to be affected by weight, and seems like momentum for horizontal jumps is a bit off too (again, doesn't seem affected by weight).[/QUOTE] The 2D stuff is Box2D so it has the similar limits etc as default Box2D. They have stated that in the future they will be exposing some of the Box2D limits as variables you can alter but at the moment they are set at compile time (compile time of the engine not your project) so they cannot be altered unless you have Unity source access.
[QUOTE=garry;43296527]The whole physics system is really dependant on the scale of your objects. I kind of wish they had a global var you could use to adjust the physics scale.[/QUOTE] How does that work for firing projectiles from a gun if you aren't using hitscans and are actually firing a tiny physics based object
[QUOTE=Johnny Guitar;43298787]How does that work for firing projectiles from a gun if you aren't using hitscans and are actually firing a tiny physics based object[/QUOTE] How does what work?
[QUOTE=garry;43312144]How does what work?[/QUOTE] If physics is dependent on the scale of your objects; how does it effect really small objects ie, a bullet that is traveling at a really high velocity.
[QUOTE=Johnny Guitar;43312413]If physics is dependent on the scale of your objects; how does it effect really small objects ie, a bullet that is traveling at a really high velocity.[/QUOTE] It doesn't, really
[QUOTE=garry;43312852]It doesn't, really[/QUOTE] I think I misinterpreted what you said because I think I meant size of an object rather than the physics itself. sorry, being up for 36 hours messes with your head
I'm currently working on a robotics game similar to Robot Arena 2, with a 1meter to 1unity unit scale. I have run into a problem: I cannot use WheelColliders for wheels since they require much more dynamic physics (collisions, upside-down driving, detaching, non-wheel rotating objects etc.). I tried using Configurable Joint but the wheels just end up too loose, not even able to keep the chassis from the ground. I have been messing with the settings a lot. Anyone know how to create motorized wheels without WheelCollider? [IMG]https://dl.dropboxusercontent.com/u/10497181/screenies/47774bda697bb187bd0311d4ee61c3a5.png[/IMG]
loots really fucking cool man.
Been testing out some of the various tween libraries available in the asset store. [URL="https://www.assetstore.unity3d.com/#/content/3595"]This one[/URL] is by far the fastest (has the lowest overhead) though it lacks some of the more complex features of some of the others. I was a bit dubious given that all the tween things seem to say they are the most optimized etc but this one actually is.
Wow, rotating GUI. I was looking to do that for my game's HUD not to long ago.
So Garry, is there a reason for Rust that you chose uLink over Smart Fox Server, Photon Server or using Unity's built in networking library? I typically do not use much networking in games but clearly at the stage games are at it is almost a necessity.
How do I approach data sending over network in multiplayer games, assuming I'm going for non-authoritative solution? How many NetworkView should I use per player, what should be observed? If I only need one NetworkView, what should I do? Do I need to write a NetworkedPlayerManager script that manages all observed variables? What about AI enemies? Another question: For a top-down shooter, the data that is required to be sent over network to update player's location are position and facing direction, which is Vector3 and Quaternion. Vector3 is 3 float, while Quaternion is 4, a total of 7 (28 bytes per tick, 420 bytes per second by default tickrate per player). Since its a top-down shooter, only Y-rotation matters. Instead of sending a Quaternion (XYZW), is it better to send a float and then let clients calculate rotation themselves? With this, only 4 float are sent, 16 bytes per tick, and 240 bytes per second per player. Like: [code] float receivedYRot = 0; stream.Serialize(ref receivedYRot ); transform.rotation = Quaternion.Euler(0, receivedYRot, 0); [/code] I'm not even sure whether these questions are legitimate concerns. I'm clueless when it comes to networking. This is new for me.
[QUOTE='[SI] Nynex;43335658']So Garry, is there a reason for Rust that you chose uLink over Smart Fox Server, Photon Server or using Unity's built in networking library? I typically do not use much networking in games but clearly at the stage games are at it is almost a necessity.[/QUOTE] Unity's built in networking isn't that great honestly.
[QUOTE='[SI] Nynex;43335658']So Garry, is there a reason for Rust that you chose uLink over Smart Fox Server, Photon Server or using Unity's built in networking library? I typically do not use much networking in games but clearly at the stage games are at it is almost a necessity.[/QUOTE] The original plan was to use all their MMO, multi-server stuff. But we dropped that idea at some point to focus on actually releasing something. The option is there for the future.
Do you use their Unreliable RPC often? It was the thing that differentiates uLink and other solutions.
So does Unity have serious problems handling sprite flip or is it just me? Seems that flipping a player which is made up of several different parts which have own colliders is either done with some rough method (invisible children that have the collider on them) that doesn't work with a lot of other stuff (like ragdolling or polygon colliders), or just not done at all.
[QUOTE=secundus;43336187]How do I approach data sending over network in multiplayer games, assuming I'm going for non-authoritative solution? How many NetworkView should I use per player, what should be observed? If I only need one NetworkView, what should I do? Do I need to write a NetworkedPlayerManager script that manages all observed variables? What about AI enemies? Another question: For a top-down shooter, the data that is required to be sent over network to update player's location are position and facing direction, which is Vector3 and Quaternion. Vector3 is 3 float, while Quaternion is 4, a total of 7 (28 bytes per tick, 420 bytes per second by default tickrate per player). Since its a top-down shooter, only Y-rotation matters. Instead of sending a Quaternion (XYZW), is it better to send a float and then let clients calculate rotation themselves? With this, only 4 float are sent, 16 bytes per tick, and 240 bytes per second per player. Like: [code] float receivedYRot = 0; stream.Serialize(ref receivedYRot ); transform.rotation = Quaternion.Euler(0, receivedYRot, 0); [/code] I'm not even sure whether these questions are legitimate concerns. I'm clueless when it comes to networking. This is new for me.[/QUOTE] What does stream.Serialize do and how do you use it?
stream is BitStream used in [url=http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnSerializeNetworkView.html]OnSerializeNetworkView(BitStream,NetworkMessageInfo)[/url] which will only be called if the script is set as observed in NetworkView and the State Synch is RDC/Unreliable. stream.Serialize serializes a type of variable, you can see the supported ones [url=http://docs.unity3d.com/Documentation/ScriptReference/BitStream.Serialize.html]here[/url]. Bitstream has 2 states (isWriting or isReading). Example on how it would be use to update player's position and orientation over network (Without any prediction): [code] void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) { // If we are sending out data, do this if (stream.isWriting) { // Get the position and orientation of our gameObject Vector3 pos = transform.position; Quaternion rot = transform.rotation; // Send the data (pass by reference) stream.Serialize(ref pos); stream.Serialize(ref rot); } else //If we are receiving data, do this instead { // Create temp var Vector3 receivedPosition = transform.position; Quaternion receivedRotation = transform.rotation; // Read the stream, how many times you read should be EQUAL to how many times you write stream.Serialize(ref receivedPosition); stream.Serialize(ref receivedRotation); // apply transform.position = receivedPosition; transform.rotation = receivedRotation; } } [/code] Note that when you deserialize received data, you are deserializing in the same order as you send, so if you have 2 int values (testNum1 and testNum2) and you send testNum2 first and testNum1 second, when you read you'll be reading testNum2 first. Take it with a grain of salt, I'm still learning. If someone notices that something is wrong please correct me.
Has anyone been able to compare SoundManagerPro with Master Audio? Which seemed best? :)
[QUOTE=acds;43345262]So does Unity have serious problems handling sprite flip or is it just me? Seems that flipping a player which is made up of several different parts which have own colliders is either done with some rough method (invisible children that have the collider on them) that doesn't work with a lot of other stuff (like ragdolling or polygon colliders), or just not done at all.[/QUOTE] You can just transform all the parts at the same time if you want to flip them. The official Unity2D demo scene does this when the character changes the direction they are moving.
[I]Couldn't send RPC function '__RPCNetworkInstantiate'[/I] is a frustratingly unhelpful error. Are there any ways to find out why it couldn't be sent?
What is the RPC method used? If you used buffered calls and you remove the one who called the RPC I think it'll give that error. Maybe you need to remove those buffered calls before removing?
So I'm trying to implement the Object Pool design pattern in Unity. Right now I have this class called ObjectPool [CODE]using UnityEngine; using System.Collections; public class ObjectPool : MonoBehaviour { GameObject[] projectiles = null; public int numberOfProjectilesToCreate = 0; // Use this for initialization void Start () { projectiles = new GameObject[numberOfProjectilesToCreate]; InstantiateProjectiles(); } // Update is called once per frame void Update () { if(Input.GetMouseButton(0)) { ActivateProjectile(); } } private void InstantiateProjectiles() { for (int i = 0; i < numberOfProjectilesToCreate; i++) { projectiles[i] = Instantiate(Resources.Load("Prefabs/prefab_projectile")) as GameObject; projectiles[i].SetActive(false); } } private void ActivateProjectile() { for (int i = 0; i < numberOfProjectilesToCreate; i++) { if(projectiles[i].activeSelf == false) { projectiles[i].SetActive(true); projectiles[i].GetComponent<Projectile>().Activated(); } } } } [/CODE] And I created a sphere object that when left click is pressed, fires. However, the sphere keeps on shooting from some random point in the map. I was hoping to have it fire from in front of the camera. How can I make the spheres position stay updated with the camera? Thanks
[QUOTE=secundus;43366269]What is the RPC method used? If you used buffered calls and you remove the one who called the RPC I think it'll give that error. Maybe you need to remove those buffered calls before removing?[/QUOTE] Network.Instantiate [code]public void SpawnPlayer( NetworkPlayer player, Transform prefab ) { // Get player network number string tempPlayerString = player.ToString(); int playerNumber = Convert.ToInt32( tempPlayerString ); if ( Network.peerType == NetworkPeerType.Client ) { Transform spawnLocation = spawnPoints[playerListNumber]; Network.Instantiate( prefab, spawnLocation.position, spawnLocation.rotation, playerNumber ); } else if (Network.peerType == NetworkPeerType.Server) { Network.Instantiate( prefab, Vector3.zero, Quaternion.identity, playerNumber ); } }[/code] I'm just trying to spawn players.
Sorry, you need to Log In to post a reply to this thread.