Author Topic: iPhone Demo  (Read 11825 times)

0 Members and 1 Guest are viewing this topic.

Offline boogop

  • C= 64
  • **
  • Posts: 73
  • Karma: 42
    • View Profile
iPhone Demo
« on: December 17, 2010 »
Longtime lurker here. I thought you guys might be interested in this--I'm finishing up a retro demo for the iPhone. To my knowlege this hasn't been done before, at least I've never seen a real demo in the app store. There are a couple showing demo type effects, but no real oldschool demo.

I'm doing this in Objective-C on a Mac mini. Obj-C is basically a wrapper for C, but contains enough Mac weirdness to make it a challenge. It takes a subset of OpenGL that doesn't offer quads or the predefined shapes in GLUT, so you have to do everything with lines, points or triangles. There are some good gaming libraries available like CocoaGL, but for me it's been easier to just write it using OpenGL directly.

I'm doing the music in Garageband, which ships with MacOS. It's pretty good and has a huge variety of samples and loops. Found something interesting though when I dragged one of my ancient MIDI compositions into it. Garageband understands MIDI and lets you redefine the voices for each track.

I'm including some of my favorite oldskool effects:
- parallax stars
- sphere
- free-direction dot tube
- dot tunnel
- texture-mapped tunnel
- plasma mapped onto a pyramid
- blobs mapped onto a cube
- dot grid
- terrain
- copper bars

The dot tunnel has actually been the biggest b*tch to figure out. I'm not including a lens effect or 3D starfield because those have been really overdone. I'd post this on the Obj-C sub-board but there isn't one! lol

TLM/Lathe
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: iPhone Demo
« Reply #1 on: December 17, 2010 »
Screenshots or even a video would be nice for all the guys dont own an iPhone. thx
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline boogop

  • C= 64
  • **
  • Posts: 73
  • Karma: 42
    • View Profile
Re: iPhone Demo
« Reply #2 on: December 17, 2010 »
Don't have any screencaps of the emulator, but here are some from my C# version.

Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: iPhone Demo
« Reply #3 on: December 17, 2010 »
Wow, screenshots are looking nice! Good work! ;)
The stuff on the screenshots in coded in C#? Are you using XNA or C# System.Drawing for doing the stuff?
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Dr.Death

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 445
  • Karma: 9
    • View Profile
Re: iPhone Demo
« Reply #4 on: December 17, 2010 »
Looking nice so far mate you going to upload the ipa on here for us too??
Proud member of DAWN

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #5 on: December 18, 2010 »
Looking good boogop!

I've been doing a bit of iPhone dev lately and I've also been trying to find some time to whip up a demo for the iOS but unfortunatly I haven't been able to fit it in my schedule yet.

Fingers crossed I'll get something done in the new year and we can compare notes :)

Offline boogop

  • C= 64
  • **
  • Posts: 73
  • Karma: 42
    • View Profile
Re: iPhone Demo
« Reply #6 on: December 18, 2010 »
thanks, va!n. Yeah, I have all of this in C# and am porting it over to Obj-C. My C# project went through two builds--the first one used a free FastBitmap class (really good stuff, uses C#'s unsafe mode to get blazing putpixel speed out of GDI+) and the second uses CSGL.

