Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - tokyotron

Pages: [1]
I finished a Flixel iOS game last year. (made it for a client)

江頭2:50の 42.195km ~流石の俺も四苦八苦~

It uses Game Center, and also retina graphics for retina displays. Nothing very complicated, but it was my first game in like forever.
Maybe the coolest thing was the map editor, which was another binary/app really made for iPad. In our team, we used the iPad to make the level - the levels themselves synced automatically to the iPhone game app through iCloud. At the time of release, I just removed all of the iCloud code from the game. :-P It had a really WYSIWYG touch interface and at least I loved it. But had to kill it. :-P The game was released for the Japanese market, not sure now if it's available outside Japan App store or not.

iOS / Black screen at launch time
« on: Thu, Jul 26, 2012 »
I guess there aren't really anyone around here anymore. But I've got this irritating problem and just because...

The flow of starting an iOS app is basically

[user taps app icon] -> [launch pic displays] -> [first controller view displays]

No gaps anywhere...

Now with Flixel iOS it kind of looks like this

[user taps app icon] -> [launch pic displays] -> (black screen) -> [first state view displays]

There seems to be no way (that I know of yet...) to get rid of that first black screen. I get the feeling that Flixel initiates the game engine openGL stuff and directly puts that first empty buffer to the screen, then goes on to load/cache the first state, and only when that is done the state's contents are drawn to screen. If you've got a lot of stuff in that first state, that could take a while, resulting in a long black screen... I tried stripping down the first state to only show like one picture, but there is still a noticable black screen appearing for like 1/100th second or something.

Going to other states after the initial state however renders no black screen AFAIK.

Any ideas?

iOS / "Auto" playing
« on: Wed, Jul 11, 2012 »
This turned out to be more complicated (to me) than I first thought it would be.

I'm wanting to implement a scripted "CPU player" playing the game by itself... Kind of like those arcade games in the 80s where the game played by itself and with the "Insert coin to start play!" message on top. Some ideas I had:

* As the character's movement is controlled by FlxG.touches being in different states at different times (FlxG.touches are probably handled in the FlxGame->update function) , I thought about building something that stores and injects these touches. The problem is, I wouldn't be able to get it exact... there would be timing issues. I think. At least a few milliseconds could be off, and that's enough to make this not work as intended - impossible to script and replay something like a "power play".. etc.

* Store every full screen as a complete frame, and playback those frames as a movie. Problem: Not sure yet how to really store frames :-P Shouldn't be impossible though. However several minutes of frames would be huge (think 30 (or 60?) frames/second) for one or several minutes. Not sure this would work with memory issues, loading times, etc even - changing a FlxSprite the whole size of the screen 30/60 times a second... hmm I'm not sure this port was engineered to do that.

Anyone did something like this before? Got any ideas?

iOS / Performance
« on: Thu, Jul 5, 2012 »
Anyone got anything to say about Performance?

Ie you make a game, and after awhile

* things start going slow, like you get low FPS (there's an easy way to turn on FPS output to console)
* you just wanna get a general hunch where your game spends most of the time

Well a quick googling turned up this page for Cocos2d, another game engine, but I guess a lot of that can be applied with iFlixel as well.

At least the part about Instruments seem useful - using "Time Sampler" within Instruments. With Cocos2d there is supposedly a "CCDirector mainLoop" being the main loop of the game... Of course we have a similar thing in iFlixel as well, but it's named differently. I guess it's simply "FlxGame update". I guess the general idea is to dig down there and see where most of time is spent. Lots of time spent would mean a bottleneck and supposedly where optimization work should start.

iOS / The template
« on: Tue, May 15, 2012 »
So this great template...

Works great with Xcode 4. But it's just that if you upgrade to recommended settings, Xcode suggest to upgrade to the latest compiler and doing that gives heaps of warnings. I've cleared up all those warnings. Doesn't give a problem with or without those warnings, nor with the newer compiler, afaik. If anyone has run into problems (or would know of any) in doing this, please let me know. Or I might fork this "fix" to github eventually.

iOS / Sound effects
« on: Tue, May 15, 2012 »
Anyone know the reason why the sound effects are played using OA and not for instance AV Foundation?

iOS / Canabalt's HUD class
« on: Thu, May 10, 2012 »
Hello. I am trying to find out how the HUD class works. The HUD class is what draws the always increasing distance in Canabalt game to the upper right corner.
It uses a small "font" (hud.png) and finds out the correct texture coords in order for opengl to draw, I guess this class is made because of optimization, otherwise you'd use the text features from the engine (?)

Specifically what I cannot understand is:

Code: [Select]
//then digits
for (int i = 0; i < DIGITS; ++i) {
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-4] = (GLshort)(width-runningWidth);
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-3] = (GLshort)(hudTexture.size.height);
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-8] = (GLshort)(width-runningWidth);
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-7] = 0;
runningWidth += digitWidths[DIGITS-1-i];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-12] = (GLshort)(width-runningWidth);
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-11] = (GLshort)(hudTexture.size.height);
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-16] = (GLshort)(width-runningWidth);
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-15] = 0;
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-2] = [FlxGLView convertToShort:(hudOffsets[digits[i]+1]/hudTexture.paddedSize.width)];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-1] = [FlxGLView convertToShort:(hudTexture.size.height/hudTexture.paddedSize.height)];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-6] = [FlxGLView convertToShort:(hudOffsets[digits[i]+1]/hudTexture.paddedSize.width)];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-5] = [FlxGLView convertToShort:(0)];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-10] = [FlxGLView convertToShort:(hudOffsets[digits[i]]/hudTexture.paddedSize.width)];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-9] = [FlxGLView convertToShort:(hudTexture.size.height/hudTexture.paddedSize.height)];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-14] = [FlxGLView convertToShort:(hudOffsets[digits[i]]/hudTexture.paddedSize.width)];
hudVerticesUVs[VERTEX_COUNT*4-(i+1)*16-13] = [FlxGLView convertToShort:(0)];

I can understand the right hand size values - these would be the origins in pairs x, then y, then next x,y and so on...
However the left hand side VERTEX_COUNT*4-(i+1)*16-4 etc... anyone got a good explanation of that?

iOS / Retina / high res textures
« on: Wed, May 9, 2012 »
Did anyone try using high res graphics for retina displays?

How do you do it properly?
I'm in the process trying to find out the above. Use retina textures for retina displays. Standard textures for standard displays.
I think I've gotten FlxSprites working by now, still FlxTileblocks render too big on retina displays... so. If anyone knows of any working examples?

Like someone else noted in a post here, I set useTextureBufferZoom to NO when initing the FlxGame. And for retina displays, set zoom to 2.0 (actually I use device scale from UIScreen if it exists, otherwise 1.0 for backways comp.). This is what seems to fix things for FlxSprites. Still FlxTileblocks seem to draw things on their own and I guess they don't really care about those zoom parameters. And I'll likely need the FlxTileblocks for performance reasons...

Oh and hello this is my first post in this forum. I'll be sticking around for awhile I guess. I'm an iOS developer, but so far made only Cocoa Touch / native apps, and have only temporary experience from OpenGL and that's around 10 years ago.

Pages: [1]