Page 1 of 1
Tile graphics engines

Posted:
Feb 10, 2002 @ 11:57pm
by brendan

Posted:
Feb 11, 2002 @ 3:02am
by Dan East
You would use the exact same logic you are currently using. The smooth movement of an object from one tile to another is purely visual. You should test to see if the object is allowed to move to the destination tile before the move takes place. If the move is allowed, then draw several frames to smoothly animate the object's movement to the new tile. You should not accept input, etc, during the move - it has to complete before the next move can take place.
Dan East
mmm

Posted:
Feb 11, 2002 @ 3:38am
by brendan
OK, it's just that most rpg's etc allow you to move in smaller steps ? for example mario allow you to move the player part of a block etc, I'm sure I can rig the code to do what your saying but....

Posted:
Feb 11, 2002 @ 9:27am
by MirekCz
brendan:well, diablo1 doesn't allow you to do so.
If you want smooth movement you can still try to do as Dan said but allow players to stop between blocks (althrought if they want to move again they must press a position near themselfs which isn't blocked)
Another approach is to use a small bittable which represents where you can go and where you can't. It could be either exact tile size, or much smaller (for ex. 4x4). Before a move you would check if it's allowed. This way you could make much smoother move esp. along a wall, around a small blocking object etc.
hope it helps
OK doky

Posted:
Feb 11, 2002 @ 10:13am
by brendan
OK, I'll implement the code and see what it looks like, my game is not exactly a RPG etc, it's more like mario that anthing else.... I'll see how it goes....
-brendan

Posted:
Feb 11, 2002 @ 11:05am
by refractor
Hello.
A general approach is to have a collision map that's similar to the main map. Then, you have a set of collision "tiles" the same size as your graphics tiles (these could be made up of 4, 8, 16, 32, blocks, *however many you need*):
A full tile
a /| tile
a |\ tile
a half-height tile
...
etc
Store them as triangles or boxes in an array. Then you can look up the entry in the collision data and check a point at the character's feet/head against the single box/triangle, which is very simple.
The collision map tends to be *much* more sparse than the main tile map, so you (c)/(s)hould use RLE compression on it to save space.
Another alternative, is to ignore the way the graphics are laid out in tiles and have a polygonal/circle - based collision system, where the characters walk on circles, triangles, boxes, etc of arbitrary size.
(P.s. I really wouldn't have the character only moving from block to block, that *really* sucks game-play wise).
Cheers,
Refractor.