I was porting a lot of the routines from crap I wrote in the early 90's, so FastBitmap got me closest to the old putpixel kinds of functions that I'd written effects for (copper bars just ain't happening with triangles). Once I had the stuff in C#, then I could start on OpenGL. Once that's done, porting it to XCode isn't all that difficult.

And I make my living in C# so during slack times ('padding the schedule') I work on this. Wish there was a way to code for the iPhone on Windoze but Mono = oh hell no. And it's too bad because Visual Studio is head and shoulders above the XCode IDE.

staticgerbil: I hear ya brosef. I'm a bit older so if the grandkids aren't tormenting me, the wife is casting (spendtimewithme +5) whenever I'm on the computer too long. If not for 'padding the schedule' I'd never get this done, but this way I can hack the basic code out at work and then debug it in XCode later.

But do try, man. The iPhone/iTouch/iPad represent a massive installed base who have never heard of demos. But they love the app store and free apps!
Challenge Trophies Won:

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #7 on: December 18, 2010 »
If you're happy to write in c / c++ you can code for iPhone on windows with some neat hackery, I do it myself.

Basically, obj-c can create standard c++ classes and call standard c code so what I have is one obj-c class which initialises the iPhone and creates a timer which then calls my c++ classes Update() function and Draw() function.

Then for dev on windows I replace the obj-c code with some code that sets up a window and calls my same app classes Update / Draw functions.

Unfortunately I can't give away the code I have as it's not entirely mine to give but I'm happy to discuss the general process :)

Offline spitfire

  • Amiga 1200
  • ****
  • Posts: 275
  • Karma: 9
    • View Profile
Re: iPhone Demo
« Reply #8 on: December 19, 2010 »
Please do. What libs do I need to work on windows?

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #9 on: December 19, 2010 »
My windows build links with...
SDL - To set up a window because I'm too lazy to setup GL myself
GL - Graphics
OpenAL - Audio

Older iOS devices will use GLES 1.1 and newer devices will use GLES 2.0
GLES is similar enough to regular GL that I mostly just code using standard c/c++ and GL.

There are some functions that you will need to write defines for as the actual function name is slightly different.  Some of them you will need to either add or remove an 'f' from the end, eg. glFrustum.

I believe the rendering functions that you call between glBegin and glEnd are not in GLES so you need to use glDrawElements and glDrawArrays to get your graphics on the screen.

I haven't tested OpenAL on an actual iOS device yet so I can't vouch for that library yet but it *should* work on both windows and iOS the same.  I'll try to confirm that for you.

The other trick you will need early on (for the XCode build for the iOS device) is that, I think, you can only create c++ objects from a .mm file.  XCode by default will create everything in .m files so you need to change any files you plan on creating c++ classes in to .mm.  Just renaming them should work.

Hopefully that will help you in the right direction :)

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #10 on: December 19, 2010 »
Another thing I saw today that might be of interest is that OGRE now supports iOS, so you could possibly just use that?

iOS and Nintendo DS are also targets for SDL 1.3 but only under the commercial license.
« Last Edit: December 19, 2010 by staticgerbil »

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #11 on: December 19, 2010 »
Sorry to keep posting but I just thought that I should clarify that what I'm doing is just creating cross platform code that can build on Win / OSX / Linux / iPhone.

So I'm not actually creating iPhone binaries and getting them on a phone using Windows.

That part is still done on my Mac but I can write and test my app on Windows and then just get the latest code in my XCode project and hit build to get it on my iPhone and iPad.

It used to be possible to build and upload to the iPhone in Windows but it required using the web interface which Apple has changed and afaik you can't do it anymore.

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: iPhone Demo
« Reply #12 on: December 31, 2010 »
Looking forward to seeing the demo effects on the iPod/iPhone.

I'm getting to grips with iOS Objective-C as well (developing on a Mac).  It's a really weird language until it finally 'clicks'.  I think memory management is the oddest thing to get right and I'm still not sure I'm there yet.

I'm using the Cocos2D libs which I really don't like using as I inherit their own bugs and issues (and of course have to work out how they expect me to work) and it kinda masks the true iOS stuff, especially memory management.

It's allowed me to release my first game though.  I'm not sure how many people knew me from ps2yabasic days, but I rewrote my Gemocide game for the iOS and it's now on the App Store (yippee!).  It just needs to sell now, something it's not doing :(

I really want to drop Cocos2D as fast as possible and I'm aiming to go native for the next thing I release.  I want to do some old school effects inside the next game, just because I can ;)

Challenge Trophies Won:

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #13 on: January 10, 2011 »
I just checked it out on the iStore and it looks like fun, I'll boost your sales by 1 tonight when I get home :)

For anyone else interested, I assume this is the game...
http://itunes.apple.com/au/app/gemocide/id409354119?mt=8

Offline boogop

  • C= 64
  • **
  • Posts: 73
  • Karma: 42
    • View Profile
Re: iPhone Demo
« Reply #14 on: January 12, 2011 »
Anyone thinking about getting into democoding for the iPhone--Verizon is about to offer the iPhone. So in addition to the installed base on ATT, you've now got Verizon's market. This represents an installed base of MILLIONS who need to be exposed to the demoscene!
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: iPhone Demo
« Reply #15 on: January 13, 2011 »
I just checked it out on the iStore and it looks like fun, I'll boost your sales by 1 tonight when I get home :)

For anyone else interested, I assume this is the game...
http://itunes.apple.com/au/app/gemocide/id409354119?mt=8

Yay, you might have just pushed the sales into double figures :)

