Forum

GLQuake Bug: Nvidia Extension Limit must be off

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Postby JasonX » Mon Oct 18, 2010 8:48 pm

I couldn't possibly ask for more, mh. Thank you so much for the help!
JasonX
 
Posts: 411
Joined: Tue Apr 21, 2009 2:08 pm

Postby JasonX » Tue Oct 19, 2010 1:03 am

Quick question: are there any problems with GLQuake's netcode? Or it's just bugged on the graphics part? =p
JasonX
 
Posts: 411
Joined: Tue Apr 21, 2009 2:08 pm

Postby mh » Tue Oct 19, 2010 1:20 am

Aside from not working across firewalls or routers? And being pretty crap to begin with? :lol:

The sound code is also f-cked by the way. Writing to the primary buffer with DirectSound is not a nice thing to do, and no well-behaved app should do it.

The netcode fix is something that's already in ProQuake and a few others. There's a partial fix in many other engines too, but that doesn't work on some servers. I put a full fix in DirectQ some time back but never really investigated exactly what was required (must do that sometime!) As soon as info on the full fix emerges I'm sure it'll be posted here and tutorialized.

For the sound code you need to hack around in SNDDMA_InitDirect. All you really need is this block (it should be obvious what it replaces):
Code: Select all
#ifndef MHGLQFIX
    if (!COM_CheckParm ("-snoforceformat"))
    {
        if (DS_OK == pDS->lpVtbl->CreateSoundBuffer(pDS, &dsbuf, &pDSPBuf, NULL))
        {
            pformat = format;

            if (DS_OK != pDSPBuf->lpVtbl->SetFormat (pDSPBuf, &pformat))
            {
                if (snd_firsttime)
                    Con_SafePrintf ("Set primary sound buffer format: no\n");
            }
            else
            {
                if (snd_firsttime)
                    Con_SafePrintf ("Set primary sound buffer format: yes\n");

                primary_format_set = true;
            }
        }
    }
#endif

#ifndef MHGLQFIX
    if (!primary_format_set || !COM_CheckParm ("-primarysound"))
    {
#endif
    // create the secondary buffer we'll actually work with
        memset (&dsbuf, 0, sizeof(dsbuf));
        dsbuf.dwSize = sizeof(DSBUFFERDESC);
        dsbuf.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_LOCSOFTWARE;
        dsbuf.dwBufferBytes = SECONDARY_BUFFER_SIZE;
        dsbuf.lpwfxFormat = &format;

        memset(&dsbcaps, 0, sizeof(dsbcaps));
        dsbcaps.dwSize = sizeof(dsbcaps);

        if (DS_OK != pDS->lpVtbl->CreateSoundBuffer(pDS, &dsbuf, &pDSBuf, NULL))
        {
            Con_SafePrintf ("DS:CreateSoundBuffer Failed");
            FreeSound ();
            return SIS_FAILURE;
        }

        shm->channels = format.nChannels;
        shm->samplebits = format.wBitsPerSample;
        shm->speed = format.nSamplesPerSec;

        if (DS_OK != pDSBuf->lpVtbl->GetCaps (pDSBuf, &dsbcaps))
        {
            Con_SafePrintf ("DS:GetCaps failed\n");
            FreeSound ();
            return SIS_FAILURE;
        }

        if (snd_firsttime)
            Con_SafePrintf ("Using secondary sound buffer\n");
#ifndef MHGLQFIX
    }
    else
    {
        if (DS_OK != pDS->lpVtbl->SetCooperativeLevel (pDS, mainwindow, DSSCL_WRITEPRIMARY))
        {
            Con_SafePrintf ("Set coop level failed\n");
            FreeSound ();
            return SIS_FAILURE;
        }

        if (DS_OK != pDSPBuf->lpVtbl->GetCaps (pDSPBuf, &dsbcaps))
        {
            Con_Printf ("DS:GetCaps failed\n");
            return SIS_FAILURE;
        }

        pDSBuf = pDSPBuf;
        Con_SafePrintf ("Using primary sound buffer\n");
    }
#endif


Input is f-cked too. As is physics, and the filesystem (it's case-sensitive!), the memory allocator is an unholy mess, the chase cam is f-cked, etc etc etc.

These are all problems that have been worked over throughout the years, and I'd seriously say that I don't envy you one bit starting fresh at them. :evil:
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby frag.machine » Tue Oct 19, 2010 11:31 am

mh wrote:Input is f-cked too. As is physics, and the filesystem (it's case-sensitive!)


Hmm, case-sensitive filesystem rocks. Too bad Windows can't handle this properly :P
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby mh » Tue Oct 19, 2010 11:49 am

frag.machine wrote:case-sensitive filesystem rocks.

Not if you're an end-user it doesn't.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby frag.machine » Tue Oct 19, 2010 3:02 pm

mh wrote:
frag.machine wrote:case-sensitive filesystem rocks.

Not if you're a Windows-only end-user it doesn't.


Here, I fixed that for ya :lol:
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby mh » Tue Oct 19, 2010 4:49 pm

frag.machine wrote:
mh wrote:
frag.machine wrote:case-sensitive filesystem rocks.

Not if you're a Windows-only end-user it doesn't.


Here, I fixed that for ya :lol:

No, I've managed Unix servers with big production Oracle databases on them, and believe me, this does not rock. Waking up at 4 in the morning screaming is not a nice experience. :lol:
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby dreadlorde » Tue Oct 19, 2010 7:56 pm

mh wrote:No, I've managed Unix servers with big production Oracle databases on them, and believe me, this does not rock. Waking up at 4 in the morning screaming is not a nice experience. :lol:
But why doesn't a case-sensitive filesystem not rock?
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
User avatar
dreadlorde
 
Posts: 268
Joined: Tue Nov 24, 2009 2:20 am

Postby Feared » Mon Nov 29, 2010 4:02 pm

I noticed the link went down.
Had it sitting in my downloads folder for a while now.

http://bfeared.com/library/index.php?di ... GLQFIX.zip
User avatar
Feared
 
Posts: 95
Joined: Fri Jun 11, 2010 11:58 pm
Location: Wylie, TX

Postby leileilol » Tue Nov 30, 2010 12:59 am

frag.machine wrote:Here, I fixed that for ya :lol:


No, you have to also deal with case-sensitivity when it comes to pak files.
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Previous

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest