Game Development Community

TX2D 3.1.5 Beta - ObjectType from 33 to 64 assigned to 1 to 32 again - RESOLVED

by Giuseppe De Francesco · in Torque X 2D · 06/09/2010 (1:22 am) · 4 replies

Build: 3.1.5 Beta

Platform: Any

Target: Engine Core (Core/TorqueObjectDatabase.cs)

Issues: The Torque Object Types are managed using 64 bits of an UInt64 variable but the line computing its bits value works on 32 bits only messing up the Types from 33 to 64 simply assigning them the same values of the Types 1 to 32.

Steps to Repeat:
1. Create a TX project
2. Create more than 32 object type
3. Assign a specific and different behaviours to the 1st and the 33rd object types
4. Run the game: the 33rd behaviour is ignored and played just as if it were the 1st one

Suggested Fix:
in Core/TorqueObjectDatabase.cs (line 731) change this

objType._bits = (ulong)(1 << _objectTypes.Count);

to this:

objType._bits = 1ul << _objectTypes.Count;

About the author

In the software eng. field since 1981, in charge of R&D during last 10 years. IEEE Senior Member (and volunteer).


#1
06/25/2010 (10:05 am)
This is still a bug in the new beta.
#2
06/25/2010 (3:21 pm)
Logged as TQA-428.
#3
06/29/2010 (3:47 pm)
Thats a good fix Giuseppe.

I tested it here and went thru to make sure the same bug isn't done else where in the engine.

It will be in the next beta.
#4
06/29/2010 (4:01 pm)
Thanks Tom ;)