home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Sauerbraten engine development

by Aardappel on 03/03/2004 05:18, 1571 messages, last message: 03/14/2008 18:53, 1351311 views, last view: 12/09/2021 06:26

This thread is for discussion of Sauerbraten coding issues / implementation ideas etc.

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages

#1488: ..

by Stern on 06/08/2006 21:58

Haha it's funny watching you all talk about running it with 10-20 fps. I was running Cube1 with 250ish fps, and probably a similar number for Cube2. Then again, my computer is amazing... :)

reply to this message

#1489: lighting bug

by guest57 on 06/11/2006 22:31

I've just seen a map with 'lerpsubdiv' set to a high number (45), maybe it was corrupt? Anyway the result is that the calc light routine will loop forever in addnormals() 'while(size/subdiv < lerpsubdivsize) ...'

- aka rpointon

reply to this message

#1490: bloom patch

by guest57 on 06/12/2006 00:20

An experiment in adjusting the bloom depending on the brightness of the screen:

rendergl.cpp:renderfullscreenshader()
loopi(NUMSCALE)
{
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, rendertarget[i]);
glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, 0, 0, nw, nh);

/* >>>>> BEGIN
* Grab the smallest texture into main memory
* - average the RGB
*/
if(i==NUMSCALE-1) {
const int bytes = nw*nh*4;
float result[bytes];
glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
glReadPixels(0, 0, nw, nh, GL_RGBA, GL_FLOAT, result);
int j;
float t = 0.0;
for(j=0; j < bytes; j+=4)
t += result[j] + result[j+1] + result[j+2];
t /= nw*nh*3;
/* adjust the bloom level... need to tweak, and maybe add delay? */
fsparams[0] = 0.2/t;
}
/* <<<< END */

if(i>=NUMSCALE-1 || !scaleshader) break;
renderfsquad(nw /= 2, nh /= 2, scaleshader);
};

-aka rpointon

reply to this message

#1491: ..

by Wolfgang on 06/14/2006 14:39

Bug in copy which I checked out a few minutes ago:

D:\sauerbraten>bin\sauerbraten.exe -w1280 -h800
init: sdl
init: enet
init: video: mode
init: video: misc
init: console
init: gl
Using GL_ARB_vertex_buffer_object extension.
WARNING: Using floating point vertexes. (use "/floatvtx 0" to disable)
Rendering using the OpenGL 1.5 assembly shader path.
Using GL_ARB_occlusion_query extension.
WARNING: No texture rectangle support. (no full screen shaders)
WARNING: Non-power-of-two textures not supported!
COMPILE ERROR (VS:0) - Error on line 1: missing or invalid version (hint: 'defau
lt')
default <<HERE>>
☻COMPILE ERROR (PS:0) - line 1: invalid header
!!ARB <<HERE>>
vp1.0
ATTRIB opos = vertex.position;
OUTPUT spos = result.position;
DP4 spos.x, state.matrix.mvp.row[0], opos;
DP4 spos.y, state.matrix.mvp.row[1], opos;
DP4 spos.z, state.matrix.mvp.row[2], opos;
DP4 spos.w, state.matrix.mvp.row[3], opos;

MOV result.texcoord[0], vertex.texcoord[0];
MOV result.color, vertex.color;
END
Sauerbraten Win32 Exception: 0xc0000005 [0x4]

Shader::set - shaders.h [19]
gl_init - rendergl.cpp [207]
SDL_main - main.cpp [350]
__tmainCRTStartup - crtexe.c [586]

reply to this message

#1492: Sauer Bumpmapping

by shadow,516 on 06/15/2006 01:23

http://shadow516.googlepages.com/FirstSauerBumpmaps.jpg

I must say, that's pretty goddamn sexy aard!

reply to this message

#1493: Re: Sauer Bumpmapping

by Aardappel_ on 06/15/2006 06:16, refers to #1492

pfftt... I check stuff in cvs just to share between myself and eihrul... if you check it out at random times expect half-baked versions. Unless you actively participate in development, I recommend sticking to the releases :)

reply to this message

#1494: Re: Sauer Bumpmapping

by shadow,516 on 06/15/2006 13:46, refers to #1493

I know, but I can never wait to see the next thing you guys come up with ;)

reply to this message

#1495: My sauer-map utility

by xoltra on 06/18/2006 07:17

I've recently completed a utility that provides a command line means of querying and manipulating Sauerbraten maps. Hopefully it will be useful to developers and mappers. You can find it here:

http://home.austin.rr.com/selliott4/sauer-map

Feel free to send me any comments or questions that you might have.

reply to this message

#1496: Small change

