The island demo doesn't work in unity 3.0

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

zante
Posts: 7
Joined: 13 Nov 2009, 19:02

The island demo doesn't work in unity 3.0

Postby zante » 09 Feb 2011, 08:16

Just confirming that the island demo doesn't work with the Smartfox Pro 1.x server. You guys need to make this clear, the posted dll in the thread dealing with the beta of Unity 3.0 doesn't seem to work either.

Whilst publishing the project as an executable solves the issue, browser-based content (the reason people choose Unity) doesn't.
Last edited by zante on 09 Feb 2011, 08:28, edited 1 time in total.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 09 Feb 2011, 08:26

The island demo is not ported to 3.0 - totally correct. Not even Unity have done that from what I know. The FPS example for SFS2X succeeds the island demo.

I've not even tried porting it - but several people here have posted that its minor changes that are needed.

/Thomas
zante
Posts: 7
Joined: 13 Nov 2009, 19:02

Postby zante » 09 Feb 2011, 08:36

But there's no documentation regarding this problem, no one knows how to figure it out. Unless it's stipulated there will be a loss of business.

Your modified dll is available from here:

This is designed to work with the 1.x server software
http://www.fullcontrol.dk/downloads/sfs/SmartFoxClient-1.2.7-rc1.dll


Does it work (doesn't seem to for me)?
Is it simply a matter of overwriting/renaming it to the original?

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

Postby ThomasLund » 09 Feb 2011, 20:05

The dll works - but the island code (the Unity part) needs some fixing to be able to run in Unity 3. It has nothing to do with SFS per se (from what I can understand).

Island demo was Unitys flagship demo for version 2.x - for verison 3 they have bootcamp one instead.

But then again - if you are just starting up now, why dont you use SFS2X and the FPS demo?

/Thomas
lastowl
Posts: 36
Joined: 12 Aug 2010, 20:56

Postby lastowl » 10 Feb 2011, 22:33

In case your just interested, enough people asked for an updated anyway

Island Demo using SFS 1:
http://unity.lastowl.info/IslandDemo3.0.zip
Change List:
Not much changed two lines of code are nulled not removed
Policy Fetch Added for web player builds
smart fox dll replaced as well

Coming Soon Island Demo using SFS 2
Will be rewrote for SFS 2 when i get the time off from work :)
Unless someone else does instead
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 11 Feb 2011, 07:07

Cool - thanks for sharing
aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

Postby aiaustin » 19 May 2011, 19:13

[quote="lastowl"]In case your just interested, enough people asked for an updated anyway

Island Demo using SFS 1:
http://unity.lastowl.info/IslandDemo3.0.zip
Policy Fetch Added for web player builds
smart fox dll replaced as well[/quote]

lastowl, your copy of the SmartFoxClient.dll and the policy prefetch line of

Security.PrefetchSocketPolicy(serverIP, Convert.ToInt32(serverPort));


added at the end of Awake() in LoginGUI.cs worked great to get the MMO demo going.

Can you let us know where this version of the .dll is actually from?

I ask as I have failed on my attempts to use versions that look identical from the recent Unity3D .net API and various other examples which all seem to fail at the waiting to connect point with web builds - though editor runs and standalone builds work fine.

And I have even tried using a version from SFS's own island demo which works even though it does not have the policy prefetch line in its LoginGUI.cs... odd.
aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

SFS Island Demo to SFS2X

Postby aiaustin » 25 May 2011, 07:49

I use the Island demo as the basis for one of my own experiments and as lastowl said there are very few changes needed to make it work in Unity3D 3.x and SFS1.x (so long as you include the prefetch line and use the updated SmartFoxClient.dll) as I summarized above.

has anyone looked at the changes needed to make this work with SFS2X yet? The LoginGUI.cs can use the SFS2X Unity API examples up to the port of launching the "island" scene. But then the various localplayer, remoteplayer and chatcontroller .cs scripts need to be altered to update to SFS2X.

a) Anyone done this?

b) Or anyone have an idiot's guide to the changes needed generically when converting from SFS1.x to SFS2X?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 25 May 2011, 10:27

Most of the changes are primarily a matter of using the sfs.send() method to send requests.

Also thread safe mode is default now, so its required to poke the API in e.g. FixedUpdate()

I ported several projects of my own (client side code) in less than a few hours per project.

Server side there are a lot of changes - so that will depend heavily on your extensions how much time its going to take

/T
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

Postby aiaustin » 25 May 2011, 19:53

Thanks T. Will take a look. Everything is client side for the MMO elements in the SFS Island example and a Simple MMO tutorial I used to establish a working setup in SmartFox Server 1.6.6.