You'll have to let me know what you think of it, both from the side of fun and challenges, and from the side of code/game critique :)

Unless you've already seen the link, there is a supporting website and forum at www.gemocideapp.com.
Challenge Trophies Won:

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #16 on: January 14, 2011 »
I haven't had a chance to get too far into it yet, I've done at most ~20 levels, and my initial impressions are all good :)

I like the ability to combine gems together to create other gems, I don't remember doing that in any similar games before and really boosts the strategy level.

My favourite thing about the game so far is that it just feels like an iPhone game (I'm not a fan of games that use virtual dpads, I much prefer games that use the devices tilt / touch).

The controls work smooth and are intuitive.  I didn't look at any kind of instruction and the easy controls and level progression was enough to get me up and running.

Good job!

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: iPhone Demo
« Reply #17 on: January 14, 2011 »
I haven't had a chance to get too far into it yet, I've done at most ~20 levels, and my initial impressions are all good :)

I like the ability to combine gems together to create other gems, I don't remember doing that in any similar games before and really boosts the strategy level.

My favourite thing about the game so far is that it just feels like an iPhone game (I'm not a fan of games that use virtual dpads, I much prefer games that use the devices tilt / touch).

The controls work smooth and are intuitive.  I didn't look at any kind of instruction and the easy controls and level progression was enough to get me up and running.

Good job!

I'm pleased it's working well for you :)

One of the things about the game is that there is rarely only one correct solution because of the gem combining and I think that's one of the strengths.  It's easy to get stuck in a particular solution using certain/favourite gems and not see another one using different combinations.  That might cause some difficulties on later levels ;)

I'm not sure if you've seen it yet, but as well as the 120 core levels, there is a section for 240 of your own custom levels (or your friend's levels, or level challenges we post on the forum, etc. ) and this is where the game should go viral.... one day :(

OOh, if you've worked through about 20 levels, have you unlocked a new graphical theme yet?
Challenge Trophies Won:

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: iPhone Demo
« Reply #18 on: January 15, 2011 »
I haven't seen a new graphical theme yet, I've completed the Basic 1 and Basic 2 sections.

I did read about the custom levels after I'd finished playing which sounds fun :)

If you don't mind me asking, do you do the level sharing via GameCenter, or do you host a server for the sharing, or is it just over wi-fi?

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: iPhone Demo
« Reply #19 on: January 15, 2011 »
I haven't seen a new graphical theme yet, I've completed the Basic 1 and Basic 2 sections.

I did read about the custom levels after I'd finished playing which sounds fun :)

If you don't mind me asking, do you do the level sharing via GameCenter, or do you host a server for the sharing, or is it just over wi-fi?

The graphical themes are a user preference thing in options, not a sign of progression.  If you clear all of basic 1 to gold, you will unlock the latest theme.  The available themes before were if you got all basic to gold, or all intermediate to gold, etc.

I was determined that Gemocide wouldn't ever use the network to do anything (far too many games do that without asking and I've heard of people with scary phone bills because of naughty games).

In Gemocide, even if you haven't completed any of the core levels, you can select custom levels from the main menu and start designing your own levels to challenge your friends.

There are instructions in there about how to share, but essentially all you do is export the level to a photo album on the iOS device and then use whatever means you want to send the photo to a friend.  Either emailing straight from the device, plugging it into a PC and downloading the picture, syncing with iPhoto and then emailing, Gemocide really doesn't care or even get involved.

If you upload a picture to facebook, it gets messed up (awful JPEG quality conversion), but it can still be read and imported by Gemocide.  Also, and very oddly, if you get the photos into iPhoto and then synchronise back to the iOS device as a gallery, they get some blurring (again down to pointless JPEG quality drops).

To import a level, either use the iOS device to browse to a website that has one (someone's facebook where they've posted one or the gemocide forums where there is a 20 level challenge for folks to try) and just press and hold the picture to save it to the iOS device, and import into the game.
Challenge Trophies Won: