-forceglnet

Moderator: Graf Zahl

Locked
User avatar
Edward850
Posts: 63
Joined: Fri Mar 20, 2009 21:48

-forceglnet

Post by Edward850 »

GZDooms current GL implementation forces all players in a network game to have a restricted max view angle, because of clients that could potentially be using software rendering.
-forceglnet forces all clients to either use GL, or disconnect from the game with an error (preferably to the console). I see no reason in having a restricted view height when I know all players who are joining the game are going to be playing in GL, so this command would serve that one nicely.
User avatar
Agent ME
Posts: 229
Joined: Mon Jan 02, 2006 12:39
Contact:

Re: -forceglnet

Post by Agent ME »

I was thinking, couldn't it just be changed so that only players that are using software rendering are restricted to 45 degrees? It would only cause problems if the player decides to spy on the view of a GL player, which I guess would just cause the view to look distorted. Or the software renderer could just clip their view to 45 degrees even if they are looking above that - the game would still behave as if they're aiming higher/lower than that, but just render it at the max angle supported.
User avatar
Edward850
Posts: 63
Joined: Fri Mar 20, 2009 21:48

Re: -forceglnet

Post by Edward850 »

That is impossible, considering online games have no idea who is using what render (hence the limitation in the first place). If the only thing that is sent over is player movement and control data, OpenGL players would see that a player is looking up, but is unable to tell when to stop them (apart from their already defined limit).
User avatar
Rachael
Developer
Developer
Posts: 3646
Joined: Sat May 13, 2006 10:30

Re: -forceglnet

Post by Rachael »

Actually, consider it slightly differently.

Software user is clipped at like 75 degrees or so, whatever they're clipped at, I think. They stay at that clipping, no matter what, they cannot look up or down past that angle.

Now, open GL users are clipped at 90, they get the full up down view. So in a net game, they can still go 90 degrees, but if a software dude spies them, it LOOKS like they're being clipped at 75 even though they're really not.

However, being that the software guy is on software, he never will get past 75 degrees (or whatever the limit is currently), even if the open GL guy spies on him.
User avatar
Agent ME
Posts: 229
Joined: Mon Jan 02, 2006 12:39
Contact:

Re: -forceglnet

Post by Agent ME »

^ Exactly.
User avatar
Edward850
Posts: 63
Joined: Fri Mar 20, 2009 21:48

Re: -forceglnet

Post by Edward850 »

No, the issue here is that if the software user is clipped at 90, how does an OpenGL user know that a user is using software? As soon as a software user tries to look past 75, an OpenGL user will get it wrong and the game will go out of sync. Gzdoom has no way of telling another other user about their current render, nor does dooms netcode work in the way that you describe it. Their current pitch isn't sent, only their pitch movement.
User avatar
Agent ME
Posts: 229
Joined: Mon Jan 02, 2006 12:39
Contact:

Re: -forceglnet

Post by Agent ME »

Then the software client can simply stop sending the signal to look further up or down once it hits the limit.
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Re: -forceglnet

Post by wildweasel »

Agent ME wrote:Then the software client can simply stop sending the signal to look further up or down once it hits the limit.
But then comes the issue of the coop spy button - what should be done if a software player has coop-spied to a GL player that is looking more than 75 degrees up or down?
User avatar
Rachael
Developer
Developer
Posts: 3646
Joined: Sat May 13, 2006 10:30

Re: -forceglnet

Post by Rachael »

wildweasel wrote:
Agent ME wrote:Then the software client can simply stop sending the signal to look further up or down once it hits the limit.
But then comes the issue of the coop spy button - what should be done if a software player has coop-spied to a GL player that is looking more than 75 degrees up or down?
Then the software player would be locked at 75 degrees - they wouldn't even know the GL player looked beyond those degrees.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: -forceglnet

Post by Gez »

GL player: looks down 90° (for a pitch of -90°)
Software spy: looks down 75° (for a pitch of -75°)
GL player: looks up 90° straight away again (for a pitch of 0°)
Software spy: looks up 90° (for a pitch of +15°)

Is that what happens?
User avatar
Rachael
Developer
Developer
Posts: 3646
Joined: Sat May 13, 2006 10:30

Re: -forceglnet

Post by Rachael »

No, the software player still "knows" the exact degrees the GL player is at, they just only see it at 75 degrees.

The software player just simply can't look past 75 degrees on their own view - even if they try, a GL player spying them would only see them locked at 75 degrees. And when they look up, the extra 15 degrees don't "lag" it, they were at 75 degrees all along.

I'll give an example situation:

SW: 0 - GL(Spy): 0
SW: 75 - GL(Spy): 75
SW: Attempts to go past 75 -- SW: 75 - GL (Spy): 75 (It just doesn't work, it stays at 75 if they're in software mode)

GL: 0 - SW(Spy): 0
GL: 75 - SW(Spy): 75
GL: 90 - SW(Spy): 75 (The Software player doesn't actually even know the GL player went down to 90 degrees, SW's client "knows" that it actually IS 90 degrees, but SW's view is locked)
GL: 0 (After being 90) - SW(Spy): 0

GL: 90 - GL(Spy): 90

I know this seems difficult to code, but it's rather easy.

This is a semi-C++-pseudo-code-type-something-implementation:

Code: Select all

function abs(int x)
{
    if ( x < 0 )
        return (x * -1);
    else
        return (x);
}

function sgn(int x)
{
    if ( x < 0 )
        return (-1);
    else if ( x == 0 )
        return (0);
    else
        return (1);
}

function FixView()
{
    if ( Mode == Software )
    {
        if ( abs(SelfView) >= 75 )
        {
            // Correct self view
            SelfView = 75 * sgn(SelfView);
            UpdateNet();
        }
        if ( spying == true )
        {
            if ( abs(spyplayer-->View) >= 75 )
            {
                SpyView = 75 * sgn(spyplayer-->View);
            }
            else
            {
                SpyView = spyplayer-->View;
            }
            // If spy view is > 75, set it to 75, else set it to actual view
        }
    }
}
Okay, so that's really incomplete and does not use any actual reference (i.e. variable names would have to be fixed), but hopefully it gives some idea of what I mean.
Locked

Return to “Closed Feature Suggestions”