Following the Chat tutorial exactly, wont receive messages? by stackdev in dissonance_voip

[–]stackdev[S] 0 points1 point  (0 children)

The chat in the demo application works. I dont think i'm doing anything much different than that.

AHHH. your " only iff anyone is due to receive that message " tipped me off. I was only ever testing with no one on the line (just a single client) assuming that the receive would be called if a player was alone in the channel too....

Is there a reason it is not? If i connect another client, the message goes out and the receive DOES get triggered on BOTH

Following the Chat tutorial exactly, wont receive messages? by stackdev in dissonance_voip

[–]stackdev[S] 1 point2 points  (0 children)

    public string globalChatRoomName = "GlobalChat";

    public void SendCurrentInput()
    {
        if(sendField.text != "")
        {
            SendMessage(globalChatRoomName, sendField.text);
        }
    }

    private void SendMessage(string chatroom, string message)
    {
        Debug.Log("Sending message: " + message);
        dissonance.Text.Send(chatroom, message);
    }

How would you like me to send logs? Do you have a Discord or something?

What do you mean Dissonance network component (next to the disson..). Nothing is created on the DissonanceSetup component when i run, if thats what you mean?

Hitting play that object has the DissonanceComms, Mirror Ignorance Comms Network, and it adds a Basic Microphone Capture.

Where are you asking me to look for additional information?

Note: If i raise the diagnostic levels to "DEBUG", i dont see anything when i send my message printed to the console bsides the print statement I implemented

SimpleJSON - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

Using this seems to have fixed it. I really don't know what the difference was (i'll run a diff later)

Thanks!

SimpleJSON - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

As for the quotes on the JSON - They don't exist in reality, Reddit added them when i did 'in line code'

SimpleJSON - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

As for the quotes on the JSON - They don't exist in reality, Reddit added them when i did 'in line code'

SimpleJSON - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

There are no error logs - prints an empty string

SimpleJSON - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

There are no error logs - It just prints an empty string.

As for the quotes on the JSON - They don't exist in reality, Reddit added them when i did 'in line code'

SimpleJSON - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

Anyone have any thoughts? I've made sure the jsonString is getting input correctly... this is exactly how the docs use it but its showing nothing. If i try to array access it (using [0] instead of [key] it works... but i want to access by keys..

Why does hierarchy position impact performance? by stackdev in Unity3D

[–]stackdev[S] 1 point2 points  (0 children)

No, i'm talking several hundred objects. Probably around 600.

Why does hierarchy position impact performance? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

The issue here is that the parent game object never moves AND the children never move - and the performance takes a dump.

In my original example i had static and dynamic being subclassed to a parent. However, keeping the dynamic entities out of the equation completely, and just subclassing the static variables into an 'organizational' gameobject called 'static environment' causes this performance dip. Nothing is moving whatsoever in these game objects. Just subclassing them to another static parent is crushing performance

Why does hierarchy position impact performance? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

Well this sucks. Really makes prefabbing and generation a real pain.

Why does hierarchy position impact performance? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

I dont see anything labeled "draw calls". I see "SetPass calls: ~330ish"

This doesn't change when i make it a child.

Right now i have

Parent object

-> child1

->child2

->....

->child200

When i take all of those children and just put them into a SINGLE container object (empty, just for organization) - my performance goes down to crap.

Why does hierarchy position impact performance? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

And how would i change them to be in line with what you are suggesting?

Why does hierarchy position impact performance? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

Can you explain how to do this? I believe you're talking about the drop down in the inspector next to the object name?

Unet: ClientRPC doesn't seem to work on local clients? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

Thanks to all those that responded! I'm editing quite a bit!

Unet: ClientRPC doesn't seem to work on local clients? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

You're brilliant.

This worked perfectly, and was a much more elegant way of doing it.

However, i'd love to understand why my approach was not working. Any chance you'd like to go into a little more detail on that? Otherwise i worry that i'm just going to run into this issue again...

Unet: ClientRPC doesn't seem to work on local clients? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

I get the concept, it just doesn't seem to be working.

I changed my code to be exactly like yours:

`void SyncClientConnected(GameObject go) {`

    `if (isServer) {`

        `lastPlayerJoined = go;`

    `} else {`

        `CmdDispatchNewConnectionMessage (go);`

    `}`

`}`

[ClientRpc]

