Author Topic: Joystick, DPad, + more with NGUI available  (Read 17743 times)

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #15 on: June 17, 2012, 01:37:07 PM »
Hey all, quick update.  1.2 is submitted to Unity and includes the NGUI distributable version, which means the example scene and fully set up NGUI prefabs are now included.  There is also a PayPal payment option.

More info and link at the product page
« Last Edit: February 25, 2013, 12:05:45 PM by seandanger »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Joystick, DPad, + more with NGUI available
« Reply #16 on: June 17, 2012, 06:24:31 PM »
My suggestion: equalize asset store and paypal prices. You may not get as much from the Asset store due to their cut, but their advertisements and charts more than make up for the loss in sales. After all, the more people buy it via the AS, the higher it climbs, and the more people see it. :)

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #17 on: June 17, 2012, 06:41:14 PM »
Hey, thanks for the advice!  I definitely take any of your input as authority :) 

I had some feedback from a couple users who were on the fence before purchasing because of the price (and they are now happy they did, I'm glad to report), so I thought $10 off might help.  You are right though, I definitely lose out on the Asset Store promotion, but judging from my current numbers I don't think I have much chance of making it in one of the top lists anyway.  I might change that if I suddenly get enough paypal purchases that would've made a major difference.

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #18 on: June 17, 2012, 06:51:12 PM »
Maybe try following suit with ngui and have a trial version for those that are on the fence.  Once people use it and compare it to the joystick from the standard assets mobile package they'll see its worth.  It definitely feels better than the guitexture version, and it has some nice config options.  Plus it integrates nicely with ngui.  Both are fantastic packages.

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #19 on: June 17, 2012, 09:31:58 PM »
I'm in the process of removing all foreach constructs in my code and noticed (find in files brought them up) that you have six of them in your package.  I'm new to C# (11yrs C++ baby!) and hear lots of horror stories about the gc and foreach enumerators.  I'm just wondering if you profiled the package using a memory profiler, or benchmarked the foreach loops against manual loops?   

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #20 on: June 17, 2012, 09:41:49 PM »
I have profiled it, most controls run at .5% or less CPU time on an iPhone and have 0 allocations after startup. 

When optimizing a game, you probably always have bigger fish to fry than getting rid of foreach loops in your code.  Most of the time, the improved readability is worth the minor performance hit from the enumarator's allocation, that may be a personal preference for some, though.

In any case, I did get rid of most per-frame foreach loops in the package.  Looks like I missed 2 in VCTouchController, but all the other foreach loops in the package only run during initialization, and then not again.  So feel free to change the ones in VCTouchController, but you may not notice a performance difference.

Thanks for catching those though, I'll modify them myself in the next update.
« Last Edit: June 17, 2012, 10:02:14 PM by seandanger »

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #21 on: June 18, 2012, 06:18:41 PM »
Profiled again on my devices to check one last time, and code as it has been since 1.0 has no post-init allocations and low CPU time, just to ease your mind :)

Here's a screengrab of the example scene (2 analog joysticks, 1 dpad, 1 button) running on a somewhat dated Android 2.2 device:

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #22 on: June 18, 2012, 07:07:48 PM »
atz cool man. 

One other thing I wanted to ask you.  The front and back sprites for the analog joystick each have their own panel.  So, for instance, in my case I have two analog joysticks which yields four panels.  Is there a benefit to doing it that way over having one panel with four sprites in it? Or, two panels with one joystick (front and back) in each?  Just wondering.

cheers
« Last Edit: June 18, 2012, 07:14:01 PM by jdwieber »

seandanger

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
    • Bit By Bit Studios
Re: Joystick, DPad, + more with NGUI available
« Reply #23 on: July 09, 2012, 01:54:15 PM »
Hey jdwieber, didn't see your message until just now, for some reason I didn't get a notification on this one, sorry!

ArenMook could answer this better than I can, but basically it seems that the advantage of separate panels is that when the widgets move, they don't have to be redrawn (since the panel is moving, and not the widget).  The disadvantage is that you have a draw call per panel. 

So if you're render bound, you probably want less panels.  If you're CPU bound, you probably want more.  For most games, I'd guess that 1 panel per joystick is probably best, but that will vary with each particular game.

jdwieber

  • Guest
Re: Joystick, DPad, + more with NGUI available
« Reply #24 on: July 09, 2012, 02:08:17 PM »
hey sean,

No problem about the late response.  I'm currently using one panel per joystick with no issues.

Cheers,

Joseph

derkoi

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 57
    • View Profile
Re: Joystick, DPad, + more with NGUI available
« Reply #25 on: August 18, 2012, 01:24:14 PM »
I bought this after using the joystick script with decent results, but I wanted something more suitable for all my games.

This is excellent & Sean's customer support is the best I've received. He's helped me add some features to the joystick that I needed often within minutes of my email!!

Buy it & never wonder if you're using the best method for controls in your mobile games again!