Hacking Universal Binaries
Photics
Member Posts: 4,172
I've been thinking of ways for GameSalad to add powerful features, but without adding a lot of work. I've been thinking about Universal Binaries, as it seems like something that could significantly improve GameSalad development, but maybe a minimal amount of work is required.
When I make iPad apps with GameSalad, I can test them on my iPhone 4. The resolutions are not that far apart...
1024x768 vs. 960x640
As far as the memory is concerned, they're both thrown into 1024x1024 containers - powers of 2. So, we're treating two iOS devices separately, when they're really the same. I also realized this with the desktop. GameSalad games can scale.
The big issue is if you touch the screen. It doesn't know how to adjust.
I've been wondering if this is something that we could do ourselves... without the assistance of the GameSalad team.
1) What if we figured out how to adjust for the touch offset mathematically?
2) What if we messed around with the info.plist, changing it to a universal binary, would it still work?
I'm throwing the idea out there to inspire collaboration. Perhaps if we all start to think about ideas like this, we can push GameSalad further than it is now.
When I make iPad apps with GameSalad, I can test them on my iPhone 4. The resolutions are not that far apart...
1024x768 vs. 960x640
As far as the memory is concerned, they're both thrown into 1024x1024 containers - powers of 2. So, we're treating two iOS devices separately, when they're really the same. I also realized this with the desktop. GameSalad games can scale.
The big issue is if you touch the screen. It doesn't know how to adjust.
I've been wondering if this is something that we could do ourselves... without the assistance of the GameSalad team.
1) What if we figured out how to adjust for the touch offset mathematically?
2) What if we messed around with the info.plist, changing it to a universal binary, would it still work?
I'm throwing the idea out there to inspire collaboration. Perhaps if we all start to think about ideas like this, we can push GameSalad further than it is now.
Comments
The first post in this thread is about recreating the same method that I used for my book app. Basically, the game would change to fit the window. I don't think that's too hard if the camera could scale and the touch points were sensitive to the new screen size. (You can see the problem if you test an iPad game on the iPhone, by using the GameSalad viewer. I'm thinking that if you offset the touch points, based on screen size, you can make a universal binary.)
However, the ratio isn't perfect. We might not want to stretch the graphics. So, what's another solution?
Scenes!
I think this would be another easiest way to resolve the matter. If a GameSalad game is run on an iPhone/iPod Touch, it would run scenes 2-5. If it's run on an iPad, it would run scenes 6-9. Scene one would be a device detector. If an iPhone is detected, it would go to the first iPhone/iPod scene. If it's an iPad, it would go to the first iPad scene.
If we can create custom scenes for each device, we could create a universal binary. Since Retina Display graphics are of high enough quality for the iPad, assets could be reused. That would keep the file size down.
This could also be expanded. (This is something you can do right now.) You could create a low-res option, for older devices. That would keep the game from crashing. Scenes 1-5 high performance. 6-10 low-performance.
So basically, to make the second option work, GameSalad would need a way to customize scenes. Right now, you choose a scene size for the whole project. If you could do that on the scene level, GameSalad could be expanded to include universal binary support.
Ace
A touch at X=1 and Y=1 should work fine. The problem is when you move away from origin.
If you touch the screen at X=300 and Y=400 on a GameSalad iPad game running on the iPhone GS Viewer, it thinks the touch is further away. This can be offset by using an invisible actor, that moves based on the touch and screen sizes. It's a kludge, so GameSalad should automatically adjust for the difference.
That way, a universal binary could be created. The game size would simply scale and stretch to fit the iOS device.
I think the scene solution is more elegant.