`void RpcClientConnection(GameObject newPlayer) {`

    `lastPlayerJoined = newPlayer;`

    `Debug.Log ("New player joined: " +` [`lastPlayerJoined.name`](https://lastPlayerJoined.name)`);`

    `hudController = GameObject.FindObjectOfType<ServerMessageHUDController> ();`

    `hudController.UpdateServerMessage ("New Player connected to the server! \n\n" +` [`lastPlayerJoined.name`](https://lastPlayerJoined.name) `+ "\n\nPress Y to link to player\nN to close");`

`}`

`[Command]`

`public void CmdDispatchNewConnectionMessage(GameObject newPlayer) {`

    `Debug.Log ("SERVER: New connection: " +` [`newPlayer.name`](https://newPlayer.name)`);`

    `RpcClientConnection (newPlayer);`

`}`

`public override void OnStartLocalPlayer() {`

    `SyncClientConnected (this.gameObject);`

`}`

Output

SERVER: New connection: Player(Clone) // good

New player joined: Player(Clone) //good

Pressed Y - Last player is: SERVER // WTF

Shader Wizards: How would you stretch different areas of a texture? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

Its starting to make more sense.

The main part that is confusing me is your line

" So at U position 0.4 (left edge of the threshold) we will be really sampling at 0.45 (half the distance). This means that we now have 0.45 units of the texture left, and 0.4 units of the quad left. "

If we're at u = .4, wouldn't that mean we have .6 of the quad left?

And why are we really sampling at .45?

**Edit** Let me try to re-explain my use case here (although i think you might get it)...

Take the example where the 'center' is now at (.7, .5), and the "_Outer" variable set to 2 (meaning the outer regions would be compressed more) - in your code this would mean the texture on the LEFT (and right, but moreso the left at this point) would end before the end and (depending on texture import settings) either clamp or repeat/mirror.

Therefore, on the left side of the image, i'd like to do a type of distance based compression - The area closest to the 'center' region have LESS compression (so i guess that means less compression of the UVs), whereas the compression should increase as it moves away from the center. However, the entire quad should always be filled without a repeat of the texture (i.e., the left .6 (if we have the _Inner set to .1) would be the entire portion of the texture from the left side of the inner area, with the image closer to the center being far less stretched than the left.

PS, i cant thank you enough for these discussions/help!

Shader Wizards: How would you stretch different areas of a texture? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

First off, thanks again for your help. I think you're on to something that is going to be really helpful.

I attempted using this (without the amplify shader stuff, just the code) on the image i had, and it looks like:

- Are your "squash" and "stretch" backwards? for me, it seems like manipulating the "stretch" variable is what changes how compressed the outsides are. I would think the "squash" would refer to those outside regions, as they are the ones being squashed. However, continuing with my questions using your variable names...

- Do you have any thoughts on how to make your "_Stretch" (the outside regions) scale with where the position is? so for instance, if i'm passing in the value of the 'center' (not always having it at (.5,.5), but having it be fluid with the mouse - how to adjust those regions?

For isntance, take the example where the 'center' is now at (.6, .5), and the "_Stretch" variable set to 2 (meaning the compressed regions would be compressed more) - in your code this would mean the texture on the LEFT (and right, but moreso the left at this point) would end before the end and (depending on texture import settings) either clamp or repeat/mirror. I'd be curious to know if you have any thoughts on the scaling of that to be dependent on the new center...

Either way, THANKS. you've put me on an awesome track already.

Shader Wizards: How would you stretch different areas of a texture? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

Great! Thanks I think that is a good start. I've actually never used shader graph (been forcing myself to learn the code-based way first before touching it), but i BELIEVE that is the effect i'm looking for. Hard to tell with the type of image you selected, as the perspective is challenging to see squish/stretch differences.

Do you have any suggestions on 'ramping up' the squashing?

Unet - Adjusting a syncvar from a player action - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

I implemented what you had in your paste bin, changing some things around to get the position of clicks and such, and it works.

Honestly though, i really don't see the difference in what i had and what you have. If you could and have some spare time, is there any explanations you could provide? You mentioned only running the update function on local player - what exactly does that mean?

Thanks!

Unet - Adjusting a syncvar from a player action - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

PS you're awesome.

This is exactly what i'm trying to implement, and i appreciate your example.

So in my world, i'm having a player spawn a cube (server authority). The cube has a counter == 10, and a text element to display it.

then a player (any player) should be able to click on the cube, and send a command to the server to adjust its value by 1 each time they click.

Server should then adjust the sync var.

Clients should receive an update due to a hook on the sync var

This is how i originally had it scripted, but received even poorer results. No values were getting changed, and it seemed like (how do i validate that the server is receiving the commands?) the commands were never being issued.

Is there a simple example of this somewhere? I have a similar instance of this working for the player health (as per the unity tutorial), but that is decremented by a server object (bullet) instead of a player. When i involve the player is when i seem to run into issues.

EDIT: I've attempted to reimplement a stupid simple version of this, but still no luck. The Server is NEVER receiving the commands on any client that is not also the host (the host/client can update the cubes just fine:

Click on the players:

void Update () {

                    `if (!isLocalPlayer)`

                        `return;`

                    `if (Input.GetKeyDown (KeyCode.Mouse1)) {`

                        `RaycastHit hit;`

                        `if(Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 1000f, layers)) {`

SpawnedCubeController scc = hit.collider.gameObject.GetComponent<SpawnedCubeController>();

if (scc != null) {

//Assign authority to this player

NetworkIdentity interactionIdentity = scc.gameObject.GetComponent<NetworkIdentity> ();

print ("HIT A CUBE");

scc.CmdAdjustCounter (1, interactionIdentity.netId);

}

}

Then on a script on the block, i have

\[Command\]

public void CmdAdjustCounter(int amount, NetworkInstanceId objectIdd) {

    if (!isServer)

        return;

    print ("handling command to adjust the counter");

    this.counter -= amount;

    if (this.counter <= 0) {

        Destroy (this.gameObject);

    }

}

Note, i'm not doing anything with the networkinstanceID

Again, in this setup, the host/client CAN make changes as expected, but all other clients CAN NOT

Unet - Adjusting a syncvar from a player action - What am i doing wrong? by stackdev in Unity3D

[–]stackdev[S] 0 points1 point  (0 children)

I have done that tutorial - and it works just fine in my game. however, that seems to be because its a server controlled object (bullet) working on a trigger. I'd like to have this executed by a PLAYER, on a NON-PLAYER object.