ObjectType - short of bits
by Konrad Kiss · in Torque Game Engine · 08/14/2008 (2:40 am) · 3 replies
Hi all,
I am running out of ObjectType mask bits, yet I desperately need to define new object type masks. I have already got rid of anything I don't need. Is there an easy way to bump those 32 bits up somehow without having to modify the whole engine source where masks are compared?
As always, any reply is very much appreciated!
Konrad
I am running out of ObjectType mask bits, yet I desperately need to define new object type masks. I have already got rid of anything I don't need. Is there an easy way to bump those 32 bits up somehow without having to modify the whole engine source where masks are compared?
As always, any reply is very much appreciated!
Konrad
About the author
http://about.me/konrad.kiss
#2
08/14/2008 (1:44 pm)
Why do you need so many bits? They're just there for making spatial queries a little easier and a few other situations. If you have lots of different related kinds of objects, it might be easier to assign them all the same bit and then filter when you get the list back from the query.
#3
The switcher mask idea didn't quite turn out to be good enough, so I did what you said - tried to get rid of the masks that are easy to check against.
It's not that I need so many. TGEA right now comes with about 3-4 free if I remember right. Add torque motion and immersive AI and you run out of bits. But it's fine, I'll try to keep it 32 bits, it's gonna have less overhead at least.
08/14/2008 (11:54 pm)
Yes, indeed, they make it a lot easier. If I could make it an enum based on a U64, that'd be really convenient. The switcher mask idea didn't quite turn out to be good enough, so I did what you said - tried to get rid of the masks that are easy to check against.
It's not that I need so many. TGEA right now comes with about 3-4 free if I remember right. Add torque motion and immersive AI and you run out of bits. But it's fine, I'll try to keep it 32 bits, it's gonna have less overhead at least.
Associate Konrad Kiss
Bitgap Games
I'm going to use #31 as a "switcher" mask that switches a second set of 31 masks on, and change all previous masks to use this behavior.
This of course can only be used for mutually exclusive masks, but that gives me just enough slots for a while.