LoginLogin

Kicking myself right now

Root / General / [.]

Gaelstrom_ValenceCreated:
Been stuck for ages on something. Been using Bitwise stuff to handle collisions with map tiles. Worked well for basic tiles, 1 through 15, no hassle. But when I started to expand past that, then I ran into issues. I was hoping to have tile data all in one variable, stuff that doesn't specific instances at least, and thought I could just handle tiles past 15 as just IDs rather than Bitwise colliders. But then that was triggering collisions unnecessarily, then I was trying to figure out how to handle 1 way tiles, since the map editor treats them as regular tiles. I thought a bit flag could take care of that, but oh no that also messes with collision. Then I saw something on a game engine forum. And, that taught me that I could just, make collision bits less significant. Or, more, whichever. And then I realized. Oh wait. Isn't that kind of what smilebasic does with bgtile ids and rotation data. And yeah, that was quite a revelation. Also hi, I'm still around. Hope everyone's doing well.

Can any tile id have any collision property? It sounds to me like you're limiting yourself unnecessarily. Integers have 32 bits available, yet you're only using 4. Perhaps you could allocate some section of bits to store collision data:
&B0000.000000000000
Period is a delimiter for show. From left to right, the first 4 bits may store collision properties (I'm guessing each bit turns a tile's corresponding side "on/off"), and the last 12 bits store the tile id, 0-4095.

Can any tile id have any collision property? It sounds to me like you're limiting yourself unnecessarily. Integers have 32 bits available, yet you're only using 4. Perhaps you could allocate some section of bits to store collision data:
&B0000.000000000000
Period is a delimiter for show. From left to right, the first 4 bits may store collision properties (I'm guessing each bit turns a tile's corresponding side "on/off"), and the last 12 bits store the tile id, 0-4095.
Yeah, that's the idea! My issue was I made the tile collision bits the least significant ones (I finally looked up which was which), which meant any number past the 15 would mess with those first 4 bits.