Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Very simple tutorial for unity + smartfox 2X

Discussion in 'Multiplayer' started by luxe001, Dec 6, 2010.

  1. luxe001

    luxe001

    Joined:
    Nov 10, 2010
    Posts:
    8
    Hi people, i'm trying to understand how smartfox work......but.......many many problems (photon is a bit more immediate) i think.

    I have already viewed the "Tris" tutorial included in the pack....but does not give an idea on how to smartfox.
    I'm (and all developer i think) looking for is a VERY simple tutorial "hello world" to understand how Smartfox <<--->> Unity works. For example, a plane with a cube above, how do I receive and transmit the location via the network? Normally I would use with unity "Network View" and "Observed" indicating the prefab cube "...... what to do with smartfox 2X? (No chat lobby ... no ... no autentication for now)

    Maybe some Samrtfox developer can help us

    Thank you...
     
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    you can't compare Unity's networking with the way you use SmartFox.
    If you take the Island demo and SFS v1, you can rip it appart easily and learn how it's achieved.
    Basicly once you have connected to the server you only need to look at the transform scripts.
    You will see how it sends the keyboard input to the server for distribution to all connected players.
    All players receive the input commands and apply that to the concerning gameobject.
     
  3. Thomas-Lund

    Thomas-Lund

    Joined:
    Jan 18, 2008
    Posts:
    465
    Yeah - Island demo and the new FPS demo are good places to look on how you do *that*part of networking (transform+animation sync). But that part is rather boring and trivial really :-D

    Check the NetworkTransformSender and NetworkTransformReceiver components

    /Thomas
     
  4. rajmond

    rajmond

    Joined:
    May 18, 2010
    Posts:
    56
    So if I want to sync a position of an gameobject (cube) between different clients, I just need to attach the NetworkTransformSender and NetworkTransformReceiver components?!

    Thanks
     
  5. glass22

    glass22

    Joined:
    Nov 19, 2010
    Posts:
    119
    I asked for the same thing on Smartfox forum.

    But they don't seem to understand people need a way into Smartfox and not a 1000 lines of Unity code they already know.
     
  6. glass22

    glass22

    Joined:
    Nov 19, 2010
    Posts:
    119
    If they would just upload a Javaproject with 1 file, and a Unity project with 1 script, that can communicate back and forth any data, that would be 99% of entry solved.
     
  7. rajmond

    rajmond

    Joined:
    May 18, 2010
    Posts:
    56
    True!
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    just that such a thing could not communicate and would recommend a coding style thats not bad but horribly bad ...

    If there are 1000 lines you know already, it won't be a problem finding the 7 you don't know already ;)
     
  9. glass22

    glass22

    Joined:
    Nov 19, 2010
    Posts:
    119
    I don't want to be recommended a coding style.

    Smartfox is server software, not a "LEARN TO CODE" website.

    I will decide how my projects structure should work and be managed, organised and arranged, that's not the job of server software.

    "If there are 1000 lines you know already, it won't be a problem finding the 7 you don't know already"

    Yes it will, because Unity doesn't work in some organised manor, it's scripts go all over the place rather than just 1 location with reference's and inheritance. Which isn't always a bad thing, it makes it very easy for new people to drop code on objects, but it does make it hard to learn purely from code given to you in a full project.
     
  10. glass22

    glass22

    Joined:
    Nov 19, 2010
    Posts:
    119
    Go and look at globaly respected learning resources like the .net developers network.

    Your not provided with 1000 lines in a visual studio project, your provided with the bare minimum to demonstrate how something works, it's then up to you to implement it.
     
  11. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    but you can perfectly create a starting base from the FPS demo.
    it's also a good way of learning how it works since you need to find the pieces you need.
    the proof of that is here : http://www.edje.net/SFS2
     
  12. Thomas-Lund

    Thomas-Lund

    Joined:
    Jan 18, 2008
    Posts:
    465
    Its really not that bad, and it starts to feel like you are complaining for the sake of complaining.

    There are 4-5 examples (if you count island demo too). Starting from totally basic 1 file connection example (which basically does what you ask for) up to a full FPS using authoritative server.

    Additionally there are tons and tons of small code snippets in the API documentation for almost each and every API call with valid C# code examples - which I also pointed out to you on the SFS forums.

    Its not very hard you just put a minimum effort into learning. The API is even 99% similar across languages, so you also have the AS3 documentation to look at as well as all the examples and explainations available here:

    http://docs2x.smartfoxserver.com/DevelopmentBasics/introduction

    Sorry to sound grumpy.

    /Thomas
     
  13. Claws

    Claws

    Joined:
    Dec 30, 2009
    Posts:
    5
    I must say, after looking at the docs, it seems very good! At first I thought the jump from connecting to lobby to be quite large, but the docs look more useful than the examples. Very good!
     
  14. JRavey

    JRavey

    Joined:
    May 12, 2009
    Posts:
    2,377
    Thomas, this is fundamentally untrue. I like Smartfox, but your description of the examples is not at all accurate. It was a basic connection, a basic lobby, then the basically undocumented tic-tac-toe, and lastly the island example. He is asking about tutorials, not examples. They are really quite different.

    If Smartfox took the time to make very simple examples such as a higher/lower number game and a simple move two cubes in network space tutorials this thread wouldn't even exist. Instead, learners are essentially provided undocumented programs.

    For you to say it's not that hard is unfair, you have a bit more experience. If you were to walk in on another person's job and they were dismissively making comments like that while you are trying to learn, it would be more than irritating, especially when there is not really documentation for *learning* the system.
     
    Last edited: Dec 28, 2010
  15. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Hey Thomas, how do you rate this latest version of Smartfox as with regards to LAN games?
     
  16. luxe001

    luxe001

    Joined:
    Nov 10, 2010
    Posts:
    8
    .... no way to have a simple connection example with send/receive transform !
     
  17. sijj

    sijj

    Joined:
    May 3, 2011
    Posts:
    12
    Hello guys, i am trying to the smartfox server 2x,s tris game example which is provided with the smartfox server,s package. All gets well instead of game. i get in the lobby successfully and i can chat from second user but when i start new game and on other computer i click on that game created by the first user. it does not show me the game.

    First player send the invitation to join the game room but second person cannot seems to accept his request. it remains and in this line and run it again and again like a loop.

    if (roomSelection>=0 roomStrings[roomSelection] != currentActiveRoom.Name)
    {
    smartFox.Send(new JoinRoomRequest(roomStrings[roomSelection], null, smartFox.LastJoinedRoom.Id));
    }

    please help me about this. i am stuck here for over 3 days. thanks
     
  18. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    what error messages are you getting in smartfox ?
     
  19. huxley

    huxley

    Joined:
    Apr 27, 2009
    Posts:
    334
  20. bradmarxmoosepi

    bradmarxmoosepi

    Joined:
    Jul 24, 2012
    Posts:
    3
  21. jake-gr

    jake-gr

    Joined:
    Oct 27, 2011
    Posts:
    93
    @bradmarxmoosepi: unfortunately those videos have not gone into detail about movement between clients :(
    Movement is planned, but I have not been able to make any videos lately as I have been way too busy, but really hope I can get back to continuing the videos soon.
     
  22. b360

    b360

    Joined:
    Jan 4, 2012
    Posts:
    13
    Video Tutorials
    http://www.youtube.com/smartFoxServer


    SmartFoxServer 2X: creating a simple Extension



    Connecting Smartfox to Unity



    Log In to a zone



    Optional Config File



    Joining A Room



    Send and Recieve a Public Message using smartfox



    Set up Install an Extension



    Coding a Request Handler



    Send Extension Request From Unity





    These Older Ones are also good

    Smartfox Server Unity Part 1



    Part 2

     
  23. b360

    b360

    Joined:
    Jan 4, 2012
    Posts:
    13