Page 1 of 9

[[ NEW ]] FPS Demo!

Posted: 18 Nov 2010, 13:29
by Lapo
Hello,
we are glad to release a new first person shooter demo made in Unity with sources and white paper. The demo is still in beta but perfectly playable, Thomas Lund is finishing the accompanying white paper, which will take some more time, but we were eager to release the game :D

The FPS demonstrates the new protocol at work, various multiplayer prediction techniques and of course the use of UDP for fast updates.

Download the Unity SFS2X FPS Demo (111 MB)


Image

Required: Unity 2.6+
Known bugs:
-> cannot login after a logout, just restart the game
-> possible browser issue when closing the tab, only using Unity 2.6
-> white paper partially complete

Posted: 18 Nov 2010, 15:43
by tmada
Blimey, you guys are actually making a real effort!

Big props! :)

Posted: 18 Nov 2010, 15:50
by Lapo
Bloody yes! :D

Posted: 18 Nov 2010, 16:44
by tmada
Very cool :) Looks like the docs are nicely positioned to be readable by normal folk too, I think there'll be a swarm of gratitude for this.

Looking forward to the finished article! (crashes with a TCPSocketLayer read error when stopping the playback atm)

I'm all worked up now! Nice one & thanks!

Posted: 18 Nov 2010, 17:00
by Lapo
Which version gives you that problem?
Try exporting to a standalone application. We used Unity 3 and played several matches over the internet with no problems. There is a known problem with 2.6 crashing when leaving the browser. Again Unity 3 should work just fine.

Posted: 18 Nov 2010, 17:16
by tmada
Unity 3 under Windows 7

Standalone runs and lets me launch multiple clients on the server ok (I'll never walk the same again!), but they too freeze when trying to close them.

No idea if this is related to problem discussed in Thomas Lund's fix for Windows clients, as you handle disconnects differently in NetworkManager (nope, see edit below); I'll try it on a Mac tonight.

Here's the console output when stopping the game in the editor...

Code: Select all

[SFS DEBUG] TCPSocketLayer: General error reading data from socket: Read failure   at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0


Note: This is with the RC1a update

Edit: Ah actually my bad, as the disconnect is of course in SmartFoxConnection not NetworkManager (doh!)

Posted: 18 Nov 2010, 17:40
by ThomasLund
happy you like it!

Yeah - there are the 3 known issues
- documentation not done
- logout functionality doesnt allow you to login again
- crash problem on shutdown

We decided to release it as is for now and let you play with it. Its been in the cooker for way too long - and being swamped with other work simply didnt give me time to fix those last things.

"On the other side" of my work load I will finish up the bugs. But feel free to write here with any fixes you find + new bugs you discover. I'll collect it all up for next release.

Also - if you have any questions on how this works - post away! Its meant as a tutorial and example. So asking questions and/or sharing your knowledge will make it easier for everyone else to learn too.

/Thomas

Posted: 18 Nov 2010, 17:50
by tmada
Thanks Thomas, you're a true star - and my wife tells me chivalry is dead (she just needs a hobby...)!

The project structure alone is very informative; I'm sure there'll be plenty questions and suggestions coming to keep you from your day job ;)

Posted: 18 Nov 2010, 18:24
by rjgtav
WoW great tutorial. Unfortunately i dont use unity, but as im developing a 3rd person shooter based in a 1st person shooter in flash, i'll learn some of the techniques such as the interpolation and extrapolation :wink:

Posted: 18 Nov 2010, 20:05
by Whiskey
Awesome, thank you very much! I will go through this one in detail. Just fired it up, but I seem to be having an UDP problem (this is with Unity 3.1.0f3 on Windows 7 with SFS on localhost):

Code: Select all

Logged in successfully
[SFS - ERROR] UDPSocketLayer: Error reading data from socket: An existing connection was forcibly closed by the remote host.
[SFS DEBUG] UDPSocketLayer: Error reading data from socket: An existing connection was forcibly closed by the remote host.
[SFS - WARN] Unexpected UDP I/O Error. Error reading data from socket: An existing connection was forcibly closed by the remote host.
 [ConnectionReset]
[SFS DEBUG] Unexpected UDP I/O Error. Error reading data from socket: An existing connection was forcibly closed by the remote host.
 [ConnectionReset]
[SFS - WARN] UDPSocketLayer: Exception aborting socket thread: Thread was being aborted
[SFS DEBUG] UDPSocketLayer: Exception aborting socket thread: Thread was being aborted


Posted: 18 Nov 2010, 20:09
by ThomasLund
Ohhh - "exciting" error. Never seen before.

Are you running Windows by any chance with the windows firewall? Its known to happily block UDP also on local connections.

/Thomas

Posted: 18 Nov 2010, 20:20
by Whiskey
I was running with Windows Firewall, but just disabled that and the AntiVirus (Avira) as well for good measure. Didn't help though, still getting the same errors.

Never mind! Just proved I'm not very good at reading manuals. I had not enabled UDP (this is no excuse, but while glancing over the manual I saw "If you install the example in a default configuration, then no additional changes are needed.").

After adding UDP (same port as TCP) and restarting the server it worked!

Thanks and sorry for the confusion.

Posted: 18 Nov 2010, 20:49
by appels
isn't that just a dirty way of the server saying that it's refusing the udp connection ?

Posted: 18 Nov 2010, 20:55
by ThomasLund
Wonder if anyone else is seeing this - all the guys that have tested this before release have used Macs. So would love to hear if anyone else is seeing this.

One obvious question would be, if you enabled UDP on the server for the same IP that you use for the server connection.

/Thomas

Posted: 19 Nov 2010, 00:24
by appels
on vista i'm getting :


[SFS DEBUG] UDPSocketLayer: Error reading data from socket: An existing connection was forcibly closed by the remote host.
[SFS DEBUG] Unexpected UDP I/O Error. Error reading data from socket: An existing connection was forcibly closed by the remote host.
[ConnectionReset]
[SFS DEBUG] UDPSocketLayer: Exception aborting socket thread: Thread was being aborted
UDP error:
UnityEngine.Debug:Log(Object)
LobbyGUI:OnUdpInit(BaseEvent) (at Assets/Lobby/Scripts/LobbyGUI.cs:141)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
LobbyGUI:FixedUpdate() (at Assets/Lobby/Scripts/LobbyGUI.cs:83)