by virtualblackfox on 06/18/2006 17:58

Here is a small change to sicompare function in serverbrowser.cpp

-----

int sicompare(const serverinfo *a, const serverinfo *b)
{
//Servers with a good version appears before others
if ( (a->attr.ulen > 0) && (b->attr.ulen > 0))
{
if ( (a->attr[0] == PROTOCOL_VERSION) && (b->attr[0] != PROTOCOL_VERSION) )
return -1;
if ( (a->attr[0] != PROTOCOL_VERSION) && (b->attr[0] == PROTOCOL_VERSION) )
return 1;
}

return a->ping>b->ping ? 1 : (a->ping<b->ping ? -1 : strcmp(a->name, b->name));
};

-----

Just to make servers you could connect to apears first.

I haven't been able to find a Mailling list or something like that for dev issues so i post here.

reply to this message

#1497: Client/Server crashes

by guest57 on 06/18/2006 18:35

Can someone please focus on the robustness of the network code to ensure that clients can't crash the server or other clients - cheats are an annoyance, but these loosers are a problem when they can crash other machines! I'll try and catch some examples...

- aka rpointon

reply to this message

#1498: Re: Client/Server crashes

by eihrul on 06/18/2006 19:27, refers to #1497

Unless you send us a stack trace (which is even conveniently printed for you on the Windows version), we can't fix it, because we don't know what the problem is.

reply to this message

#1499: ..

by virtualblackfox on 06/18/2006 19:56

I got a crash today in the assert of

T &operator[](int i) { ASSERT(i>=0 && i<ulen); return buf[i]; };

in tools.h

The cause seemed to be that i was in coopedit and have "/getmap" then a SV_ITEMPICKUP arrived ... tryed to itemname() and boom...

It seem possible that as not all ppl on a coop-edit map see the same items a SV_ITEMPICKUP could arrive on a "not existing for me" item.

I think that someone that want to crash other clients could craft such a packet.

reply to this message

#1500: Re: ..

by eihrul on 06/18/2006 20:12, refers to #1499

I cleaned that up, thanks.

reply to this message

#1501: Re: ..

by xoltra on 06/18/2006 21:02, refers to #1499

I saw that one, and I should have told the list. They can easily craft such an attack by creating a map that has extra entities (the person who crashed my client only wanted to cheat by having extra health boosts, not to crash my client).

So, I'm glad its fixed (otherwise I would not have provided clues as to how it can be exploited in the above). In general any time anything is sent through the network (client to server, or vice versa) that is an index into any sort of array that value should be checked (I realize I may be stating the obvious, but it may be a good place to start if someone wants to search through the code).

reply to this message

#1502: Just getting started with source

by Pxtl on 06/19/2006 20:09

I was gonna tinker with the source, but I can't get the thing to compile under VC Express. The linker keeps complaining about missing symbols for the Windows stuff. Any idea what version of the Windows SDK I'm supposed to be using for this?

reply to this message

#1503: Re: Just getting started with source

by Passa on 06/19/2006 23:10, refers to #1502

I gave up with VC Express and *cough* 'bought' a copy of Visual Studio 2005.

reply to this message

#1504: Re: Just getting started with source

by Pxtl on 06/19/2006 23:28, refers to #1503

Nuts. I think I'm close - I got it linking against the Windows SDK (a whole gig download) but it still complains about those symbols. Wouldn't that only happen if the header didn't match up with the libs? But I've got it pointing to all the SDK stuff. So I'm confused.

reply to this message

#1505: Server crash

by virtualblackfox on 06/20/2006 01:31

Today i had a crash to my server do to a cheater, here is what appened :

---------------------------
client connected (168-103-233-110.ptld.qwest.net)
[NewPlayer] Name: Paul
status: 6 remote clients, 13.2 send, 2.7 rec (K/sec)
[MapChange] New map:
[Chat] . : gg
[Chat] . : lol
status: 6 remote clients, 14.2 send, 2.8 rec (K/sec)
[MapChange] New map:
status: 6 remote clients, 17.1 send, 3.4 rec (K/sec)
status: 6 remote clients, 17.8 send, 3.5 rec (K/sec)
disconnected client
[MapChange] New map:
status: 5 remote clients, 11.0 send, 2.7 rec (K/sec)
[MapChange] New map:
status: 5 remote clients, 9.9 send, 2.4 rec (K/sec)
status: 5 remote clients, 9.8 send, 2.4 rec (K/sec)
[MapChange] New map:
status: 5 remote clients, 9.3 send, 2.3 rec (K/sec)
[MapChange] New map:
status: 5 remote clients, 9.0 send, 2.2 rec (K/sec)
status: 5 remote clients, 8.6 send, 2.1 rec (K/sec)
status: 5 remote clients, 8.3 send, 2.0 rec (K/sec)
status: 5 remote clients, 9.0 send, 2.2 rec (K/sec)
client connected
[NewPlayer] Name: Homo
disconnected client
disconnected client
client connected
[NewPlayer] Name: .
status: 5 remote clients, 10.0 send, 2.2 rec (K/sec)
[MapChange] New map:
disconnected client
status: 4 remote clients, 8.4 send, 2.3 rec (K/sec)
client connected
[NewPlayer] Name: Rareware
sending request to sauerbraten.org...
masterserver reply:

