Jump to content

Does the map move in relation to the player or vice versa in Doom?


Recommended Posts

2 hours ago, jmpt16 said:

is it safe to assume i struck some kind of nerve?

 

Yes, I enjoy these kind of debates but some people get a little too worked up :P

Check out the "is Doom actually 3D" threads to see what I mean...

 

6 hours ago, QuotePilgrim said:

It is also true that the way the level is rendered consists of calculating what parts of the level to draw on the screen relative to what the player coordinates are. You can think of this as the level moving relative to the screen/player. As a programmer it makes more sense to think of the level as moving, because it's the thing that you actually see move on the screen as the player coordinates change.

 

Fair enough, and you were right to challenge my analogy to IRL movement in which there isn't a 0,0,0 that we know of. However, as others mentioned there is the issue of multiplayer. In that case, the scene is rendered differently for each viewer... aren't they objectively moving about the stationary map? In this virtual world there is an origin, and the offset for rendering is local to each viewer. If the coordinates for a vertex never change, can't we say that the vertex is non-moving?

 

Share this post


Link to post
4 hours ago, Edward850 said:

As a programmer I actively do not think this at all.

 

It frankly makes more sense to think of rendering as standing in a spot in the level and reading out drawing instructions over an RT to someone else in a completely different location who is drawing your instructions onto a canvas.

 

I code, but am not close to the same level as someone like yourself. I clearly recall specific functions in Doom's code involved in moving the player.

 

Expanding on this concept further, it seems to me that moving a map around a player character would be grossly inefficient. It's not just the geometry that the code would have to relocate, but everything in it - the items, monsters, decorations and projectiles. My brain hurts thinking about how difficult that would be to accomplish successfully. 

Share this post


Link to post

@Murdoch I think they are are specifically trying to refer to how it works from a rendering perspective, rather than the playsim. But in either case the explanation just leads to this confusion anyway and as I described it's not really how the view model works anyway.

Share this post


Link to post
17 hours ago, magicsofa said:

Fair enough, and you were right to challenge my analogy to IRL movement in which there isn't a 0,0,0 that we know of. However, as others mentioned there is the issue of multiplayer. In that case, the scene is rendered differently for each viewer... aren't they objectively moving about the stationary map? In this virtual world there is an origin, and the offset for rendering is local to each viewer. If the coordinates for a vertex never change, can't we say that the vertex is non-moving?

 

That is absolutely a valid way of thinking about it. It is also valid to think that the map is moving differently for each player. That is the thing about movement, it only exists relative to some frame of reference. The XKCD comic someone posted is a silly joke, but it is also true. In physics, from the frame of reference of a person standing inside the train, the train is stationary and Earth is moving, and from the frame of reference of someone standing somewhere else outside of the train, the train is moving. Both things are simultaneously true.

 

As for what happens in the game, each player's computer is rendering a separate copy of the world, so there is no issue. Let's pretend the level doesn't exist for a second, and imagine there are two players standing in front of and looking at each other. If player A strafes left, what will both players see? Player B will obviously see the player A sprite moves towards the right side of their screen, but it is also true the Player A see's player B's sprite move towards the right of their own screen. Player A is moving from player B's point of view, and vice versa, in the very real sense that both computers are moving the other player's sprite across the screen.

 

If you only looked at either screen, without knowing who is actually strafing, you would come to the same conclusion that the person see on the screen is the one moving.

 

(Also, in case someone is about to bring up the fact that the strafing player's player would show a walking animation, I'll just point out that a walking animation doesn't have to be tied to movement. You could have neither sprite animate at all, or both animate constantly regardless of whether the player is doing anything, for instance.)

 

17 hours ago, Murdoch said:

Expanding on this concept further, it seems to me that moving a map around a player character would be grossly inefficient. It's not just the geometry that the code would have to relocate, but everything in it - the items, monsters, decorations and projectiles. My brain hurts thinking about how difficult that would be to accomplish successfully.

 

It's more a matter of how to think about what is happening than what is being done in code. But one way in which the game actually move everything around is what I just described above, which you can see happening right in front your eyes. Just look at any object in the game and rotate your character a little bit with your mouse, and you see the object move on your screen. I think seeing this as moving the object relative to the player is a reasonable way of looking at it; if you don't, there's not much else I can say.

 

Just think about this: the game has to calculate the position of everything relative to the position of the player in order to draw it on screen. It would be impossible to place anything on the screen without doing that.

 

--

I hope this all makes any semblance of sense, it is very clear in my head but I often have trouble getting what is in my head out in a coherent way. Also, I think I have repeated myself enough, so I'll refrain from posting any further in this thread.

Edited by QuotePilgrim

Share this post


Link to post
3 hours ago, QuotePilgrim said:

If you only looked at either screen, without knowing who is actually strafing, you would come to the same conclusion that the person see on the screen is the one moving.

 

Yes, but if you looked at the code, you would be able to determine which player is moving relative to the origin, and which player is not. The lack of this knowledge for the front-end user doesn't change the mechanism of what's happening. If their coordinates were shown on the screen, they wouldn't come to the same conclusion because one would see changing numbers while the other did not.

 

Actually, without the coordinates the player might still guess based on the fact that they didn't touch the controls.

 

I think you explained your argument in a sensible way, but I'm not convinced that it is really acceptable to consider this as relativistic motion. I mean, if we did discover somehow that our universe has a kind of center or origin point, then suddenly we would have to change our thinking because there would then be a way to "stand still"

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...