Universal Binary~Tutorial

AppTekAppTek Member Posts: 152
edited March 2012 in Working with GS (Mac)
Hi,
This method works very well for my games, and thought I should share. Now, this isn't a real universal binary, but it is setup, so that all you have to do is change the project type and publish again. So easy.Please like.

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Hmm it couldn't possibly be something like this where you set it up so that you just use this method and have some attributes you change base on the platform you are going to publish to so that anything that needs to be adjusted can auto adjust for the platform you are using could it be?

    http://forums.gamesalad.com/discussion/32594/resizing-to-ipad-technique

    BTW the "IF and ONLY IF I GET 10 likes on this post, will I post the tutorial. Please like." is so freaking lame I should just delete your post all together. This is a community of sharing. Yes there are somethings that cost money but for the most part the people who sell there time give ten times that for free with no strings attached.

    Now If your method is not basically what I have listed out in that thread then please feel free to share. But please do not set conditions on your contributions to this community.
  • AppTekAppTek Member Posts: 152
    First, add the following attributes
    WidthRatio (real)
    HeightRatio (real)
    Create a scene at the begging of the game. Call it RatioFinder. Then create a new actor, call it RatioCalculator. Put the actor in the middle of the scene. Now, you must find put the width and height of the device you really designed the game for, for example if you made it for iPad then you would 1024 in the width and 768 for the height. Then in the actor add the following rule, change attribute game.WidthRatio to game.Screen.Size.Width/(the width of the device you originally designed the game for). Then add another change attribute game.HeightRatio to game.Screen.Size.Height/(the height of the device you originally designed the game for). Then add a timer (run to completion) that changes the scene to the main scene. Now, we are going to design a custom behavior. Make a group and call it Resize in an actor of your choosing. In it add 4 change attributes.
    The configurations:
    self.size.width to self.size.width*game.WidthRatio
    self.size.height to self.size.height*game.HeightRatio
    self.position.x to self.position.x*game.WidthRatio
    self.position.y to self.position.y*game.HeightRatio.

    Make this a custom behavior. Drag it onto all of your actors and backgrounds.
  • AppTekAppTek Member Posts: 152
    edited March 2012
    I don't think it is exactly the same, what do you think.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Its similar. But honestly looks way more complicated

    See in my method you don't need to add stuff to every actor you only need to add extra rules to actors that need to maintain a specific visual dimension like Circles and Squares most others look fine even when they get a little distorted on their original dimensions. Then the only thing that goes into every scene is a camera controller that makes the camera size on the scene the size of the original project.

    Also the only expression that needs to be added to adjust the actor dimensions on anything you want adjusted is to multiply the width of Height one by 0.9 its different based on orientation and platform. For me I always go from iPhone to iPad and Nook/Fire so portrait iPad you would multiply width by 0.9 and then portrait Nook/Fire you would multiply height by 0.9 then do the opposite dimensions for Landscape orientations.

    I actually setup a few Game Attributes so I can set what resolution and platform its going to. So then all my links on the iphone version go to iphone stuff and the ipad versions go to ipad nook version goes to nook etc….. and the actors adjust their size accordingly as well.

    Then I only have do make and update to one project and I can publish a binary for every single platform out of that one project file.
  • CloudsClouds Member Posts: 1,599
    I don't think it is exactly the same, what do you think.
    Won't work for most projects, even a scrolling background or a rotating actor based on cos or sin will screw it up, but it will work fine fine static non-moving scenes with actors that don't move (ie: nothing).

  • kirk1234kirk1234 Member Posts: 93
    I would love, love, LOVE , If gamesalad added Universal Binary.
    It would make a lot of stuff easier.

    Thanks
  • LiquidGameworksLiquidGameworks Anchorage, AKMember, Sous Chef Posts: 956
    So far, I've only had to do one thing to change the device type for my games, and everything still looks great and works great.

    If I build the original game on an iPhone, I just change the camera width,height and tracking on every scene to match the iPhone dimensions. I have three files. 1 iPhone, 1 iPad, and 1 Kindle (which I use for all android). That's it. I don't add any additional actors, behaviors, or anything. I haven't had anything skew so badly that an iPad or Android user would even think its skewed. Only by comparing between devices may you see a difference, and its very slight. I've only done this with 3 games, so I can't say it'll work every time, but its all I do.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    @LiquidGameworks I Recommend placing a camera control actor into each scene with the rules to change the camera size and tracking area as well as origin if it needs to be something other than zero. The reason is when you make say an update you will again have to make your 3 files. and each time you change the platform setting it will reset all the scene camera stuff so you will have to go in an change it for every scene for each platform you are going to publish to.
  • BBEnkBBEnk Member Posts: 1,764
    How do you guys handle collision area on Circles I noticed on a game I was using this technique on that the circles would change from 32x32 to 32x28.8 with the added change attribute of 0.9 so the collision area was only 28.8 but the circle looked round but its not really so you get overlap on the image, I got around this problem by just making the camera 480x360 that way the Balls stayed the correct 32x32 and round and no need for the change attribute on any actors and just hid the extra space above with pause and home button and extra graphics.
  • 3xL3xL Member Posts: 676
    edited March 2012
    i just adjust the camera for my games. thats it. obviously change the platform to Iphone/ipad, but after that i make some camera adjustments. but thats just me
  • Holderness_Media_IncHolderness_Media_Inc Member Posts: 118
    edited March 2012
    This isn't a new technique, I posted this awhile back when myself, @tenrdrmer and @bradherman posted how to do variations on this back in these original threads that inspired tenrdrms technique, and was referenced in tenrdrmr's first post in this thread. The first thread has been deleted for some reason.

    Tenrdrmer's technique
    http://forums.gamesalad.com/discussion/32594/resizing-to-ipad-technique

    My link:
    http://forums.gamesalad.com/discussion/32546

    My technique uses game.Display.Width and game.Display.Height to auto-scale to screen size, combined with bradherman's technique for scaling actors and position.
    Once you have it setup, it's really easy and worked well. It essentially worked exactly like how the GS viewer seems to handle previewing apps on your iPhone projects on an iPad. The GS viewer scales everything up, and it works like a universal app, it just doesn't do the automatic graphics scaling. That can be handled easily with a few attributes to scale based on "if iPad" using @bradherman technique.
    It's not at all difficult to implement, though some claim it doesn't work for all types of games. I haven't had any issues yet, but that may be because my instrument apps are more simple than a more complex and in-depth game.

    Unfortunately, I just discovered that it appears GS has closed this option with 0.9.91, if I create a new project it won't work, but my old ones still do. It's frustrating as I was getting used to easily bouncing between iPad/iPhone with my technique.
    I believe it is related to this post: http://forums.gamesalad.com/discussion/37897/change-regarding-scene-attributes-in-custom-behaviors

    So it seems the best strategy is to use tenrdrmers technique until GS opens this option up again in the next Creator update, or gives us real Universal Support.

    Edit: Fixed your Link. It was not deleted just on the old URL format. -tenrdrmer
Sign In or Register to comment.