Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sponge99

Wolf3d/More questions

This topic is 6921 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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 ***

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!