It also seems odd that only movable atoms have bounds_ vars. When you need to do some custom position checking between arbitrary atoms (ex: a mob bumped into a turf, mob, or obj), you need to have two cases: one where the mob bumped something with bounds_ values set and another where the atom doesn't have those set or doesn't have them.
The bound_x and bound_y vars also complicate things when you need to do this type of position checking. With keeping pixel_x and pixel_y, I'm not sure why they're necessary. Maybe you could provide some built-in procs to check information about relative positions (ex: if one atom is to the left of another), but the problem with that is defining what it means to be to the left of an atom (your center is to the left of it's center, no part of your mob is more right than the atom's leftmost part, etc.).
Edit:
I also find it odd that the mob's loc isn't the location of its center, or the tile it most overlaps, but it seems to be the turf that the mob's bottom-left corner is in.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The easiest way to implement #2 is to implement movement entirely in soft code. I wouldn't say that it breaks existing code because there was no existing code that used the native pixel movement. You're right that it's not consistent with the tile-based behavior, but it never will be. Moving a pixel at a time isn't consistent with the old behavior, this is just a consequence of adding a new feature.
Imagine a top-down shooter with 360 degree movement - you're being chased down a hallway but because you're not running perfectly parallel to the walls, the second your mob's shoulder touches the wall you stop dead and are easy pickings for whatever was chasing you. It's just not that useful of a default behavior.
It's essentially just a convenience, but it's a convenience that everyone would want and including it shows that you understand how people would use the feature.
For the Cross proc the distance of the overlap and the direction of the breach (which side of the tile was crossed first). For the Bump proc there are more values that wouldn't be known: original position, magnitude of the potential overlap, total attempted move, direction of the bump. I'm not sure which values would be most useful, but in both cases the direction would be useful: making tiles that can be entered/exited in one direction, boxes that can be pushed in one direction, mobs that bounce elastically, etc.