v1.5 Preview 2 Available
by Michael Perry · in iTorque 2D · 07/26/2011 (2:28 pm) · 54 replies

Official Release Blog
How 'Preview Releases' Work for 1.5
As many of you have figured out by now, we've decided to release multiple previews of iTorque 1.5. "Preview Releases" give you a snapshot of where we are in development, and a window into where we are going (hint: Universal App and Retina Display support).That being said, Preview Releases will not be fully documented, and will include bugs. Updated documentation and a full QA cycle to stamp out bugs will not occur until we are ready to release the FINAL version of iTorque 1.5.
Preview 2 Details
The scope and resource availability for Preview 2 was higher than the previous. The focus of this build was to improve the input system for iTorque 2D. Back in March, I created one of my lengthiest threads to date, titled Improved Input and Gestures. Part R&D and part community polling, this thread and my IRC discussions were invaluable to completing the second preview. Theory turned to code in this post.The goal of this preview can be boiled down to the following:
1. Improve usability
2. Remove limitations of current touch tracking
3. Extend input features to provide all basic data provided by the iOS SDK
ActionMap
Gone are the days of "you must use" and "you can't use". oniPhoneTouchDown/Up/Move are gone, as there is not a reason you (the developer) should be limited. Define your functions however you want. In fact, make as many functions as you want, one for each level if you need:
Separate ActionMap declarations:
new ActionMap(menuActionMap); menuActionMap.bind(touchdevice, touchdown, "menuTouchDown"); menuActionMap.bind(touchdevice, touchmove, "menuTouchMove"); menuActionMap.bind(touchdevice, touchup, "menuTouchUp"); new ActionMap(gameActionMap); gameActionMap.bind(touchdevice, touchdown, "gameTouchDown"); gameActionMap.bind(touchdevice, touchmove, "gameTouchMove"); gameActionMap.bind(touchdevice, touchup, "gameTouchUp");
Push and pop
function onMenuStart()
{
menuActionMap.push();
}
function startGame()
{
menuActionMap.pop();
gameActionMap.push();
}Example function parameters
function gameTouchDown(%touchIDs, %touchesX, %touchesY)
{
echo("Entered touch down function");
// How many fingers are down
%numTouches = getWordCount( %touchIDs );
// Loop through each finger and print its coordinates
for(%count = 0; %count < %numTouches; %count++)
{
// Finger ID
%curTouch = getWord( %touchIDs, %count );
// X screen coordinate
%curX = getWord( %touchesX, %count );
// Y screen coordinate
%curY = getWord( %touchesY , %count );
// World position
%worldPos = sceneWindow2D.getWorldPoint(%curX, %curY);
// Print results
echo("Scanning touch " @ curTouch @ " at " @ %worldPos);
}
}Improved Motion System
One of the owners pushed for supporting Gyroscope. This was the catalyst for getting the ActionMap system back on track, as well as improving existing Accelerometer functionality. 1.5 has replaced UIAccelerometer with CoreMotion, which is a lot cleaner and more powerful. Again, the devices are exposed via ActionMap. Because the motion devices are sensitive, examples of how to use a dead zone are provided.
enableGyroscope();
// In landscape, pitching means tilting the device left and right
moveMap.bind(gyroscope, pitch, "D", "-0.1 0.1", "pitchFunction");
// In landscape, rolling is tilting the device toward and away from the user
moveMap.bind(gyroscope, roll, "D", "-0.1 0.1", "rollFunction");
// In landscape, rolling is tilting the device toward and away from the user
moveMap.bind(gyroscope, roll, "D", "-0.1 0.1", "yawFunction");
// Toggle accelerometer processing
enableAccelerometer();
// In landscape, react to gravity when tilting left to right
moveMap.bind(accelerometer, gravityx, "D", "-0.2 0.2", "gravityXFunction");
// In landscape, react to gravity when tilting toward and away from the user
moveMap.bind(accelerometer, gravityy, "D", "-0.2 0.2", "gravityYFunction");onTouch Callbacks
Short and simple (with a lot hidden under the hood), onMouse callbacks have been replaced with onTouch:
// This callback is invoked when the cloud is touched
function Cloud::onTouchDown(%this, %touchID, %worldPos)
{
}
// This callback is invoked when a finger is lifted off the cloud
function Cloud::onTouchUp(%this, %touchID, %worldPos)
{
}
// This callback is invoked when a finger drags across the cloud
function Cloud::onTouchDragged(%this, %touchID, %worldPos)
{
}Fixes
Some extremely annoying bugs cropped up between 1.4.1 and 1.5 Preview 1. While bug fixing is not the goal of these previews, some were detrimental to the focus of this release. In addition to the fixes, the longstanding mystery of particle corruption has been SOLVED!
- GameCenterManager dealloc code switched to release. This should resolve the crash and memory problems related to this module
- ITGB-126 Extra common/commonConfig.xml being created during project creation
- ITGB-142 Minor editor bugs
- - Editor correctly writes and reads preference files from AppData/Roaming/GarageGames
- - Editor correctly loads config settings for projects
- - Editor no longer resizes when opening or creating new projects
- - Opening a project from inside of the editor no longer returns to the main screen. The project actually opens now
- - Level datablocks allow for multi-selection and removal
- ITGB-144 Particle File Corruption
- - Longstanding issue finally explained in this thread: http://www.garagegames.com/community/forums/viewthread/126104
- - Short term solution provided here: http://www.garagegames.com/community/forums/viewthread/126104/1#comment-809786
Known Issues
Even though we are not focusing on bug fixes for the first couple of previews, we are tracking them. This list will shrink and grow during the previews, but we know it's helpful for you have access to this information:
- New Accelerometer and Gyroscope bindings only work on iPod Touch 4th gen and iPhone 4. This was just discovered and a solution is being worked on for the final release
- Not all demos and docs reflect the improved input system. This will be resolved for the final release. For now, you can look at RainyDay or create a project using Empty template. These have the improved input examples
- Broken simulator targets/schemes snuck back in due to a merge error. These will be removed again for the final release
- dealloc used in MoviePlayer code. Should be [self release]. This will be fixed in the final
- iPad rotation issue not fully resolved
- GameCenterTest requires modification to run. You must use your own provision profile and iTunes Connect information
- ITGB-115 Closing the GUI Editor does not close GUIs being edited
- ITGB-116 GuiButtonCtrls are rendered as black in their up state
- ITGB-120 Calling Canvas.popDialog() pop the mainScreenGui on devices and simulator
- ITGB-122 Varied behavior with different Gui Controls
- ITGB-123 Gui Editor Inspector does not auto update when adding a new control
- ITGB-129 iTorque2DGame.app is not added to the projectfiles when a project is created on Windows
- ITGB-131 Load last scene on startup checkbox is being ignored
- ITGB-134 Odd image map behavior
- ITGB-136 Does not remember Layer Management Settings
- ITGB-138 Major distortion when resizing an object that has been rotated
- ITGB-139 Crash when creating a new image map from BMP
- ITGB-141 Orientation change happens at incorrect angles
- ITGB-147 Mount Broken During Copy Paste
- ITGB-148 Minor editor visual issue
- ITGB-149 SourceRect malfunction
- ITGB-152 Undo after Deleting Breaks Mounts
- ITGB-153 Locked objects not excluded with t2dSceneWindow::sendObjectMouseEvent
- ITGB-159 RealMilliseconds/getRealTime bug
About the author
Programmer.
#42
07/30/2011 (8:30 am)
Yup, we hashed that out a few minutes ago in IRC. I'm rewriting the code and having Conor test it for me. If it works, I will have the working code ready for the next release.
#43
The final code will probably move gravity into the gyroscope device, leaving only acceleration for the accelerometer device. The correct handler polling will go into affect based on device capabilities.
07/30/2011 (9:01 am)
Conor just confirmed the new code works, so I just need to change a few things around to get the fallbacks in place. Sorry about the logic problem everyone. I misread the docs and was mainly working from the header file comments for the CMMotionManager, which did not explicitly state deviceMotionAvailable depended on a gyro as well.The final code will probably move gravity into the gyroscope device, leaving only acceleration for the accelerometer device. The correct handler polling will go into affect based on device capabilities.
#44
07/30/2011 (1:38 pm)
This is what Preview releases are all about ;-)
#45
07/30/2011 (1:41 pm)
@Erik - My thoughts exactly. 1.5 is a pretty big release, so getting these small chunks out to the public early is invaluable to the development.
#46
08/01/2011 (9:22 am)
Where can I find some documentation about how to use GameCenter with iTGB 1.5p2?
#47
08/01/2011 (9:32 am)
@Andrea - The docs have not been finished yet. I can send you the preliminary one, but we are not doing a full doc or QA pass until beta.
#48
08/01/2011 (3:46 pm)
@mich: thank you Mich, I think I can wait the official doc. Thank you, I think you're the best here at GG
#49
08/01/2011 (3:58 pm)
Haha. Thanks Andrea. I'm very happy to help out, but there's not a best at GG. We all put forth the extra effort to make the best product/experience we can provide =)
#50
08/19/2011 (8:38 am)
What about the collision system? any improvements ? after the particle system, the collision system is next headache.
#51
08/19/2011 (9:06 am)
@Kevin - There are no big changes for the two systems in 1.5. If there are specific bugs related to collision or particles, there is a good chance they are being addressed.
#52
In this post and follow-ups I'll add items to do when porting from 1.7.4 to 1.5 (Preview 2)
Steps:
1) Create a new project
2) Include all the files from a 1.7.4 project
I'll use this as test
Torque Minimal Template
Issues found
1) onMouseUp is not responding
NOTE: More to follow :-)
08/27/2011 (4:24 pm)
v1.7.4 to v1.5 Transition Guide
In this post and follow-ups I'll add items to do when porting from 1.7.4 to 1.5 (Preview 2)
Steps:
1) Create a new project
2) Include all the files from a 1.7.4 project
I'll use this as test
Torque Minimal Template
Issues found
1) onMouseUp is not responding
NOTE: More to follow :-)
#53
09/28/2011 (3:11 am)
@pedro, a common part of upgrading for pretty much everyone i imagine will be the changing of onMouseXX events to onTouchXX events, or making use of new 1.5 interface possibilities
Torque Owner Paul Jan
The reason motionManager.deviceMotionAvailable returns false is because it checks for the presence of an accelerometer and a gyroscope (missing in previous generations of iPhones/iPads).
http://developer.apple.com/library/ios/#DOCUMENTATION/CoreMotion/Reference/CMMotionManager_Class/Reference/Reference.html#//apple_ref/occ/cl/CMMotionManager
The workaround is to use startAccelerometerUpdates instead of the MotionManager.