Search Unity

Speed comparison: 2d Unity vs Monkey

Discussion in 'General Discussion' started by Xaron, May 30, 2014.

  1. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    654
    Excuse me haha. I wasn't disagreeing with anyone sorry for that.
     
  2. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    It's possible to do 3d in Monkey, even with the usage of shaders and all that. An empty APK is then about 200kB.

    I really would love to see Unity's APK size go down.
     
  3. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    It must be a challenge to even make a pong clone that big.
     
  4. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    It's nothing but the default build size on Unity. All the (two) sounds are generated procedurally, the graphics are built entirely out of create->cubes, and the only material used is the Unity included self-illuminated diffuse shader. However, when I build the project for OSX:

     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Monkey is a great thing, but I don't see it as competition for unity. I see it as something that should be picked for it's focus on a specific area.
     
  6. Serdnad

    Serdnad

    Joined:
    Jan 9, 2013
    Posts:
    14
    @Arrowx, if you upload your project file on here, I could try it out on my Android. Smart alternative, btw.

    @Xaron, maybe you could update the original post?
     
  7. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
  8. Serdnad

    Serdnad

    Joined:
    Jan 9, 2013
    Posts:
    14
    @Arowx
    Even though the sprite is different, which might make comparisons less accurate, and other differences like the walls, and the fact that I think some of the sprites were out of the screen, I tested your version, and got 52 FPS. So congratulations.

    Also, if I may, I'd make the pong pieces start faster, and for the bounce I'd just reverse the horizontal speed when it collides with a player, and the vertical speed when colliding with the wall. Just my 2 cents, you've probably got that worked out.
     
  9. Peter-Apple

    Peter-Apple

    Joined:
    May 29, 2014
    Posts:
    55
    The base cost (some may need to buy add-on later) of using
    Unity for Android (with optimized feature) is 1500+1500 = USD 3000,
    while monkey-x is USD 100.

    If we are going to make a 2d game , what is the point of using Unity (high cost, lower fps and huge apk size) according to above comparison of performance and the cost?
     
    Last edited: Jul 1, 2014
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Because 2D's moved on. If you want something primitive and simple, then it's fine. If you want complex dissolve shaders and post fx then it's not fine.
     
  11. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    Sure, but as hippo says, Unity has a lot of stuff on board that Monkey does not. Physics, audio, animation and other modules, a Mono/.NET runtime and its own associated libraries, etc. etc., and the way that Unity currently works means that you can't chop out the bits a given game isn't using at build time. (I hear rumours that this may be worked on in the future.)

    Comparing single points between Unity and Monkey isn't really useful, because one is an SDK and the other is a full Editor environment. They're not really generically comparable.

    The APK size comparison is kind of like pointing out that you can't park an M1 Abrams in a standard carpark at your local shops. No, you can not, but an M1 Abrams and your standard residential car have pretty radically different design concerns.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Not to mention fringe benefits like an editor you can extend while you use it without restarting anything. The power of that is probably lost on people doodling around, but for me I've found it to be one of the primary reasons to use Unity even for 2D. Add in profiler, half the internet's worth of solved problems, all of .net and you've got a lot of power to actually get stuff done.

    Plus c# verses basic? oh come on.
     
  13. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    That's not even a "fringe" benefit in my mind. It's literally the starting point of projects:
    - GameObject + Component system
    - Cross platform deployment of said system
    - Extensible editor in which to implement project-specific custom tools and workflows with which to effectively operate on said system.
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I agree, it's my subtle way of pointing out to people that they've missed the elephant in the room.
     
  15. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    Well you can use shaders and post fx with Monkey as well as Monkey uses OpenGL for 2d.. Personally I don't see the need for that for a 2d game, but that's maybe only me. Beside that Monkey has its benefits over Unity for 2d(!) for mobile devices, I stick to that. :)
    Admob works out of the box, IAP as well for all three major platforms, GameCenter..., stuff I really miss in Unity (of course I know it's available via the Asset Store). Much less APK size, IMHO easier to handle (for programmers, not for artists). I still think Unity is awesome for 3d but simply overkill for 2d. It's just not made for that.

    Plus you have more targets, one is HTML5 (which works with WebGL btw and 3d as well with monkey).

    But again, it was not my intention to start some kind of war, so sorry for that. Both are great tools which do their job and both do it good! It's just a matter of preferences. Personally I'm not that emotionally bound to a tool but just use always the best one (for me) for a job which is Monkey for 2d and Unity for 3d.

    Edit: Some 2d HTML5 demos:
    http://playniax.com/showcase/gp/demo.html (a simple 2d shooter)
    http://playniax.com/demos/balldemo/MonkeyGame.html (drag the ball with the mouse)

    2d physics (yes Box2d works):
    http://playniax.com/showcase/statue/demo.html
    http://playniax.com/demos/agui/MonkeyGame.html

    All HTML5, works the same for all other targets. I agree those are "primitive and simple" examples but hey, just to show that you can do stuff like that very, very easily.
     
    Last edited: Jul 1, 2014
  16. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Yay 52 fps - Unity Won.

    Well I kind of "cheated" but, it was a throw things about demo so why not use the particle system.

    Maybe we need a Unity vs Monkey 2D physics speed competition?
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I don't think we need any kind of competition. Both are products for different purposes. They also use entirely different languages and have massively different language feature sets.
     
  18. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    I always wanted to do something with particles as sprites. Anyone tried using them in a meaningful way? Maybe a boid simulation?
     
  19. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    There was a great boids presentation by Unity, it was a around version 2 or 3, and it covered optimisation techniques, can't seem to find it now though. :oops:
     
  20. Serdnad

    Serdnad

    Joined:
    Jan 9, 2013
    Posts:
    14
    @Arowx Don't mean to burst your bubble, but Monkey still got 60FPS on it's first try, and probably only 60 because that's the target FPS set by Android.

    And I mostly agree that I don't really see much use for shaders in 2D games. And even though monkey may lack some features, it does have others that unity lacks, such as out-of-the-box ads and gamecenter, and not to mention the massive improvement over APK size, and the performance improvement. If it's possible to use monkey for a certain game, then it might be the best option for it.

    And in response to an earlier post about smaller file size, I read on a Unity blog that they're working on being able to include only what's being used in the finished file for unity 5 I believe. It's the link posted earlier.
     
  21. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,135
    I use shaders to add special lighting effects to assets so I don't have to redraw them for specific environments. It's actually super common and a good idea if you want to branch out the fidelity of your assets. It's actually really handy for things like day/night cycles and making your sprites have view-direction independent shading without having to redraw frames.

    If you don't see a use for them, you aren't looking close enough at your workflow.
     
  22. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    That's a bold statement. :D So you mean if you don't use shaders you don't take 2d game dev serious or did I simply misunderstood it? Most of the top 2d games in the stores (again, mobile!!!) surely don't use any shader stuff at all!

    Do you really think that companies like SuperCell with their Clash of Clans game "did not look close enough at their workflow"? ;)
     
  23. Serdnad

    Serdnad

    Joined:
    Jan 9, 2013
    Posts:
    14
    Hey, shaders can be useful for more complex games, but simpler games, the kind that populate a good portion of 2D apps, don't really need a shader, or a shader might not be very applicable to the graphics. Even certain art styles don't use shaders simply because it's not the look they're going for.

    And trying to go back on topic, imagine if you're making a rather simplistic 2D game, and shaders are the only things preventing you from saving nearly 8MB and some performance. If monkey can do everything you need but the shaders, it's at least worth some consideration, wouldn't you agree?
     
  24. Xaron

    Xaron

    Joined:
    Nov 15, 2012
    Posts:
    379
    I agree on that even though I still don't see the need for shaders for a 2d game. Call me stupid! :)

    BTW: You can use shaders with Monkey as well as you have access to the OpenGL pipeline which might be more rough and not that elegant like the Unity shaders of course.