Game Development Community

Torque 2D v 1.7.5 Scroller sprite bug - image/scroller is invisible or greatly increased during Run game test compared to what You see when designing the level - RESOLVED

by Raymond Gaustadnes · in Torque Game Builder · 02/09/2011 (2:21 am) · 13 replies

Encountered another bug with the software today, when You create a new project and add scroller sprites that go outside of the camera, they either are invisible or gets heavily increased in size when doing a Run game test, compared to what is shown inside the software as You design the scene. Extremely annoying, and it doesn't happen every time You load a project/scene, seems to be 1 in 2 or 1 in 3 times, at least today. Solution so far has been to delete old scroller sprites and create new ones, but I shouldn't have to do that. Can I please get a solution to this problem so I can go on with our game projects? :)

AND it would be greatly appreciated if You could also answer my other questions regarding the TileMap & particle effect issue in iTorque2D, or do I have to pay the $5000 for support to get the proper functionality of the software that I've already got a license for in order to get some help with that? At least give me a note that You are working on the case...

#1
02/09/2011 (4:01 am)
I have also noticed the problems with scroller objects. It seems to be that the sourceRect of the object gets modified by the editor sometimes. By opening the level file and changing the sourceRect for the object to
sourceRect = "0 0 0 0";
the problem goes away.

A real fix for this is needed, since it's quite bothersome to have to go and correct the sourceRect every now and then.
#2
02/09/2011 (4:13 am)
I am using single files for scrolling clouds, and still I get the same error now and then. *sighs* It looked promising, but right now it seems this software is really bugridden, I just lost an entire scene after saving it and reloading Torque 2D + the scene I had just saved, had to build everything from scratch.
#3
02/09/2011 (5:08 am)
I would really love to know if all these problems with the software is only win OS related or if it happens on both mac OS and win OS. I've been struggling to rig a scene now for hours, finally throwing in the towel. I'm doing an uninstall and reinstall of the software, shouldn't need to do it but I can't figure out what's wrong since I haven't modified any of the files.
#4
02/09/2011 (5:33 am)
I also use single files, but it seems to be the sourceRect bug that causes the error anyway. Open the levelfile.t2d in a texteditor and located the scroller object. It should look something like this...
new t2dScroller() {
imageMap = "rollingFloorPart1ImageMap";
repeatX = "5";
scrollX = "2";
scrollPositionX = "0.391623";
useSourceRect = "0";
sourceRect = "0 0 0 0";
canSaveDynamicFields = "1";
Position = "1.809 7.408";
size = "46.497 8.246";
Layer = "7";
GraphGroup = "7";
mountID = "49";
};

Make sure that the sourceRect line reads
sourceRect = "0 0 0 0";
This is what solves the scroller problem for me, at least temporary until I modify the scroller object in TGB.

Another strange thing is that useSourceRect = "0"; doesn't seem to work properly, because if sourceRect is changed the object is affected regardless of whether useSourceRect = "0" or not.
#5
06/17/2011 (2:00 pm)
Changing the sourceRect doesn't seem to help this problem for me the temp fix doesn't last if you edit the scroller object and you have to redo it.

Could it be because it's on top of other layers or below other layers that it's causing this problem?

Is there going to be a fix to this problem

It's really annoying, I never had this problem in the previous versions.
#6
06/19/2011 (2:43 am)
Hm.. I'm pretty sure there was a thread with a fix to this not so long ago, but I can't just find it now.

I've just edited that more than useless field out of the engine, and here is another similar hack. Both require pro license though. One non-pro workaround I can think of is a sprites with animated sourceRect instead of scrollers, if it is possible at all to update this field on the fly.
#7
06/20/2011 (6:31 am)
Hi,

could this be related to these bugs :

http://www.garagegames.com/community/forums/viewthread/126360

if it is, then the nicely packaged .patch that is provided in this thread is very easy to apply/merge :)
#8
07/06/2011 (5:21 pm)
Ran into this thread today searching for this very issue... Once it was related to the source rects in my head, I figured I'd try to sort it out in script.

If you're feeling hacky, don't use source rects AT ALL, and don't want to mess with the source code, try this for a script fix:

look for t2dSceneWindow::loadLevel(%sceneWindow, %levelFile) in levelManagement.cs (not .ed.cs, mind you...)

I think it'll be in your game's "common" folder... mines all shifted around because I got rid of the common folder entirely, but it's in there somewhere.

toward the bottom of that function you'll see a loop going through the objects loaded in... Add the line shown below:

for (%i = 0; %i < %sceneObjectCount; %i++)
      {
         %sceneObject = getWord(%sceneObjectList, %i);
         %sceneObject.sourcerect = "0 0 0 0"; // WERE NOT USING THESE AND THIS FIXES THE SCROLLER BUG IN-GAME
         //if( %sceneObject.isMethod( "onLevelLoaded" ) )
            %sceneObject.onLevelLoaded(%scenegraph);

      }

I know not everyone is comfortable with such hackery, but then some folks aren't comfortable with editing the source, so I figured I'd throw this out there.

I did a test with a .t2d file that had the crazy "1.4013e-045 0 2.8026e-045 1.4013e-045" sourcerect and it IS broken without this line, and looks fine with it added.

I'm sure given how prevalent the sourcerect screwiness is, it'll be fixed in the next version via proper source changes -- but who knows when that'll be!

#9
08/27/2011 (6:57 am)
I've been having this for a while now, really really annoying.
I hope the guys at GG can issue a minor update ASAP to fix these issues.
#10
09/19/2011 (10:19 am)
logged as TGB-517
#11
09/23/2011 (12:24 pm)
Any updates guys?
#12
09/23/2011 (12:55 pm)
@Ameen
No update to give, Jon logged it so that we made sure that we had the full list of reported issues to build out the work for 1.7.6.
#13
12/12/2011 (9:58 am)
Fixed in 1.7.6