In fact all that would be needed would be to get the LoginGUI, network (localplayer, remoteplayer and sync) and chat scripts going in the simple MMO exmaple tutorial for SFS 1.x at

http://virtualautonomy.com/blog/index.p ... e-to-creat

Anyone out there already done that, as it would be helpful.
lastowl
Posts: 36
Joined: 12 Aug 2010, 20:56

Postby lastowl » 26 May 2011, 08:42

Hi the ddl i used was from the forum and was version 1.2.7, i still haven't got round to a port two smartfox 2x I haven't even looked at a 2x in any detail if someone want to boost the sped of a port which I'll also host for people all I would need to do it quickly is a simple cube demo ad I could do it in about 15mins from there ;)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 26 May 2011, 12:51

Basically all old sfs1 examples are ported to sfs2x - part of the sfs2x download. So you should super fast be able to see the differences and go from there.

/T
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
aiaustin
Posts: 23
Joined: 19 May 2011, 13:33

Start on SFS2X Simple Multi User Bare Bones Example

Postby aiaustin » 26 May 2011, 17:12

Here is some partially converted "Simple MMO" code for Unity3D with SFS2X, with entirely client side scripts. Its basically the "cube" example that lastowl proposed.

It is based on The Bare Bones Simple MMO tutorial at:

http://virtualautonomy.com/blog/index.p ... e-to-creat

and using as a base the free zip from there:

http://virtualautonomy.com/blog/media/b ... _Bones.zip

Its then been converted by me to run under SFS1.6 fine... needing the usual policy prefetch line before a server connection in LoginGUI.cs. Once logged in it loads a level (Room_1) which in this demo is a very simple plane and cube. This was working with all the MMO code for multiple players and chat in SFS1.6.

I have then started a conversion of it to SFS2.X with my limited coding skills. But I think I have changed the packages correctly to the SFS2X ones needed by going gradually through the name space errors and replacing as necessary each time... and am probably down to converting the various send messages items to sfs.send() elements as suggested by Thomas Lund. I had it down to just two errors for sendpublicmessage and a myusername. But more will appear when those are fixed.

To make this particular version load and run I deleted all the game/network/* and game/chat/* scripts and got it to login to SFS2X and load the Room_1 level. So at least that's start. It runs by default on an SFS2X on 127.0.0.1:9933 (but that can be set via editor public parameters and I already tested it works across to a remote SFS2X server fine).

The partially converted scripts that were removed from Assets/game/scripts are in a separate directory in the project folder. Once working if they are put back in place and set up as in the original tutorial, we should have a working simple client side MMO demo again.

The partially converted Unity3D project file (with the failing scripts removed from the Assets folder!) is at (May 2011 and to be removed when a working version is made available to avoid confusion):

http://www.aiai.ed.ac.uk/~ai/unity/test ... pleMMO.zip

It also contains at its top level the original tutorial bare bones Unity3D project .zip file for convenience, and in case my own conversion attempts were just too silly.

Have you time to look at this lastowl? Or anyone else got the skill and time to do this?
lastowl
Posts: 36
Joined: 12 Aug 2010, 20:56

Postby lastowl » 31 May 2011, 19:23

ill have a look at it, but i get distracted :)

i have looked at the connection differences since the beta and built my own variation of the connection and the chat but haven't has looked at much else yet since the beta but looked forward to getting some time soon

EDIT: ive just had a look and what i think i might do is post a island demo i did with working login and chat, also on posting to the second scene the character is spawned but the player movements aren't so it stays at the spawn point, hope you understand
jimbobway
Posts: 20
Joined: 26 Oct 2010, 15:57

Postby jimbobway » 31 May 2011, 22:35

lastowl wrote:In case your just interested, enough people asked for an updated anyway

Island Demo using SFS 1:
http://unity.lastowl.info/IslandDemo3.0.zip
Change List:
Not much changed two lines of code are nulled not removed
Policy Fetch Added for web player builds
smart fox dll replaced as well

Coming Soon Island Demo using SFS 2
Will be rewrote for SFS 2 when i get the time off from work :)
Unless someone else does instead


I downloaded this zip file and ran it in Unity 3. The chat bubble opens and I can chat and it shows in single player. But, when I open a new game window and login with another username the chat messages don't appear to the other user. Also, I can't see the other user. Any ideas how I can get it to work in SmartFox 1.6?

EDIT: See next post...I got it to work.
Last edited by jimbobway on 31 May 2011, 23:09, edited 1 time in total.

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 20 guests