Unity Web Suite (Examples, Tutorials)

Discussion in 'Teaching' started by Tempest, Feb 8, 2009.

  1. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    Unity Web Suite
    Examples and Tutorials

    License
    # License Information

    Description
    Unity Web Suite is a collection of examples, tutorials and assets for demonstrative and instructional purposes. All project scripts are written in C#.

    Updates
    • 2009.06.04 - Web Suite compiled.
    • 2009.04.17 - PHPHandler 2.0 released.
    • 2009.02.09 - PHPHandler 1.0 released.
    • Generate E-Mail from Unity.

    Examples Tutorials
    http://waddlefarm.org/blog/?p=368

    Questions, Comments and Suggestions
    Let me know any questions, suggestions or comments you have by replying to this topic or sending me a private message via the forum.

    =======================================================

    BrowserHandler
    Version
    0.1 Beta, 2009.06.04

    Description
    Interface between Unity and a browser web page.

    Features:

    =======================================================

    PHPHandler
    Version
    0.1 Beta, 2009.06.04

    Description
    Interface between Unity and a PHP web page, mySQL database and PHP functionality.

    Features:
    • Demonstrates Coroutines (yields), in C#, with callbacks.
    • Callbacks used in C# and PHP, allowing for maximum flexibility/scalability.
    • Send/Receive/Parse/Display HighScores
    • Generate E-Mail from Unity.
  2. Quietus2

    Quietus2

    New Member

    Joined:
    Mar 28, 2008
    Messages:
    2,061
    Very nice start for your tutorial!

    One suggestion though.

    As has been shown in a recent thread on security, declaring your hash string in the source makes it the opposite of 'secret.' Anyone with reflection will know what your hash string is and how it's built.

    An inspector variable is a little more obscure.
  3. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    Ah, thanks.

    I was trying to just demonstrate the concept of a hash, though I will take your advice and make it an inspector variable.

    Would you happen to have a link to that security topic?
  4. Quietus2

    Quietus2

    New Member

    Joined:
    Mar 28, 2008
    Messages:
    2,061
  5. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    I fixed the link to the project files (never used Wordpress to place downloadable files, forgive me :eek:)

    Thanks for the link to the topic. Just read through it all. For now I'm going to leave it as is. I'm going to see what HiggyB says about how UT might assist in the security issue.
  6. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    Part 2 has been added. This one specifically talks about how to generate an e-mail in PHP from a Comment Form in Unity.

    I know there are *many* security issues in regards to this, so everyone should remember that none of this should be used "out of the box". Anyone considering using elements like this in their own project(s) should look into how best to secure their information.
  7. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    I've updated the first post. Part 3 and 4 are finished, but not online yet.
  8. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    This will be nice... :D
  9. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    Updated original post.

    PHPHandler 2.0 is now released.
  10. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    I've just updated the zip with a second version of the PHP script. This second version (phphandler_nosql.php) is a version which does not integrate with a database.

    If you don't have mysql set up, and you try to run the Unity script, the Test Connection will fail, because the script is failing to connect to your database.

    If you just want to run the test, and send an e-mail, use the nosql version of the script.
  11. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    Please,

    The tutorials are ready to download? :D
  12. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    It's a three-day weekend here in Germany, so I'll write them for sure this weekend. Maybe if I can scrap enough time together I'll do a video tutorial as well.

    Woo, PHP in Video! Exciting.
  13. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    Nice, I already got your zip file from your site, did nto open it yet, but I will take a look.

    The good point to me is that I program in PHP for years =)

    But still dont know if it will be very good use.

    I'm still waiting for your tutorial multiplayer project :wink:

    Keep up the good work.
  14. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    Hey Tempest,

    when are you going to update this topic?
  15. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    Tomorrow (Thursday,June 4), actually.

    I'm going to go through the last release and write some tutorials.

    After that I will look into how to expand, or progress with this script. Anyone who has used this, or would like to see something related to this demonstrated, let me know.
  16. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    Well, actually, I'm using your script for one of my games. It will be a Web Browser game mixed with 3D Game in Unity :D

    I'm already learning your codes and understanding... if I get the idea behind your script, Unity WWW, it will be perfect. I'm a PHP programmer already, so no problem with this language to me.
  17. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    I do plan on writing a sister-script for this class, which will encompass communication between the browser window and the web app.
  18. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    Thats nice.

    I just tested your code... its working good with my local domain and server. I use mySQL too.

    I will make some changes on your script and make it good to my game... I will post the code later :wink:
  19. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    Hey Tempest,

    I saw that your code are all in C#
    I'm still learning...

    Can you make one in Javascript Unity please?
    :D
  20. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    Currently working on some tutorials/examples, etc. Trying to round this out to be more than just the PHP communication.

    My first priority is the example/tutorials. I may consider the JavaScript when I have some time, yes.
  21. Sammual

    Sammual

    New Member

    Joined:
    Oct 28, 2008
    Messages:
    175
    Tempest, thank you for you efforts!

    I would also love to see these in JS when you have time.

    Sammual
  22. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    No problem at all.

    In fact, I'm learning C# now and I'm understanding better what you done.

    I'm developing my own code now, I will post here when finish.
  23. DigitalGlass

    DigitalGlass

    Member

    Joined:
    May 12, 2009
    Messages:
    66
    Great tutorial! I finally started using coroutines because of this tutorial, and they are awesome.

    I attempted interfacing with facebook using php handler, but i ran into a problem in the requirelogin function. The callback from my site keeps giving me a javascript because it keeps hitting that function. I ended up using external calls and javascript to interface unity and facebook, but I'd still prefer it if I could do it with php handler.

    Any chance you can give some pointers on how you managed to get facebook and unity talking?
  24. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    Yes, I will put up a Facebook - Unity tutorial. It's not quite as beautiful as I'd like, but I imagine it would be moreso if I used the Facebook Connect features (where your app is on your own site, not running through Facebook).
  25. xandeck

    xandeck

    Member

    Joined:
    Apr 2, 2009
    Messages:
    553
    Sorry on this Tempest, but do you have any date to show us the tutorials?
  26. EducaSoft

    EducaSoft

    New Member

    Joined:
    Sep 9, 2007
    Messages:
    650
    Oh yes please, I would be so happy to learn how to interface unity webplayer to facebook api
  27. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    As soon as I get back on a proper sleeping schedule (though night owl hours are productive, or so I claim), I will be pushing forth a small Unity project which will most likely be open-source. It will be a browser game. It will remain small, primarily serving as a living example/tutorial.

    I will then attempt to move that same game into Facebook. While it may not be exactly 'tutorials', the documented work flow and source of this project will be available from the beginning until the end.
  28. Sammual

    Sammual

    New Member

    Joined:
    Oct 28, 2008
    Messages:
    175
    I can't wait for Unity games to take over facebook.

    Sammual
  29. xphant

    xphant

    New Member

    Joined:
    Aug 19, 2009
    Messages:
    1
    where can i download phphandler?
  30. EducaSoft

    EducaSoft

    New Member

    Joined:
    Sep 9, 2007
    Messages:
    650
    Yeah, Tempest -> are you still not sleeping enough ?

    Would like to see some code :)

    Regards,

    Bart
  31. April

    April

    New Member

    Joined:
    Dec 14, 2009
    Messages:
    62
    hi!

    where do i download the tutorials

    i'm a newbie to PHP and i am glad to know that these tutorials exist
  32. Abba

    Abba

    New Member

    Joined:
    Mar 17, 2010
    Messages:
    3
  33. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    @April

    Sorry, I must have removed the link. This is where you can download the project:
    http://waddlefarm.org/blog/?p=368

    @Abba
    I'll review that php tutorial and add or link to any useful information that I think goes well with my tutorial.

    Thanks!
  34. April

    April

    New Member

    Joined:
    Dec 14, 2009
    Messages:
    62
    Thanks a lot, Tempest! And you, too, Abba. :)
  35. Abba

    Abba

    New Member

    Joined:
    Mar 17, 2010
    Messages:
    3
    You are welcome,April!
  36. Abba

    Abba

    New Member

    Joined:
    Mar 17, 2010
    Messages:
    3
  37. adamus888

    adamus888

    New Member

    Joined:
    Sep 21, 2009
    Messages:
    29
    Hello there, Tempest!
    Your PHPHandler link ar you blog seems to be down (404 error)
  38. tatelax

    tatelax

    Member

    Joined:
    Feb 4, 2010
    Messages:
    1,094
    The link is missing!
  39. grfxman

    grfxman

    New Member

    Joined:
    May 28, 2009
    Messages:
    309
    Thanks for this Tempest ! :)

    I have a question since I'm fairly new to this and C#.

    I was able to modify one of your functions to store a Table Entry that had Character Information.

    Name, Password, Strength, Intelligence, HitPoints, Etc..

    And it seems to work Perfectly. But I cant figure out how to

    write a function that loads the character at game start.

    How do I load the Table Fields into a web Form and send it back to Unity?
  40. ashish

    ashish

    New Member

    Joined:
    Dec 20, 2010
    Messages:
    26
    your link for facebook plateform is not working
  41. Tempest

    Tempest

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    1,286
    I will be updating this soon. Facebook has changed significantly since I first wrote this and it will be completely deprecrated in 2011.

    An updated Facebook, Canvas and PHP communication script will be written. I apologize for the negligence on this topic.

    @grfxman --
    There are a couple of ways to do it, all of which basically come down to encoding and decoding a string of text. Like XML, JSON or your own solution. On the PHP side all the data is combined into a single string. On the Unity side the string is parsed and the values are assigned to variables in your script.
  42. Krisper

    Krisper

    New Member

    Joined:
    Mar 24, 2011
    Messages:
    16
    Thanks for sharing these scripts. I have modified what you have shown as a log in script for my game. Works great from within Unity3D and as a standalone build, but it is not working from the WebPlayer. Any ideas why and how I can make it work?
  43. zachypin

    zachypin

    New Member

    Joined:
    Jun 7, 2011
    Messages:
    24
    All the pictures are broken. can you tinypic.com them or something?
  44. missy_pooh

    missy_pooh

    New Member

    Joined:
    Jun 1, 2011
    Messages:
    150
    hi.. i would like to ask anyone of you have try to implement speech recognition in Unity??
  45. Klyngo3D

    Klyngo3D

    New Member

    Joined:
    Oct 12, 2011
    Messages:
    8
    Any chance of getting these files hosted elsewhere.. been trying to download them for a while but the site is always either down or account suspended?

    Regards,

    Aaron (Klyngo3D)
  46. milali

    milali

    New Member

    Joined:
    Nov 1, 2011
    Messages:
    16
    +1 on new place to host them please
  47. RobbieDingo

    RobbieDingo

    New Member

    Joined:
    Jun 2, 2008
    Messages:
    483
  48. tolstoj

    tolstoj

    New Member

    Joined:
    Feb 28, 2012
    Messages:
    1
    Hey, any chance of getting these files hosted elsewhere..
    Please
  49. visuaware

    visuaware

    New Member

    Joined:
    Apr 18, 2012
    Messages:
    3
    is this project dead?

    read all and weeee want to get it.. and site dead -.-
  50. rahuxx

    rahuxx

    Member

    Joined:
    May 8, 2009
    Messages:
    339
    The link does not work anymore. Any other place where project can be downloaded.