Author Topic: Updated: External vs Local Testing  (Read 10177 times)

Voodooshuffle

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 8
    • View Profile
Updated: External vs Local Testing
« on: November 14, 2014, 03:55:47 PM »
Hello everyone. I'm going to be upfront, I've never done any kind of multiplayer game before in my life. I purchased all of the Tasharen products to help me figure it out (Starlink, TNet, Multipurpose, NGUI, the spaceship one...) but I'm still kind of lost. I'm trying to make a fps based on UFPS addon -- but I could really use any kind of framework or even no framework at all. If anyone has any documents or video tutorial on how you would go about setting up an fps either with a certain framework or without one, with maybe 8-10 people would you mind sharing with me. I have about 7 weeks to figure this out and even some minor tips that would get me started would be super helpful. After 7 weeks I'm doomed! Thank you very very much in advance.
« Last Edit: November 30, 2014, 11:54:02 AM by Voodooshuffle »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNET and FPS platform
« Reply #1 on: November 15, 2014, 04:42:03 PM »
An FPS game is no different from any other. The only difference is you'll likely want to send the updates more frequently than in other games.

The best approach to take is usually to sync input-related values frequently, and position updates infrequently. In Windward user's input sets movement axes which get sync'd 4 times per second as well as if they change by more than 4%. The users all run their own simulations based on these input axes, and the position then gets corrected every 3 or 4 seconds, I don't remember the exact value.

For an FPS it's going to be a good idea to make use of UDP for frequently updated traffic (tno.SendQuickly).

creativitysquare

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 41
    • View Profile
Re: TNET and FPS platform
« Reply #2 on: November 17, 2014, 03:43:58 PM »
Vooodoo

why don't you follow this tutorial
https://www.youtube.com/watch?v=cTjy-L8C6WM

then you just set up a camera in the right place and you have an FPS...
7 weeks if you have full time if enough to make a decent game even with movements more complex than those used in the tutorial.

I got characters running around and animating in synch and i just started from that tutorial.

cheers

egi

Voodooshuffle

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: TNET and FPS platform
« Reply #3 on: November 18, 2014, 09:29:25 PM »
Thanks for the help! Using that tutorial I was able to get a basic fps in place but I'm trying to get something more advanced and I'm still working out the basics of networking. I'm trying to port ufps over as a basic framework which admittedly is beyond my skill level. I don't know if your familiar with it at all but it has a ton of event states etc... I'm trying to simplify it. I can sync the transforms but the rest of it is difficult because the remote player uses a different script for handling events then the first person. I think I would have to write a translator script to interpret first person events and transmit them to the appropriate "dummy characters" on the other end. Again this is way over my head but I'm going to give it a shot.

Voodooshuffle

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: TNET and FPS platform
« Reply #4 on: November 26, 2014, 10:43:47 AM »
I actually got quite far a long, got the basics for the game just need to work on the details and interface. I had a question I keep getting this error:

[TNet] Failed to call TNO #16777214 RFC animatescript.Idler: Object reference not set to an instance of an object   at animatescript.Idler () [0x00000] in C:\Users\Will\Documents\Project73\Assets\myScripts\animatescript.cs:662
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d0] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222

UnityEngine.Debug:LogError(Object, Object) TNet.UnityTools:PrintException(Exception, CachedFunc, Int32, String, Object[]) (at Assets/TNet/Client/TNUnityTools.cs:81) TNet.UnityTools:ExecuteAll(List`1, String, Object[]) (at Assets/TNet/Client/TNUnityTools.cs:182) TNObject:Execute(String, Object[]) (at Assets/TNet/Client/TNObject.cs:343) TNObject:FindAndExecute(UInt32, String, Object[]) (at Assets/TNet/Client/TNObject.cs:385) TNManager:OnForwardedPacket(BinaryReader) (at Assets/TNet/Client/TNManager.cs:1089) TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:810) TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:747) TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1113)


It happens on two functions. It doesn't always happen but by the end of a few minutes I have about 999+. It happens on two functions this is the first. I think but I am not 100% sure it started happening after the updated version -- but again I can't remember entirely. Any explanation as to what is going on? I am updating on user input or lack thereof so it maybe it is sending the packets too quick and not able to execute the rfc on each packet?

The function for reference is:

[RFC]
   public void Idler() {
      ani.animation.CrossFade ("idle");
   }


Thank you for the help! Wouldn't have made it this far without all the excellent tutorials and examples.

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: Updated: TNET RFC Error
« Reply #5 on: November 26, 2014, 12:32:07 PM »
I have had something similar to this when I instantiate my player.  Particular, when I modeled it after the Multipurpose add on demo.  Happens at the very beginning right?  And then stops after your player is instantiated?

Chances are you got a null somewhere when trying to call that RFC.  Try throwing in some debugs in Idler and where your calling Idler checking your components and variables.
« Last Edit: November 26, 2014, 12:45:05 PM by voncarp »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Updated: TNET RFC Error
« Reply #6 on: November 26, 2014, 09:22:33 PM »
@Voodoo: The error tells you what's wrong. Something in that function is null. You aren't checking to see if your 'ani' is null. My guess is that you set it in Start() or something similar, which happens after the RFC gets executed.

Voodooshuffle

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Updated: TNET RFC Error
« Reply #7 on: November 27, 2014, 12:54:38 AM »
Thank you for all the help, I will look into this!

Voodooshuffle

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Updated: TNET RFC Error
« Reply #8 on: November 30, 2014, 11:53:14 AM »
I'm pretty much done with the networking stuff, was very simple and easy to use when I got the hang of it. Got to say the new custom object creation came in very very handy, couldn't have done without it. Would like to see a mechanism to pass/refer to Gameobject if possible!

Had a quick question regarding networking testing. In the autojoin I am feeding the IP as my external IP to simulate external traffic and then using different computers to test. However I am noticing on TNServer executable that whenever someone connects it is displaying the local IP 192.168.1.x. Am I actually simulating what it would be like by connecting to an external IP through the external IP specification or is it somehow just using a local connection even though I'm feeding it the external IP? Thank you! I wanted to make sure it could handle internet traffic not just local traffic.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Updated: External vs Local Testing
« Reply #9 on: December 02, 2014, 12:36:18 PM »
When you mail your tax return to the office located in the same city you live in you also specify a full address with the city name, postal code and state/province. Doesn't mean it will go traveling all around the country to arrive at its destination, does it? :P

Network picks the closest route, which involves never leaving your LAN.

dustinwloring1988

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Updated: External vs Local Testing
« Reply #10 on: January 28, 2015, 02:44:11 PM »
Are you still working on this and r u using 1.4.9 as i would like to help because im doing the same