Re: Resolution adjustment
I'd just like some clarification how the scaling up/down works for iPhone apps with MMF2 between 480x320 and 960x640 (iPhone 4), or how it is planned to work.
Natively if an app is made at 480x320 (i.e. before iOS 4.0 was released) then on an iPhone 4 they will automatically upscale with no special coding required.
However if a game is made at a higher resolution, how is an iPhone 3/3GS going to handle this? As BHGames quoted, it seems MMF2 creates two version of the images when it saves the project. I'd like to know how this actually works.
If you create an app at 960x640, and a 32x32 pixel sprite. Then does that mean when you try to run the game on a 3GS, MMF will have downscaled your sprite to 16x16? There would have been a large loss of quality there. And for the reverse, 3GS > 4, the scaling is automatic, so if you made your game at 480x320, then you don't need the iPhone 4 resolution images anyway?
Re: Resolution adjustment
Do you mean icon@2 and default@2 images? they are only used in iPhone 4 desktop and springboard. I think your graphics are embedded in the .cci
If MMF is able to dynamically downscale an iPhone4 resolution in a iPhone3 phone, that would be cool, but probably a pain to optimize, depending on the amount of hires graphics, it will take more unusable space in old phones.
I think you should stick to 320x480 for now... it is easier for a new phone to upscale an old resolution, than an old phone to manage higher resolution graphics.... and again, your game will end up wasting valuable resources in an old phone and making them work harder (dynamically downscale? or take some time while downscale all graphics before start app?.. etc)
Of course, all this depends on how ClickTeam implement the engine on iPhone.
I know they always do their magic, let see :)
Re: Resolution adjustment
I didn't know about the default@2 images, so I did a bit of searching and it seems that:
"Apple has introduced a simple naming convention to allow image files at double the resolution to be loaded when the display will support it. To make use of this feature you need to go back to your original image files and create versions at twice the existing size. So if you have an image that is currently 100x100 pixels named myImage.png you need to create a new version which is 200x200 pixels named myImage@2x.png."
So what I am strongly suggesting is that when we make iPhone 4 apps, we are able to supply the @2x images ourselves. I don't know how this would work with the MMF actives. Perhaps we could specially name the animations?
E.g. we could have "Stopped" and "Walking" for 3GS. Then when you want to make the iPhone 4 resolution ones, you additionally create "Stopped_2x" and "Walking_2x" animations with double the resolution, which MMF automatically recognizes and uses instead of the original ones.
The other thing that needs to be accomodated is that all positioning events would need to refer to 'half' their original position in events such as "set x position to 100" > "set x position to 50". It wouldn't be foolproof, but since the 'Clone Application' is able to handle something similiar to this, it might be a possibility, but I understand that some events which calculate position probably wouldn't work well.
Another option would be to let us just clone the frames with different resolutions and use the appropriate one. Then again, that's double the amount of code to maintain, which makes things really difficult when you find bugs.
So here's a solution which I think might work, it's a hybrid of both ideas:
1. Make MMF choose "2x" animations as described above when using iPhone 4, and normal animations when using 3/3GS
2. Allow us to retrieve a value/flag which tells us the resolution of the screen. This way we can modify the positions of our game objects depending on the resolution.
But then there's still the problem of which frame resolution you actually make your game in. We'd still probably need to duplicate frames somewhere?
And yes, it would be easier to make all apps at 320x480 and just let the iPhone 4 upscale them, but if you've used an iPhone 4 you can tell when an app is running at lower resolution, because it looks worse. It is really quite noticeable. And as you said, automatically downscaling iPhone 4 apps to iPhone 3 resolution isn't a great idea because it uses a lot of processing power unnecessarily - you're running a more intensive app on a slower processor.
So I'm interested to hear any thoughts about how this issue is going to be dealt with. :)
Re: Resolution adjustment
that's not quite the way it works... to clarify, 1 iPhone2/3 pixel = 1x1 point, on the iPhone4 that same point = 2x2 pixels, if you are running an application which is designed to run on both.
The pixel coordinates in this instance do not need to be halved/doubled, iOS4 deals with this for you. If you have provided @2x graphics, it will simply place those and give double the detail level on the images.
Basically, MMF would need to be able to provide a set of @2x graphics for every image in you application.
You can however design apps at a higher point density which will only work on the iPhone4 (or iPad I guess) and it is possible so scale movements in an app to take advantage of the different screen resolutions on which it is run - but I'm not sure if/how MMF could achieve that as is.
This does seem to be something which needs addressing because the iTunes app store is not really geared up for selling different versions of an app for different devices in terms of marketing, featured apps etc.
Re: Resolution adjustment
Thanks for clarifying SToP_GAP! So my understand of what you just said is that on the iPhone 4, even though there are twice as many pixels, there are still the same amount of 'points' or 'positions' in an app? I don't think the libraries/frameworks I have used before work like that, but that's why I'm suggesting it would be good if MMF does.
It is my current understanding that this is how positioning works, for the following code:
Active.X = Active.X + 20
And you run that on an iPhone 4 and a 3GS, I would expect that on the iPhone 4, the active would be set to '5' on both devices. Meaning that on the iPhone 4, on the first frame your sprite will be at
x position = 20 (out of 960)
and on the 3GS
x position = 20 (out of 480)
Then on the next frame:
x position = 40 (out of 960)
and on the 3GS
x position = 40 (out of 480)
Which as you can see, even if the image size is doubled, the positioning is still wrong due to the code.
I don't know how this works, which is why I am asking.
But are you saying that if we simply supply the @2x images, then iOS4 will convert these positions into the proper ones? That is to say, are we supposed to design our games all at 480x320 and iOS4 handles the repositioning for iPhone 4? This has not been my experience so far, but as I said before, I am still not completely sure how it works.
Re: Resolution adjustment
yeah, the point system and scaling up like that only works if your application is running at the original iPhone size, which is 320x480 pixels... that is equal to 320x480 points on an iPhone 3/4.
If you design an application for the iPhone 4 specifically, that is then 640x960 points (and will display as 1 pixel per point). This will not then work on the iPhone3 which has a maximum resolution in points of 320x480.
iOS4 does indeed do all the scaling if the @2x graphics are provided as resources that it can identify, but from what Andos and Yves said to me, the runtime is using an internal image format which does not register image resources in the XCODE project.
Unless they have changed that, CT will have to emulate this behaviour themselves as the automatic systems in iOS4 won't pick up on it, and the only way around will be to provide 2 different versions of the application to achieve the higher definition images on the iPhone 4 and iPhone 3 and older compatibility.
Re: Resolution adjustment
I see! What you described is much better. If we can design all our applications at 320x480 and be allowed to include the @2x graphics then that will be awesome :)
But that makes me wonder why we can choose the 640x960 screen resolution at all?
Re: Resolution adjustment
Well, because the screens on the iPhone 3/4 are roughly the same physical size (measured corner to corner that is), the iPhone 4 has a much sharper detail level. When it is displaying a 320x480 points image it simply uses 4 pixels (2x2) for every point, so you will see no real difference in physical size of the point than if you were seeing it on an iPhone 3 or earlier.
If you include @2x graphics, you can make your images twice as detailed and provide really lovely rich images to take advantage of the stunning quality of the "retina" display of the iPhone 4. There's no other reason really, it just affords you the opportunity to add a real and perceptible extra level of quality to your game's visuals.
Re: Resolution adjustment
Re: Resolution adjustment
If you think iPhone's two resolutions is challenging, wait and see when you start develop for Android ;)
My first build of MMF on iPhone was a screensaver that dynamically re-position graphics depending on physical screen area.
I don't know if this will be fully supported with MMF for iPhone... it should work if you can get the real phone resolution when you request the Frame Width/Frame Height at start of frame and do your calculation based on this. But of course it depends of the type of game. A pre-made level of a Mario-like game will be a time-consuming task to dynamically re-position and re-scale all the game's object at start of frame.