More iOS progress

216 views
Skip to first unread message

Michael Bayne

unread,
Jan 23, 2012, 6:29:55 PM1/23/12
to pl...@googlegroups.com
Attached is a screenshot of the Pea Physics demo running on an iPhone 4.

I got side tracked by trying to get things working on a real device.
The simulator runs the Mono VM in JIT mode (though with various
restrictions in place to ensure that you don't do anything that's
incompatible with AOT compilation), but actually doing AOT compilation
enforces substantially more restrictions. I had to "refactor" IKVM to
contain no references whatsoever to System.Reflection.Emit even if
they were never called. I also bumped into a Mono compiler bug and
spent some time digging into the internals of IKVM and mcs (the Mono
compiler) so that I could come up with a work-around and file a
sensible bug report. It turned out to have already been fixed in trunk
(which made my investigations that much more perplexing), but since
MonoTouch is commercial software, I was necessarily working with the
latest beta release, not trunk; annoying!

Performance of the Pea Physics demo is not stellar on an iPhone 4
(it's quite reasonable, it's just not silky smooth 60 FPS with twenty
or thirty peas moving on screen). It's pretty comparable to what I've
see on actual Android devices. Depending on what Box2D's interfaces
are like, there's a possibility that it could be improved by writing
an interface-compatible implementation of Box2D directly in C#. C#
supports value types, and in a physics simulator, being able to store
your Vec2s and Matrix3s directly inline, rather than separately on the
heap, can substantially improve cache performance. That said, the
Box2D implementation, as is, is not very data-oriented. Rewriting it
to store all of the entity geometry in big flat arrays and to perform
its calculations by iterating over those arrays, rather than following
a zillion pointers through the heap, would probably help a lot on
every platform.

Now that I've got things running on an actual device, I'll go back to
finishing up the platform implementation. IOSCanvas is substantially
done. IOSStorage is done (built on Sqlite). IOSTouch (and IOSPointer)
are done. I need to implement the font and text rendering bits of
IOSGraphics/IOSCanvas. Then IOSSound, IOSNet and other niggling bits.
I'm not sure what I'll do about IOSKeyboard. I'd kind of like an
additional interface for requesting a string of text from the user,
which would allow the keyboard to pop up in "edit a line of text" mode
so that the user can use the standard copy/paste and click with
magnification text navigation. Having the app respond to key events
and attempt to implement text entry directly is a massively bad idea
(on any mobile device), IMO.

-- m...@samskivert.com

IMG_0935.PNG

Fred Sauer

unread,
Jan 23, 2012, 6:56:13 PM1/23/12
to pl...@googlegroups.com
Fantastic progress, Michael!
--
Fred Sauer
Developer Advocate
G
ooglInc.
1600 Amphitheatre Parkway
Mountain View, CA 94043
fre...@google.com


Ray Cromwell

unread,
Jan 23, 2012, 7:03:09 PM1/23/12
to pl...@googlegroups.com
Epic hacking, just epic.

On Mon, Jan 23, 2012 at 3:29 PM, Michael Bayne <m...@samskivert.com> wrote:

Matt Mastracci

unread,
Jan 23, 2012, 7:34:16 PM1/23/12
to pl...@googlegroups.com
Excellent!

I'd definitely love to have a Box2D that wasn't so new() heavy. We'd probably see some pretty decent improvements on the web platform. 

Fantastic work, Michael.

<IMG_0935.PNG>

Matt Mastracci
Twitter@mmastrac
Bloggrack.com

Ray Cromwell

unread,
Jan 23, 2012, 7:39:33 PM1/23/12
to pl...@googlegroups.com
What I'd do is create an abstraction based on JS TypedArrays and
manual management of allocations within them, and recode Box2D to use
it. We can then provide separate efficient implementations for Java,
Flash, and iOS.

mbarbeaux

unread,
Jan 24, 2012, 2:57:18 PM1/24/12
to PlayN
Impressive work Michael !!
This is just amazing.

+100 for the Box2D modification with flat arrays, that would
definitively speed up physics games !
> > matt...@mastracci.com
> > Twitter: @mmastrac
> > Blog: grack.com

