[[ NEW ]] FPS Demo!

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

[[ NEW ]] FPS Demo!

Postby Lapo » 18 Nov 2010, 13:29

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
Lapo
--
gotoAndPlay()
...addicted to flash games
tmada
Posts: 9
Joined: 30 Oct 2010, 06:01

Postby tmada » 18 Nov 2010, 15:43

Blimey, you guys are actually making a real effort!

Big props! :)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Nov 2010, 15:50

Bloody yes! :D
Lapo

--

gotoAndPlay()

...addicted to flash games
tmada
Posts: 9
Joined: 30 Oct 2010, 06:01

Postby tmada » 18 Nov 2010, 16:44

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!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Nov 2010, 17:00

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.
Lapo

--

gotoAndPlay()

...addicted to flash games
tmada
Posts: 9
Joined: 30 Oct 2010, 06:01

Postby tmada » 18 Nov 2010, 17:16

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!)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 18 Nov 2010, 17:40

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
tmada
Posts: 9
Joined: 30 Oct 2010, 06:01

Postby tmada » 18 Nov 2010, 17:50

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 ;)
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 18 Nov 2010, 18:24

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:
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
Whiskey
Posts: 45
Joined: 28 Oct 2010, 06:27
Location: The Netherlands
Contact:

Postby Whiskey » 18 Nov 2010, 20:05

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

ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 18 Nov 2010, 20:09

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
User avatar
Whiskey
Posts: 45
Joined: 28 Oct 2010, 06:27
Location: The Netherlands
Contact:

Postby Whiskey » 18 Nov 2010, 20:20

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.
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 18 Nov 2010, 20:49

isn't that just a dirty way of the server saying that it's refusing the udp connection ?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 18 Nov 2010, 20:55

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
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 19 Nov 2010, 00:24

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)

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 27 guests