Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Filip

Pages: [1]
1
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 28, 2013, 06:13:14 PM »
Good point Aren, It is probably best to inactivate root motion like you say, and apply the speed to the rigidbody parent directly.

I am finding TNet more and more appealing to my project. It's really agile and easy to work with. Keep it up and thanks for the support!

2
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 28, 2013, 07:34:19 AM »
Sorry for late reply, I have been away for a christmas trip.

TNManager is located in my startup scene, yes. It is attached to the same gameobject as where TNAutoJoin is attached. TNAutoJoin joins another scene where the actual game content is. (Just like your multiplayer tutorial with dedicated server).

Quote
I don't recommend synchronizing position and rotation using TNAutoSync when using mecanim motions. Sync whatever causes the motions states to change, or the changed states themselves. This way each client will have an up-to-date set of states and do their own movement logic.
I am not talking about incompatibility with TNAutoSync and Mecanim. I understand that TNAutoSync is generally not good for syncing your "main character". I am talking about that I believe it's impossible to structure my game objects like you mentioned:
Quote
Rigidbody, TNObject
- Collider 1
- Collider 2
- GameObject with LagPosition (and possibly LagRotation) on it
-- Renderer

Apply root motion will cause the "GameObject" to move relatively to the "Rigidbody", in such way the Rigidbody itself will not be affected by the Mecanim's movement. The colliders will stay in the same fixed global position while the GameObject with the attached animator will move around. The problem I'm facing is that I don't know how to tell Mecanim to apply root motion onto the Rigidbody instead of the GameObject.

3
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 11, 2013, 09:10:08 AM »
Thanks for clearing out the "Custom Object Creation handlers". I am not using it, I'm using the TNAutoCreate script which I believe use the standard TNCreate script? I still get the "Trying to execute a function 1 on TNObject #16777214 before it has been created." everytime I start.

"Apply root motion" is Mecanim's built-in functionality to apply the animation motion to the gameObject that owns the Animator. So that the animator is automatically adjusting transform.position for the GameObject according to animations internal movement.
http://docs.unity3d.com/Documentation/Components/class-Animator.html
The problem is that I don't think it's possible to tell the animator to "Apply root motion" to a parent object. So if I setup the structure as you suggest, it will move the game object around inside the parent container (Rigidbody, TNObject).

On the other hand it's possible to permanently disable "Apply root motion", and handle the motion manually. But then the movement will not look as realistic, for example the feet might slide on the ground a bit, since it hard to sync the exact movement speed with the feet placement on the ground. Lots of animations have root motion that makes alters the transform.position of the gameobject, and it's a nice feature to have.

4
TNet 3 Support / Re: Strange behaviour in bundled AutoSync-example
« on: December 11, 2013, 08:28:59 AM »
Thanks a lot.

5
TNet 3 Support / Strange behaviour in bundled AutoSync-example
« on: December 10, 2013, 05:24:19 PM »
I noticed I had to restart the dedicated server in order to get persistent gameobjects to sync. I thought it was something wrong with my code but I now tested the bundled AutoSync-example and it shares the same problem.

This is what you should do to replicate the problem:

1. Create new project with TNET imported.
2. Add "Example AutoJoin" and "Example AutoSync" in Build Settings. Make sure "Example AutoJoin" is top.
3. Check "Run in background" in "Player settings"
4. Run TNServer.exe
5. Build and run the project.
6. Open AutoJoin-scene and play in unity.
7. Everything is working as it should.
8. Stop unity and close the other game window.
9. Build and run.
10. Play in unity.
11. Not syncing anylonger.

6
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 10, 2013, 09:29:29 AM »
I now see a light in the tunnel, thank you.

Quote
Small note before I forget again... all custom creation handlers must be on a persistent (not dynamically instantiated) TNObject. If they aren't, you will be seeing errors like "trying to execute".
I don't understand this. "Custom creation handlers" - are you referring to the AutoCreate-script? I have dragged this script onto a persistent cube in my scene. You must be referring to something else?