your server was registered
[NameChange] Rareware -> Homonculus
[MapChange] New map:
status: 5 remote clients, 9.5 send, 2.5 rec (K/sec)
[Chat] . : paul you are a cheater
[Chat] Homonculus : goddamn respawn limit
[Chat] Homonculus : >:I
[Chat] Homonculus : this is retarded :3
status: 5 remote clients, 11.2 send, 2.8 rec (K/sec)
[Chat] . : dnx, kick paul please
disconnected client
[MapChange] New map:
[Chat] . : paul go home
status: 4 remote clients, 8.8 send, 2.6 rec (K/sec)
[Chat] Paul : sorry
status: 4 remote clients, 7.1 send, 2.3 rec (K/sec)
[MapChange] New map:
disconnected client
client connected
[NewPlayer] Name: .
disconnected client
client connected
[NewPlayer] Name: .
disconnected client
status: 3 remote clients, 6.1 send, 2.0 rec (K/sec)
client connected
[NewPlayer] Name: .
client connected
[NewPlayer] Name: unnamed
status: 5 remote clients, 7.2 send, 2.1 rec (K/sec)
[Chat] . : /kick Paul
[Chat] . : doesn't work :(
[MapChange] New map:
status: 5 remote clients, 9.8 send, 2.4 rec (K/sec)
[Kick] dnx
client (168-103-233-110.ptld.qwest.net) disconnected because: kicked/banned

disconnected client (168-103-233-110.ptld.qwest.net)
---------------------------

My server does some printf on events so you could see what appened.

After the last line (dnx having kicked the cheater) the server crash with this stack trace :

---------------------------
sauerbraten_debug.exe!fpsserver::captureserv::movebases(const char * team=0x00000108, const vec & oldpos={...}, const vec & newpos={...}) Line 381 + 0x3 bytes C++
sauerbraten_debug.exe!fpsserver::captureserv::leavebases(const char * team=0x00000108, const vec & o={...}) Line 396 C++
sauerbraten_debug.exe!fpsserver::clientdisconnect(int n=0) Line 596 C++
sauerbraten_debug.exe!serverslice(int seconds=1150756441, unsigned int timeout=5) Line 439 + 0x1c bytes C++
sauerbraten_debug.exe!initserver(bool dedicated=true) Line 532 + 0x12 bytes C++
---------------------------

When i break i see some things :
"char * team=0x00000108" is an invalid adress (just a function offset on NULL pointer) due to the fact that getinfo returned NULL (because clients[i]->type==ST_EMPTY).

So we have a playing client (num=0) that had type==ST_EMPTY but i don't known how he managed to do that. Also note that if m_capture has been false no crash would have hapened.

I don't known if it was something wanted by the cheater by some reason or if it is just a random bug that hapenned to a cheater but could have hapenned to everyone.

Just adding a "if (ci == NULL) return;" could solve this particular problem but it think that maybe it is a chance to find the root cause.

I will let my debugger breaked on this error till tomorrow so if you have questions about the program state just ask (too late for me to do debugging :D)

reply to this message

#1506: Re: Server crash

by Passa on 06/20/2006 02:19, refers to #1505

That guy was hacking on my server too. And thats a bug with the current binaries, luckily I got a patch for Windows for my server, so if you guys want a more stable server, head over to mine for now, or ask eihrul to give you a patch.

Thats the same IP of the guy who was hacking for me. Hes a dumbshit, he just got that downloadable hack that someone posted a link to.

reply to this message

#1507: ..

by virtualblackfox on 06/20/2006 09:33

I patched with the changes in CVS i hope that the correction was commited.

Anyway eihrul i will be happy to known from where this crash really come from.

For the cheaters i don't mind them to connect to my server because most of the time waiting a few minutes is enough to see them go but if they crash the server it really annoy me :-D.

reply to this message

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2021
website by SleepwalkR © 2001-2021
42368208 visitors requested 58075066 pages
page created in 0.042 seconds using 9 queries
hosted by Boost Digital