Game Development Community

v1.5 Preview 2 Available

by Michael Perry · in iTorque 2D · 07/26/2011 (2:28 pm) · 54 replies

img844.imageshack.us/img844/4382/headerblogitorque2d.jpg

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
Page «Previous 1 2 3 Last »
#1
07/26/2011 (3:48 pm)
YES! I'm liking the new input system. Awesome!
#2
07/26/2011 (4:44 pm)
Glad you like it =)
#3
07/27/2011 (10:07 am)
Binding touch input to actionmaps is a really useful feature which I hadn't even thought of. This will make my code much simpler!
#4
07/27/2011 (11:26 pm)
Tested this - it builds and runs but I'm not getting touch or tilt input to respond on the device.

game.cs:
new ActionMap(gameActionMap);   
gameActionMap.push();
   
enableAccelerometer();
gameActionMap.bind(accelerometer, gravityx, "D", "-0.1 0.1", "tiltX");
gameActionMap.bind(accelerometer, gravityy, "D", "-0.1 0.1", "tiltY");
gameActionMap.bind(touchdevice, touchdown, "pressedScreenInGame");

And my response functions:
function tiltX(%val)
{
	echo("Tilt X" SPC %val);
}

function pressedScreenInGame(%touchIDs, %touchesX, %touchesY)
{
	echo("pressed screen in-game");
}

None of the echoes appear. I assume the "D" in the accelerometer header is for "deadzone"? Also, do the tilt functions pass in a %val as before? Is there something in the editor I need to check to enable input?
#5
07/27/2011 (11:34 pm)
UPDATE - Turning on 'MultiTouch Support' in the editor made the touch callback work. If this is required for touchdevice functions then perhaps it should be on by default.

Also, I get an error when I tap the screen quickly...

oniPhoneTouchTap: Unknown command.

#6
07/28/2011 (1:04 am)
When I try to run a new project on my iPod touch 3G I get an error "game/scripts/game.cs (69): Unable to find function enableAccelerometer".

P.S. MultiTouch Support is enabled.
#7
07/28/2011 (6:21 am)
@Conor - I'm going to eliminate the multi-touch macro. There's no point to it anymore, so it will be on always. I removed the oniPhoneTouchTap script function from the templates temporarily. If you need it immediately, you just need to copy over the function from a previous build's project.

@Sysrat and Conor - Can you make sure that you have the iOSMotionManager.h/.mm files. That is where the accelerometer code exists now. Check to make sure it compiles in and you can get into the ConsoleFunctions in that source.

I believe the problem is that I did not change the templates to include those source files. If you add them to your project, the motion code should work.
#8
07/28/2011 (7:20 am)
Mich - I get a build error after adding the iOSMotionManager files:

Undefined symbols for architecture armv6:
  "_OBJC_CLASS_$_CMMotionManager", referenced from:
      objc-class-ref in iOSMotionManager.o

When trying to run on an iPad Touch 2nd gen.

and

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_CMMotionManager", referenced from:
      objc-class-ref in iOSMotionManager.o

When building for iPhone 3GS on ARM7 Architecture optimized.

About the touch input - I agree you should take out the 'Multitouch support' option and take out the oniPhoneTouchTap callback, since all touch input is handled by the new system.

#9
07/28/2011 (8:08 am)
@Conor - Ok, so the new motion code uses CoreMotion, which is only supported on devices with a 4.0 OS or higher.

For the final, I will have a fallback in place for people who want to use the old accelerometer code. However, I know Apple will be deprecating that in the near future.
#10
07/28/2011 (1:11 pm)
Hey guys. Forgive my enthusiasm - just wanted to stop by and say hi - I just picked up iTorque2D. Finally. So that it can steal the remaining of my scarce spare time. :)

Also, I looked around before deciding on what to work with - and this really is the best choice for 2D iOS apps. I'm impressed!

And Mitch, I'm reading the docs! That was my first - natural - thing to do. How cool is that? :)
#11
07/28/2011 (1:56 pm)
@Konrad - Wow! Thanks for the uplifting words =). I hope you enjoy working with the engine as much as I love improving it.

Quote:And Mitch, I'm reading the docs! That was my first - natural - thing to do. How cool is that? :)

I'm so happy
img585.imageshack.us/img585/1559/tearsofjoy.jpg
Oh! Shameless request. Think you can repost your message on our blog? I'd like others to see it (especially potential buyers).
#12
07/28/2011 (2:16 pm)
Hey Konrad, glad to see you here!
Welcome to the iT2D :) I'm new here too.. Haven't found time to do anything thou :(
But I'm too really impressive from this engine and what Mich is doing!
#13
07/28/2011 (2:17 pm)
@Mich -- cool pic!
My vote: make it as "official iTorque2D logo"!
#14
07/28/2011 (2:25 pm)
Quote:
Hey Konrad, glad to see you here!
Welcome to the iT2D :) I'm new here too.. Haven't found time to do anything thou :(

Hey Bank! Thanks! :) Great to see you here! I'm really itching to do something - I should be fixing bugs ... elsewhere, but what the hell..

I'm trading my pub nights in for iT2D fun! Making the same game for 3+ years is tiresome - I'm sure you know what I'm talking about, heh. I plan to create a small casual game that my kids can play - using their voices and putting it full of things they find funny. :) That's the basic idea for now. :) Might change till tomorrow. :)

Quote:
But I'm too really impressive from this engine and what Mich is doing!

I couldn't agree more!
#15
07/28/2011 (2:34 pm)
Quote:Making the same game for 3+ years is tiresome - I'm sure you know what I'm talking about, heh.
ha-ha! 100%+ :) (what about 5+ years?) :) j/k

Good luck with your casual game, would love to test/play it!
#16
07/28/2011 (6:58 pm)
Mich - both my test devices are using the latest iOS. 4.2 for the iPod and 4.3 for the iPhone.
#17
07/28/2011 (7:35 pm)
@Conor - And you added the CoreMotion framework? I left that step out too
#18
07/28/2011 (9:32 pm)

Attention All

I have spun up a separate thread that reveals a few more details about the subtle improves that will be in the 1.5 final. The contents do not make up great marketing bullet points, but I think you all will be pretty happy with what you read. Here is the link: Mentionable 1.5 Improvements
#19
07/29/2011 (12:03 am)
For the RainyDay example, StartDeviceMotion fails with "Device Motion not supported on this device (check OS)" and breaking the example for non-gyroscope devices. Device Motion requires an accelerometer and a gyroscope.



#20
07/29/2011 (12:19 am)
Quote:
@Sysrat and Conor - Can you make sure that you have the iOSMotionManager.h/.mm files. That is where the accelerometer code exists now. Check to make sure it compiles in and you can get into the ConsoleFunctions in that source.

I added iOSMotionManager.h/.mm files to the platformiPhone and then I got an error:

ld: warning: directory not found for option '-L\\\"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/Frameworks/CoreGraphics.framework\\\"'
ld: warning: directory not found for option '-F\\\"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks\\\"'
ld: warning: directory not found for option '-F\\\"/Applications/iTorque2D_1_5_Preview2/MyProjects/MyGame3/buildFiles/XCode_iPhone/../../../../engine/lib/xiph/iPhone\\\"'
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_CMMotionManager", referenced from:
objc-class-ref in iOSMotionManager.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
Page «Previous 1 2 3 Last »