Game Development Community

iT2D 1.4 Beta 2 - iTGB Windows breaks Mac created levels

by Rob Evans · in iTorque 2D · 06/23/2010 (6:36 pm) · 1 replies

Build: 1.4 Beta 2

Platform: XP, OS X 10.6.3

Target: iTGB

Issues: iTGB on windows breaks levels created with iTGB mac due to different ways of defining levels.

Detailed Description:

I've been designing a game on iTGB mac and ever since working on windows have constantly been having an annoying problem where the game for no reason would stop working.

Let me elaborate:

I have some objects that have physics enabled and linear velocity set. This works fine on mac. After opening the project on windows and clicking run everything works as expected. If i click save and then run none of the objects moved. I figured this is being caused by a broken level file since in theory iTGB should not be touching anything other than datablocks and the level file. So i investigated.

I made two copies of my level file from my mac. I then renamed one of them and ran iTGB. Saved. Ran. Nothing moved. I then ran a diff on both files and found the problem. It seems on mac if physics is set for an object there is a variable in the level file "UsesPhysics = 1". If the object has no physics there simply is no "UsesPhysics" variable.
iTGB Win seems to think this is totally the wrong way around and when i resave the file it removes all variables "UsesPhysics = 1" if an object HAS physics enabled and adds "UsesPhysics = 0" if physics is disabled.

This is wrong. At least the engine thinks so. Because aparently it treats no variable and "UsesPhysics = 0" as both meaning that the object has no physics. So naturally none of my objects move because physics for all objects is now disabled.

Steps to Repeat:

1. Run iTGB on Mac
2. Create a new project, add an object (image - dont forget to adjust the datablocks ;)), enable physics and apply some acceleration.
3. Run the game - your object should move as expected.
4. Save, reopen project in iTGB on Windows.
5. Run game - the object should move as expected.
6. Click 'Save' and run the game - the object should no longer move.

Suggested Fix: If physics is enabled it should be set to "UsesPhysics = 1" and not left empty. Likewise if physics is disabled it should be set to "UsesPhysics = 0" or left empty.

#1
06/25/2010 (6:30 am)
I've been working around this by calling %this.setUsesPhysics(true); on everything that moves or collides in script.