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

Unity3D meet Facebook!

Discussion in 'Made With Unity' started by mehware, Dec 17, 2007.

  1. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    Thanks to the help of David H., MatthewFBS and ShawnFBS at Flashbang Studios, and Yoggy I was able to make a Facebook app that integrate Unity3D into Facebook. Here are my results, a screenshot of the webpage...



    The facebook Application is called is called Unity3D! We can grow this app and have a lot of Unity3D demos up on the site.
     
  2. DannyJ

    DannyJ

    Joined:
    Sep 3, 2007
    Posts:
    40
    Very cool! I was wondering, does Facebook have to authorize apps? Also, can you provide more details on the process of building a Unity3D Facebook app? In any case, great job!
     
  3. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
    Thats really cool, I didn't know it would be that easy. I've added it to my profile but so far it just seems to have the example of the webplayer on the application homepage and no other function.

    How hard would it be to make it like a real application that posts stuff to your mini feed, puts a box in your profile and all that fun stuff ? It would be cool to have people add web players or links to web players to their profile as it could increase webplayer penetration.
     
  4. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Nice one! Being able to load up content for free is definately going to appeal to a lot of hobbyists and pro's, I look forward to seeing development here...

    Cheers
    AC
     
  5. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    This tutorial helped out a lot.. http://developers.facebook.com/step_by_step.php

    Then I just used the <fb:iframe> tag to embed the player with the smartsize parameter set to true.

    Yoggy, as far as I know I dont think you can embed an iframe in your profile. I could be totally wrong tho. You can embed anything flash tho but you use <fb:swf> for that.

    Maybe Unity can work with the guys at facebook to get their apps to load peoples feed/profile.
     
  6. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    Also, I haven't hit the submit button to facebook yet. I guess when they accept the application people can do more with it. I embed the tropical demo from unity's webpage (unity I hope this is ok for now). Do you happen to have a link that is just to your demo, the html file that the web player spits out?

    You can view the application by going to http://apps.facebook.com/unitythreedee/

    Here are the results...
     
  7. irataxy

    irataxy

    Joined:
    Sep 14, 2007
    Posts:
    21
    This looks really good. Nice job.

    A question for you, since I am stuck on my Unity/Facebook project. Can you use the Unity Web Players Application.ExternalCall() function to call javascript in a Facebook iFrame application? It doesn't want to work in Internet Explorer for me but will in Firefox. Just wondered if you (or anyone) had a need to try this yet in your app.

    Thanks
     
  8. VICTOM

    VICTOM

    Joined:
    Aug 28, 2005
    Posts:
    233
    Very Cool!

    I've already had requests to make CuttleCandy a FB app.
    from my testers.

    Cheers,
     
  9. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Hmm... would love to see this but the screenshots are not appearing here :(
     
  10. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    So - I bumped into this by accident... The .app on Facebook is a framework to show Unity3D content on facebook?

    I am a little confused. Party because none of the images are showing up hereon the Unity Forum.
     
  11. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Just wondering what the status was on this wee gem?
    Cheers
    AaronC
     

    Attached Files:

  12. Red Ocktober

    Red Ocktober

    Joined:
    Oct 28, 2005
    Posts:
    84
    yeah.. that's what i just got too...

    this sounds interesting though... will be checking back...

    --Mike
     
  13. Mark-Ripley

    Mark-Ripley

    Joined:
    Aug 22, 2007
    Posts:
    148
    It'll only become visible once it's been accepted by facebook - unless you want to put us all on the developers list :D
     
  14. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    I made that a while ago, I know its broken now... It basically was a link to the Tropical Island scene, I think its broken because facebook is newer or something :p
     
  15. dingosmoov

    dingosmoov

    Joined:
    Jul 12, 2005
    Posts:
    559
    did anyone get this working again?
     
  16. shaun

    shaun

    Joined:
    Mar 23, 2007
    Posts:
    728

    Attached Files:

  17. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    @ Shaun, I loved the earlier beta where that square concrete structure kept instantiating and going flying around the place, was quite funny...


    Any chance you could share how you got this online on FB? Theres probably a bit of web type code that is beyond some of us..

    Good job

    AaronC
     
  18. chonli

    chonli

    Joined:
    Mar 13, 2009
    Posts:
    19
    Any help/tutorial about this?

    Thanks.
     
  19. musichopper

    musichopper

    Joined:
    Jul 22, 2009
    Posts:
    55
    I have been looking to do the same thing. The trouble being integrating stats of players and scores etc with facebook itself to make it go viral. How does unity communicate with facebook?
     
  20. dimeRocker

    dimeRocker

    Joined:
    Jun 25, 2009
    Posts:
    79
    Funny you should resurrect this facebook thread...

    Currently, we at dimeRocker are building a robust platform that will enable Unity devs to deploy and profit from their games across the social web - beginning with Facebook.

    www.dimeRocker.com will host a standardized dRock API offeriung Microtransactions, Analytics, Social Leaderboards, etc. that will allow devs - like yourself - to enrich your game content, upload it to dimeRocker.com, and then unleash it across popular social networks, while tracking/maintaining your game(s) from one central location.

    We are expecting to have a dRock platform prototype by the end of the month.

    As you may have read in another thread, we are also currently looking for Unity games that have a microtransaction strategy in place, or could have one in place within a short window of time. We plan to begin testing in the next couple of weeks.

    Far from a portal, dimeRocker is a social game hive where Unity developers can manage their game across the net from one centralized platform. By integrating the dRock API into a game, it won't matter where the game is played, all revenue and user data flows back to dimeRocker.

    Instead of developers rebuilding the same hooks over and over to connect individual games to Facebook, we provide standardized tools to eliminate this constant reinventing of the wheel. Our thinking is simple: you concentrate on building the best games possible, we'll concentrate on building great tools to help monetize them and build audiences.

    As some of you may have noticed, over the past few months we have been setting up a bunch of free developer initiatives including:

    dRock hosted servers: a Unity MasterServer, NAT Facilitator and Connection Tester conveniently located in North America. http://bit.ly/B9LYu

    We recently brought Tom Higgins up to Vancouver to host our Unity TGIF and Workshop where we launched www.UnityUsersGroup.com Check out his blog post: http://bit.ly/18gnLq

    The UUG is designed to compliment this Unity forum, and provide a place for Unity devs to coordinate with other devs in their area.

    It is live now, but is still a work in progress, and we invite your input. We encourage you all to sign up and begin building your local chapter -- we're looking for UUG Pit Bosses to motivate and moderate your city.

    Any devs interested in learning more about dimeRocker, please sign-up so we can keep you posted:
    http://dimerocker.com/devsignup/

    Feel free to contact me directly as well with any questions, ideas, or games.

    Cheers,
    J.Joly
    dRock VP of Content
    j.joly AT overinteractive.com
     
  21. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Read J's post above, but the general answer to your question is that Unity offers a WWW class that lets you issue HTTP get/post calls, using those you can communicate with web services to get/store data as necessary. You'd just need to write (or re-use as per the above) that communication layer.
     
  22. musichopper

    musichopper

    Joined:
    Jul 22, 2009
    Posts:
    55
    Awesome! Thank you. This could be a big money maker!
     
  23. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I never actually thought about putting my games on facebook. Reason being that I am not all that keen on facebook... But, since the rest of the world IS keen on facebook, why the heck not?

    Here is what I have in mind:
    I already have a game built as a web player so I want to just put that up on my facebook page so anyone who comes onto my page can play it and see the links to my website. On my website I then sell anything I want to make money with...

    So, being new to the whole facebook scene and hearing all the "how did you do this?" posts, am I right in saying that adding this to facebook requires a lot of work? Or is it very little work but just a complicated process? Or is it only the case when you want to incorporate facebook INTO your app or vice versa?

    If I just want to put my single player game on facebook with no interaction with facebook itself, how much of an effort will that be?

    i am at work now and all access to facebook is blocked so I can't investigate this myself for at least 9 more hours... so some basic info would be very welcome.

    Thanks very much
     
  24. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Doing that will be easy as there is no integration with the Facebook APIs, you're just posting a game and trying to pull people back to your own external website. But in saying that you're sort of "missing the boat" with respect to the "why Facebook?" question. One of the ways to draw people in is to specifically allow them to play against/with their friends, or in single player games to compare stats and scores with their friends. And by friends, I mean their Facebook friends. Thus using the Facebook APIs to do that adds "stickiness" to your game and thus gives it a better chance to be popular. Would Mafia Wars be 1/10th the game it is if it was just some single player game not involving playing against friends and others? No way!

    Integrating the Facebook APIs for things like friend score sharing and whatnot isn't really "tons" of work per se, but it's also not going to be trivial. We'd love to see ready-to-use integration kits, whether through efforts like that from J.Jolly via dimeRocker (see his post above) or as something we eventually have ready off of our website.


    If you want to see an example of a Unity authored Facebook game that integrates nicely with friend lists and all that, check out Paradise Paintball (by CMUNE), it's good stuff!
     
  25. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I see your point...

    If you're gonna do something and entirely miss the point, then what's the point...

    I think I'm gonna leave this for the time being until I have the time to do it properly.

    Thanks .... Higgy? HIGGY, IS THAT YOU!? Wow!


    ....Higgy... :p
     
  26. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Facebook setup is rather easy, I use IFrame myself and I have Unity going with it, although I set that project a side a while back. Problem I have is that Facebook still hasn't done the javascript PUSH like they need correctly on the outer boundries of the FBML. Usually have to refresh the screen like 2 or 3 times before the footer in the IFrame is pushed right.

    http://apps.facebook.com/landsoffaith/

    Different people have gotten it to work different ways, this is just one of the few ways to get it to work, Unity will work in both FBML and IFRAME, just have to know how to setup your pages on your server, thats about it.
     

    Attached Files:

  27. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    20 years ago... :)
     
  28. dimeRocker

    dimeRocker

    Joined:
    Jun 25, 2009
    Posts:
    79
    Admittedly, facebook (250M members) is the top-shelf of the social web, but is not the only shelf.
    myspace = 265M members
    Friendster = 90M members
    Hi5 = 80M members
    Orkut = 65M members

    These are the top 5 social networks and have a combined membership of 750M.

    Why not deploy across all of them?

    Unraveling Facebook API is only the beginning, dimeRocker is working on standardized API that will enable independent Unity devs to deploy to all of them.

    We invite feedback on what kinds of API Unity devs are looking for to harness the full potential of the web.

    Cheers,
    J.Joly
     
  29. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28


    Can we get a step by step tutorial from Unity on how to make our games work in FB? I mean simple things like what format to export the game in, as a widget, webplayer etc. I went through the FB developers website and entered my apps url but nothing showed up. Were can we go to find more tutorials on things like this. If Unity had more info it would be more appealing.
     
  30. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28
    How do you set up your pages properly on the server so FB can read it?
     
  31. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    I will post a step by step tutorial later today.
     
  32. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    Here's my 2-minute Unity to Facebook demonstration:

    http://waddlefarm.org/blog/?p=617

    The video hosted on Vimeo will be available in roughly 40 minutes (6pm PST, Sunday)
     
  33. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28
    Thanks for this tutorial! I really appreciate you taking the time to do this. I actually did all that and still no cigar :oops: I'm wondering if it's because I have an indie version of Unity? I saw that you removed the "Made with Unity" is that imperative in having it work in FB?
     
  34. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    Removing the HTML that I did was merely for appearance. The memory game was also made with Unity Indie.

    If you can get your web game on your web site without any issues, there shouldn't be any with Facebook, as in *this* demo, there is nothing going on but simply loading your site as a frame.
     
  35. Matroblend

    Matroblend

    Joined:
    Jan 30, 2009
    Posts:
    134
    Thanks for the visuals, on another note what ever happen to your Harmony project?
     
  36. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28

    Dude! Thank so much, I tried it again and it WORKED :D although I changed a couple of things and honestly am not sure which one made it work. First I had links on the html page which hosted the game and I removed all those links. I noticed your html page had only the game and no extra content. Then I took off the underscore in the html link, I read somewhere else that FB does not like capital letters or underscores. Then I reloaded it and it worked!

    I'm really pumped about this potential of hosting games in FB.

    Now on to the next step: How do I make the game interactive where players can compete against their FB friends? Anyone out there with an interactive FB game?
     
  37. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28

    Cool, how do you remove the "made with Unity" with the indie version?
     
  38. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    CMUNE has Paradise Paintball. Doing multiplayer work (even without any FB integration) is a big step ahead of single player games. You can start by reading up on our built-in feature set here:

    Networked Multiplayer

    Then after that know that we have raw HTTP/Socket support so you can tie into other back-ends like SmartFox, Neutron, NetDog, etc. if you'd like.


    You don't. If you want to remove that then you have to upgrade to Pro as per the License Comparison page.
     
  39. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I just couldn't resist...

    It is just so easy to just load your game in facebook...
    I have this tool that allows me to make web player games... :p
    I have this web player game...
    I have facebook...
    I have the internet...
    I just couldn't resist...

    http://apps.facebook.com/cutoutheroes/
     
  40. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    @Matroblend
    No problem. Harmony was a bit overambitious for me. :) Maybe hopefully eventually.

    @mrswebb
    Glad it worked!!

    As for interactive Unity-FB games, Paradise Paintball is one. I worked on CrazyKart (also done in Unity, of course):

    http://apps.facebook.com/crazykart/

    I did not remove the "made with Unity" within the app. I removed the HTML at the bottom of the page. Though you can't entirely see the "Unity" watermark in the app because the app itself is *wider* than the space FB gives it (the memory game wasn't made for FB, it was just a game I did months ago).

    @mrswebb/higgyb
    Having an "interactive FB game" doesn't neccessarily mean *real-time networking*. CrazyKart, for example, isn't multiplayer, but does allow you to compete against your friends. You don't have to do any of the networking/sockets/smartfox/neutron/etc.

    You do, however, have to come up with a system for Unity->FB communication, which is a pain :)

    @MrDude
    Nice! :) It really is easy.
     
  41. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28


    Neat game! I noticed that CrazyKart asks can it pull your profile information before you play the game, then it also allows you to invite your friends to play the game and posts your score to your profile. It also shows your friends score on the game, if they play it as well. That is the type of FB integration I am looking to accomplish. How do you program that integration into your game on FB?

    I looked up Facebook Connect but I think that is relating to connecting with your FB friends outside of FB, like in iPhone games or other places on the web.

    Here is a short tutorial I found on adding FB connection to your iPhone game. I play Scrabble on my iPhone and it uses this feature, pretty cool.

    http://vimeo.com/3616452
     

    Attached Files:

  42. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28
  43. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
  44. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286

    1. Yes, the 'permission to access your data' prompt is typical of most (all?) Facebook application. I think it occurs by default the first time you visit the app (and therefore install it onto your account).

    2. The typical Facebook integration is exactly what is featured in CrazyKart. The latest update just added the news-feed upon achieving an award. To achieve this you're going to want to use the Facebook Platform API to give you some information via PHP (most likely). You'll the store that information in a database, and then your app would read/write to that database (for scores, etc).

    3. Facebook Connect is for integrating the Facebook Platform API with your own site. This would be used if you had a game which was completed outside of the Facebook website, but you wanted to use Facebook data.
     
  45. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Loving it... :)

    Higgy, you ARE the man. Let nobody tell you differently...

    I notice there is currently no place where my visitors can see I have an app on facebook so I resorted to posting a note on my wall but I have no idea wether anyone has taken note of it or not... I then noticed on one of my mate's pages that her scores in Poker all go onto her wall and now I am no longer happy with simply putting my single player games on facebook... Nwo I want to do it properly but I just don't have the time.... So sad...

    And then Higgy comes along and makes me smile...

    If these forums had the option of sending little respect/ picture icons to people you would have deserved a beer icon right there :)
     
  46. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Thanks for that beer...

     
  47. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    If I knew how to do that I would have had it delivered to you. Sorry you had to go collect yourself... Hope you enjoyed it :)
     
  48. cry0

    cry0

    Joined:
    Apr 9, 2009
    Posts:
    71
    I know that this is probably trade secrets, etc, etc... but would you be willing to give us, unenlightned souls, a simple tutorial in how to integrate FB API specific calls (posting to walls, inviting friends, etc) with a unity build?

    I belive that that is "the real McCoy" everyone in this thread would pretty much love to get their hands into.

    Many thanks.
     
  49. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    I will try to do something like that within the next week or so. Slowly piece-by-piece posting demonstrations of various Facebook API integrations.
     
  50. cry0

    cry0

    Joined:
    Apr 9, 2009
    Posts:
    71
    Thanks a million :)

    Look forward to it.