I agree with Rogdor. Very informative, thanks for that. Just one thing... I don't know how to tell Mecanim to apply root motion onto the "rigidbody object" instead of the character object. Any clues?

7
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 08, 2013, 01:48:20 PM »
OK, thank you. I have tried the SyncRigidBody-script. Tried to use it with the default value of 10 syncs / sec, (which I assume you consider far too high, so why is it default?). Anyway it looks not good at all. Tried to decrease it to 5 syncs / sec, and it looks horrible. The player bounces forth and back lagging A LOT. Really feels like I'm out of options here... I really thought TNet would have some ready scripts for syncing simple character movements in an ease - seems like I took a bite off more than I can chew... I don't want to invent the wheel again and write some interpolation mambo jambo that some people are talking about in this forum.

Also, I'm not doing a helicopter game so I don't want to buy your ready-made game for 65 bucks.

Thanks


8
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 07, 2013, 09:34:55 AM »
I'm still having the same problem, but I'm not sure that it's worse than just an annoying error message, because the game is working as it should?

I have reworked the code quite a lot, but I'm still syncing the position 30 times / second via SendQuickly. (Is there another way to sync the position?) I find it odd that noone else is having this bug... Am I the only one syncing the position with SendQuickly in FixedUpdate 30 times / second?

9
TNet 3 Support / Re: Dedicated server instance is crashing
« on: December 07, 2013, 09:20:52 AM »
I am running Windows 7. After setting the "update per second"-limit in my position sync, I have not encountered the problem again. I was probably DoS-attacking myself. Still I think it should be able to handle 100 packets/ second (If 10 people are simultanously connected sending 10 packets / second). And the problem came in when I terminated the client, so perhaps (just brainstorming) the server crashed because it was disrupted in too many TCP package handshakes.

Using it as a gameserver

10
TNet 3 Support / Dedicated server instance is crashing
« on: December 06, 2013, 08:37:21 AM »
I have been playing around with the dedicated server exe file (TNServer.exe), and I noticed that it sometimes crashes if you abruptly terminates a client. Does this mean that it is pretty easy to crash the server from client-side, or can I adjust the server to "catch all" and ignore any client miss-usages, so that it crash less or preferably not at all?

11
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 06, 2013, 07:15:27 AM »
I now noticed that the errors occurs when receiving the RFC, not sending. I.e. there is no error on the client that send the rpc. It occurs on the part that has just joined the server and is creating a new tno and at the same time receiving RFC. Perhaps we can block incoming RFC until tno is created somehow?

12
TNet 3 Support / Re: TNet: Problem with SendQuickly
« on: December 06, 2013, 05:27:51 AM »
Thanks for the fast reply. I'm using TNAutoCreate to create it.

What is the proper way to see if the object has been created? I tried to do
  1. if (tno.isMine()) {
  2.   tno.SendQuickly(1, TNet.Target.AllSaved, transform.position);
  3.   tno.SendQuickly(2, TNet.Target.AllSaved, speed);
  4. }
but I still get the same errors.



13
TNet 3 Support / TNet: Problem with SendQuickly
« on: December 06, 2013, 04:16:29 AM »
I get following console errors when I use SendQuickly instead of Send:

Trying to execute a function 1 on TNObject #16777214 before it has been created.

Trying to execute a function 2 on TNObject #16777214 before it has been created.

failed to convert parameters
LocomotionPlayer.SetRotation (System.Single)

In the Update function I have:
  1. tno.SendQuickly(1, TNet.Target.AllSaved, transform.position);
  2. tno.SendQuickly(2, TNet.Target.AllSaved, speed);

And in the bottom of the same class I have:
  1.         [RFC(1)]
  2.         void SetPosition(Vector3 val) {
  3.                 mPosition = val;
  4.         }
  5.        
  6.         [RFC(2)]
  7.         void SetSpeed(float val) {
  8.                 mSpeed = val;
  9.         }

Everything is running as it should, but I get those errors in the console, which is bothering me. If I change SendQuickly to Send I do not get any errors.

Can anybody please tell me what I'm doing wrong?

Thanks,
Filip

Pages: [1]