kebe...@gmail.com

unread,
Jan 24, 2012, 11:43:04 PM1/24/12
to pl...@googlegroups.com
Michael, 

I might want to hit you up with some iKVM related questions if you don't mind. I started playing around with it on a wild hair tonight and have the beginings of an XBox 360 backend starting t twitch, but this is literally the first time I have ever done anything complex with iKVM and suspect I might hit a wall soon.

Richard Corsale

unread,
Jan 25, 2012, 12:17:00 PM1/25/12
to pl...@googlegroups.com
Hmm, what about ios's NStimer? 
--
If it seems too easy, it's probably foul.

Michael Bayne

unread,
Jan 25, 2012, 12:18:04 PM1/25/12
to pl...@googlegroups.com

Feel free to send them my way.

I have an updated version of IKVM that I'll upload today, which
contains more patches to support ahead-of-time compilation and some
other bits. That's not necessary for XBOX since the XBOX runs a
JIT-compiling VM, but on the iPhone, the game must be AOT compiled
when deployed to the device.

-- m...@samskivert.com

Michael Bayne

unread,
Jan 25, 2012, 12:18:39 PM1/25/12
to pl...@googlegroups.com
On Wed, Jan 25, 2012 at 9:17 AM, Richard Corsale
<richard...@gmail.com> wrote:
> Hmm, what about ios's NStimer?

What about it?

-- m...@samskivert.com

Ray Cromwell

unread,
Jan 25, 2012, 12:52:16 PM1/25/12
to pl...@googlegroups.com
Is there a way to load personally developed apps on your own X-Box, or
do you need either a special developer X-Box, or a jail-broken one?

Michael Bayne

unread,
Jan 25, 2012, 1:03:11 PM1/25/12
to pl...@googlegroups.com
On Wed, Jan 25, 2012 at 9:52 AM, Ray Cromwell <cromw...@google.com> wrote:
> Is there a way to load personally developed apps on your own X-Box, or
> do you need either a special developer X-Box, or a jail-broken one?

I think you can do it as long as you have some basic memberships
(silver Live membership and a free app hub membership):

http://msdn.microsoft.com/en-us/library/bb975643.aspx

-- m...@samskivert.com

Michael Bayne

unread,
Jan 25, 2012, 1:04:11 PM1/25/12
to pl...@googlegroups.com
On Wed, Jan 25, 2012 at 10:03 AM, Michael Bayne <m...@samskivert.com> wrote:
> I think you can do it as long as you have some basic memberships
> (silver Live membership and a free app hub membership):
>
> http://msdn.microsoft.com/en-us/library/bb975643.aspx

For all of Microsoft's past sins, the XBOX division has been one of
the most open and developer friendly in the game industry. They
managed to inherit that good trait from the mothership.

-- m...@samskivert.com

Robert Cooper

unread,
Jan 25, 2012, 9:07:09 PM1/25/12
to pl...@googlegroups.com
Yeah, if you want to actually run the apps on an XBox and not just XNA Windows, you have to pay them. Same $100/year as Apple or Amazon or whatever. That seems to be the rate for everyone that isn't Google.. (of course MS wants $800 for the tools too :P)

If you go to the XBox market and search for a game called XNA Connect (that is the remote deploy/debugger for XBox), and download it, they will prompt you to pay them $100/year for the App Hub membership on your Live ID. Then just install the XNA tools into Visual Studio, it will UPnP your XBox, and you are done.

mobi...@gmail.com

unread,
Sep 3, 2012, 1:47:58 PM9/3/12
to pl...@googlegroups.com
Any progress posted related to iOS since January. There seems to be a lag with pea physics in September 2012 on iPad and iPhone.

GrayBird

unread,
Sep 4, 2012, 10:30:17 AM9/4/12
to pl...@googlegroups.com
  You can just import native libraries from C++ through the JNI. I guess that in this case during you are compiling from java to C# project it will also import natives libraries. I guess that like in case with lwgl libraries you should also import libraries for appropriate operation system.

вторник, 24 января 2012 г., 1:29:55 UTC+2 пользователь Michael Bayne написал:
Reply all
Reply to author
Forward
0 new messages