Wolf3d/More questions

Started by
2 comments, last by Sponge99 23 years, 11 months ago
I''m sure some of you have already seen my Wolf3d post, but I don''t know it''s URL. It''s in generic game programming somewhere... But in response to the person who told me that even though wolf3d keeps a 64x64 array of "blocked" items, you are kept at the pixel level. How then, does it recognize when not to let you move forward? Does it check what pixel your at, and then put that into another grid system? If it did that, then wouldn''t you not be able to move as soon as you got 1 block away from a table or something? Just wanting to know. To learn is fun..... [Sponge99]
"Now watch as I run away in a womanly fashion." - Batman
Advertisement
It would keep track of the player on a pixel-accurate basis. To find out which block you are in, (that is, to convert from the pixel grid system to the block grid system) would be something simply like PlayerLocationInPixels / BlockSizeInPixels. When you try to move, rather than just seeing if the block in that direction is impassible, it will calculate where you are within your current block, and where you will end up if you move.

For example:
DestinationBlock = (CurrentPositionInPixels + DistanceToMoveInPixels) / SizeOfBlockInPixels

Then it is likely to check if that is ''inside'' an impassible block, and if so, disallow your move.

If (DestinationBlock is impassible)
Don''t move there
else
CurrentPositionInPixels += DistanceToMoveInPixels

Hope that helps.
How big are you (in pixels) in the normal 3d game? I assume it should be 1, so you can touch the walls, but in games like Quake, with models, you look 3d, and bigger than one pixel. But when playing it, you can walk straight up to a wall.

Just another question.......Can anyone answer?
"Now watch as I run away in a womanly fashion." - Batman
If you walk up to a wall in say Quake, it does not look like you are 1 pixel away. The distance is about what it should be when you are looking at your model.

*** Triality ***
*** Triality ***

This topic is closed to new replies.

Advertisement