Forum

savegames

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

Moderator: InsideQC Admins

savegames

Postby revelator » Mon May 23, 2011 2:57 am

running into something of a problem.

been working on fixing up my realm engine and i ran into a problem
it seems.

if i try to load a saved game the VM crashes with invalid edict value -1 .

i use the VM from bengt jardrups glquakebjp allthough with a few differences to make it able to load maps like marcher or bastion which are somewhat huge with loads of monsters.

it works quite fine for that (slow as mollasses though) but it seems
something borked savegame loading.

i tracked the crashing function to be ED_Free but egad i cant find whats causing it to return an edict of size -1.

maybe i need a fresh set of eyes to look the source over, so if anyone volounteers ill send them the source.

btw realm uses mingw/codeblocks so the debugger of choice is gdb.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: savegames

Postby mh » Mon May 23, 2011 9:15 am

reckless wrote:...the debugger of choice is gdb.


Eeeewww.

I was with you up to that point. :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 revelator » Mon May 23, 2011 1:55 pm

Eeeewww.

I was with you up to that point.


Sadface :P

got it fixed was a bug with COM_ParseToken returning something
it didnt quite like :( had to go back to the old COM_Parse to fix it ...

btw i changed lightmap format

Code: Select all
void R_UploadSingleLightmap (lightmapinfo_t *lm)
{
    // just upload the full thing.  "theRect" never worked properly anyway...
    // lightmaps are uploaded as needed, rather than blindly uploading every one
    // that was modified, to avoid possibly having to upload a lightmap that
    // isn't in the draw list, and to reduce texture changes per frame
    glPixelStorei (GL_UNPACK_ROW_LENGTH, BLOCK_WIDTH);

    glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, BLOCK_HEIGHT, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, lm->texels);

    // don;t let it catch the next surf
    lm->modified = false;

    glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
}


but im wondering a bit if effective since the lightmap is uploaded directly to the texture manager in realm should i change the format there also ? atm its GL_UNSIGNED_BYTE in that function.

any other differences i should be aware of ?
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby mh » Mon May 23, 2011 2:48 pm

Code: Select all
glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, BLOCK_HEIGHT, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, lm->texels);


Needs to be:

Code: Select all
glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, BLOCK_HEIGHT, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, lm->texels);


And R_BuildLightmap needs to be adjusted to match.

I'd also change the params in the texture manager; the documentation says they should all match for both the glTexImage call and subsequent glTexSubImage calls.

The "theRect" stuff is fixable: viewtopic.php?t=2466&highlight=therect
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 revelator » Mon May 23, 2011 7:53 pm

not using theRect in realm :) its based on one of your older engines but it did have a total rewrite of the lightmap code.

tried swapping the bytes but it seems theres some more work to do as i get blue maps :lol:
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest