Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - QwazyWabbit

Pages: 1 ... 7 8 9 10 11 12 13 14 15 16 [17] 18 19 20 21 22 23 24 25 26 27 ... 82
Quake / Re: Quake runs 100% CPU, why?
« on: January 26, 2014, 07:50:55 PM »
Virtually all Q2 clients and servers are single threaded. I have never heard of anyone making a multi-threaded version. There are lots of things in Q2 that aren't thread safe and there's never been a need for it since round-robin single thread seems to work just fine.

That being said, there's nothing in Q2 to make it NOT use multiple cores. SMP is invisible to the code in Q2 so it doesn't know how many cores are running the code but there is still only one core running one thread of a Q2 process at any instant. Setting processor affinity doesn't buy you anything. You gain a little less time swapping between cores but you lose that gain if the core you have selected was used to run a different process and the Q2 process has to wait.

All my servers on Windows run at a fraction of CPU percent, just as in Linux. Same thing goes for an idle client but when it's active it does increase CPU load and it does increase fan RPM. No 100% loading though. (i7 860 @ 2.8GHz)

If you are seeing 100% CPU usage in Windows on an idle Q2 server then you have screwed up your Windows scheduling or messed with the code in Q2 to cause it. Either that, or your running a computer from 1986.

Q2 Training Camp / Re: A Quake2 Theory Guide By Peter Briggs
« on: January 18, 2014, 06:56:04 PM »
I never followed the dueling scene so I have no idea who this guy was. It's nice to know he retired with a good opinion of himself. I read his work with interest and it was hard to get past some of the spelling errors (stirs for stairs) and the bragging about inventing tactics but it was informative.

Science / Re: The Ye Science Thread
« on: January 05, 2014, 09:52:48 AM »
The FTL neutrino beam experiment was proved to be an error in the experiment. Einstein prevails again.

There's always the problem of preserving player state across the servers.

The name of Co-op means what it says: Cooperation. When someone jumps the map prematurely he's not being cooperative. He should pay a price and that price should be suspension between maps until the other players follow, the server shouldn't just pop maps at the crossing of the exit, but that 's just my opinion and it would take a code change.

As for spoilers, re-crossing the map exits multiple times should earn them a 24 hour kick-ban. This would probably be relatively easy to do in the TS realm with Wallfly but would take a server code change elsewhere.

Multiple servers are problematic. There are 64 maps in the base collection of the original Q2 game. It would take 64 server threads or processes to contain them all. You might be able to limit the server chain horizon to 3 or 4 maps, with the idea that only 3 servers would run or only the number of servers would exist to support the number of occupied maps but then the problem would be managing the idiots who would race ahead opening new maps just for the hell of it.

At Clan WOS, we developed off-world teleport entities and support code that allows for the creation of teleport pads that would connect a player who entered the teleport to be connected to a new server. This is a self-contained set of source files and a fairly simple mod to the game DLL. The original concept allowed for launching into a completely different game client but I never implemented that capability because I wasn't sure how to quit Q2 and launch the new client simultaneously without complications. The beauty of the off-world technique discussed there was that it doesn't require any cooperation from the target servers and the entities can be added to maps using the r1q2 override capability without changing the map files.

The remaining problem of the multiple-server or teleport-to-server solution is carryover of player state, something already built into coop Q2.

Religion, and the Changing Moral Zeitgeist / Re: Ye Religion Thread
« on: January 01, 2014, 04:04:31 PM »
Proof that the monotheistic religions of Judaism, Islam and Christianity are regressive, repressive and dogmatic religions that have done more to set mankind back than to advance thought, science and equality for all human beings.

/dev/random / Re: Hot bitches
« on: December 31, 2013, 10:28:46 PM »
Since the name of the image file is Catrinel-Menghia.jpg, that would be a pretty good guess.

Jokes / Re: Formal Logic
« on: November 21, 2013, 03:29:29 PM »
Formal Logical of game theory is similar the fundamental condition of existence
That is: P or Q, but not both.

This is P XOR Q. The exclusive or function is Boolean function. How is this related to game theory? Post your answer, explain your result in 50 words or less.

0x1337c0de / Re: Getting started with the Quake 2 source
« on: September 21, 2013, 11:34:07 PM »
Necrotic thread but I watched your video and I never saw you actually compile your project. You created a project and opened the files in the editor but I never saw you run LCC.

The compiler (if it's keeping to its Linux roots) will evaluate the Makefile and use it as a guide to build the project.

In Linux, the command is done from a shell window in your project source folder and the command is simply 'make'. The make progam looks for Makefile and that file tells it what files to use to build the project and what to call it.

As it says in the instructions you were following, the DLL will be located in the source directory where you built it. The gamex86.dll files are always located in the mod folder for their respective mods. When you tell the quake2.exe what mod to run with the +set game mymodname command line the engine will look into the mymodname folder for your DLL, expecting it to be named gamex86.dll, it loads that DLL and that becomes the modification to the game engine and your running your mod.

OK, so I'm a curious guy and I have some time on my hands tonight so I installed LCCWin and copied the Quake2 v3.21 source into the lcc folder in one big chunk since I don't know where your Combat18 mod source is.

OK, I followed it all up to the point of adding the game.def file and since I was using the "working" game.def as-is from my copy of the Q2 sources I left it alone. Later I tried to write GetGameAPI=GetGameAPI into the file but Wedit but it wouldn't make the change. I don't believe it needs to read that way anymore. I believe that was the old VC 6.0 syntax.

Anyway, once you have all your files "loaded" into wedit, you need to build the project.

Click Compiler, Generate Makefile.The system will create the Makefile.
Click Compiler, Rebuild All. The compiler will run scrolling output to a split window in wedit, finally ending in a list of warnings and errors.

Errors will stop the build process. Warnings won't. Double clicking on a warning or error line will take you to the source file where the warning occurred. If you have so much as one error, your dll won't be built, don't look for it. Warnings are permissible and you can deal with them as needed. I am strict about my code, I want it to produce no warnings so I will investigate and fix them.

If you don't see "Return code: 0" at the bottom of the warnings list, you don't have a DLL.

The ultimate question is Where's my DLL? The answer to that question is found in the wedit project configuration.
Click Project, Configuration and then the Linker tab. The output filename you find there is where your DLL will be if there were no errors in the build. I ended up finding it at c:\lcc\Quake2source\game\lcc\gamex86.dll.

I also found all the .obj files in that same folder. The .obj files are built by the compiler from each source file.

0x1337c0de / Toward a Better MOTD
« on: September 21, 2013, 07:37:41 PM »
LOX has a feature that sends a motto of the day (MOTD) to players when they connect. This code was originally in-line in the ClientBeginDeathmatch function and it was an UGLY part of an otherwise simple ClientBeginDeathmatch function.

Today I decided to clean it up a bit, make it a callable function and publish it for use by other mod developers who might be interested in using a MOTD in their mod. I don't know where the original code came from, it was a part of LOX from a very long time ago and also exists in WODX and presumably WOD from where LOX and WODX derive their pedigree.

ClientBeginDeathmatch isn't called frequently so there is no advantage to writing the code in-line and avoiding a function call. It also goes against discipline to write something in line where a function will be more advantageous and the resulting code much more clear.

The ClientPrintMOTD function prototype belongs at the top of p_client.c or in g_local.h if you intend to access it globally:
void ClientPrintMOTD (edict_t *ent);
The function body belongs in p_client.c:
Code: [Select]
// Store the message of the day in memory.
char *gMOTD = ((char *)-1); // initialized at startup as bad pointer
cvar_t *motdfile;

void ClientPrintMOTD (edict_t *ent)
FILE *in;
char motdPath[MAX_QPATH + 1];
int c;
int motdBytes;
char *here;

// If the MOTD hasn't been loaded, do so.
if (gMOTD == ((char *)-1))

// Generate the path to the MOTD file.
if (gamedir == NULL || motdfile == NULL
|| !gamedir->string[0] || !motdfile->string[0])
gMOTD = NULL; // null pointer means we'll never try again

sprintf (motdPath, "./%s/%s", gamedir->string, motdfile->string);

// Open the file.
in = fopen (motdPath, "rt");
if (in == NULL)
gi.dprintf("Opening MOTD file failed, error: %i.\n", errno);

// Count the number of bytes in the file.
motdBytes = 0;
while ((c = fgetc (in)), c != EOF)

// Make space for that many bytes.
gMOTD = gi.TagMalloc (motdBytes + 1, TAG_GAME);
gi.dprintf("Allocating %i bytes for MOTD\n", motdBytes +1);

// Now read the MOTD in for real.  Null-terminate the string.
fclose (in);
in = fopen (motdPath, "rt");
here = gMOTD; //extra pointer for writing into gMOTD
while ((c = fgetc (in)), c != EOF)
*here = c;
*here = '\0';

// If anything went wrong, warn the console.
if (motdBytes != 0)
gi.dprintf ("MOTD error: off by %d bytes", motdBytes);

if (gMOTD != NULL) // If a MOTD was successfully loaded, print it.
gi.centerprintf (ent, "%s", gMOTD);

Define the necessary CVAR in GameInit:
Code: [Select]
motdfile = gi.cvar ("motdfile", "motd.txt", 0);

Add the CVAR to g_local.h:
Code: [Select]
extern cvar_t *motdfile;

Restore the ClientBeginDeathmatch to it's original beauty.
Code: [Select]

A client has just connected to the server in deathmatch
mode, so clear everything out before starting them.
void ClientBeginDeathmatch (edict_t *ent)
G_InitEdict (ent);
InitClientResp (ent->client);

// locate ent at a spawn point
PutClientInServer (ent);

if (level.intermissiontime)
MoveClientToIntermission (ent);
// send effect
gi.WriteByte (svc_muzzleflash);
gi.WriteShort (ent-g_edicts);
gi.WriteByte (MZ_LOGIN);
gi.multicast (ent->s.origin, MULTICAST_PVS);
gi.bprintf (PRINT_HIGH, "%s entered the game\n", ent->client->pers.netname);


// make sure all view stuff is valid
ClientEndServerFrame (ent);

You will notice the ClientPrintMOTD function has a trapdoor in the gMOTD pointer. It's initialized at definition to -1 and the function sets it to NULL if there's a problem initializing the cache it is supposed point to that contains the MOTD text. I'm not sure I would have done it exactly that way but you may see a modified version later, I decided to publish this as-is and may polish it up another time. The trapdoor closes the first time the function is called and the gMOTD pointer either points to a valid MOTD string or it is NULL. The trapdoor prevents the function from taking the time to open/read/close the motd.txt file every time someone connects. The problem with this technique is that if you change the MOTD file you must restart the server to get it to read it again and update the cache.

Add a motd.txt file to your server's mod folder and enjoy your center-printed MOTD.

Quake / Re: my server no longer shown on
« on: May 25, 2013, 09:33:21 AM »
I'm not the OP. (original poster). i was just sharing information with the OP on the masterservers from my config. i only host 1 server. it is a local one. i have no problem with seeing it in the q2server browser.

 fish is having problems. i just figured he didn't have the right master servers in his config. there seemed to be a little confusion as a result :confused: .. my mistake. disregard that. so now that's out of the way, you can concentrate on his issue.

"setmaster" what is wrong with this master server? i posted this on my 1st post.

There is nothing wrong with that server. But you need to view the list of servers on or with R1ch's Quake2 Server Browser, a Windows application.

If you keep seeing nothing but heartbeat messages then your firewall settings are incorrect. You must open the Quake2 server port (27910 by default) for UDP inbound and outbound.

Quake / Re: my server no longer shown on
« on: May 25, 2013, 01:21:36 AM »
Sheesh. :mrdead: I didn't pay close enough attention to the threading. I hate web forums for that reason. One of these days someone is going to invent a way for web forums to display threaded posts.

Fishxz can use the information from my last post to figure it out, I'm sure.

Quake / Re: my server no longer shown on
« on: May 25, 2013, 01:06:16 AM »
I see one server,, Golgo13's Lithium CTF.


yea, i dunno dude. those are just acknowledges from the masters i thought. you're better at techical jargon. i just put what was showing in my console. :smiley_feet:

I don't know what this means. You didn't answer any of my questions about your servers and IP's. I am telling you I see one server in your name on the active servers list. If you have more, tell us what they are named and what their IP's are. If they are hosted on the same computer you are going to have problems if you don't properly configure them and open your ports on your router for them.

You appear to have only one valid server active and listed.

The server/master handshake looks like this:

server                 master
           ->ping->             server pings master until it receives ack
           <- ack <-
master prepares to poll server

master polls server periodically once it has listed the server as active:

           <- ping <-         master pings server to see if it's alive
           -> ack ->          server is alive
          <- status <-      master asks for game status
           -> print ->       server sends game status and variables (player list, etc.)
           <- ack <-

Between pings and status dialogs, every 5 minutes the server sends a heartbeat frame to the master.

        ->heartbeat ->
           <- ack <-

... repeat

If this handshake fails the master will not list the server. It can take several tries before a master will list a server as active since this all occurs on UDP and delivery is not guaranteed by the protocol.

At server shutdown the server sends a "shutdown" frame to the master and terminates the process and the master deletes the server from the list. The server does not expect an ack to the shutdown frame. The master will delist the server immediately if it receives the shutdown frame but if it doesn't receive the shutdown frame it can take 10 minutes for the master to delist the server. If a server crashes unexpectedly the master will delist the server after it fails to receive acks to its pings.

What you will see in your console if this is all working as expected:

Ping acknowledge from
Sending heartbeat to
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Sending heartbeat to
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Ping acknowledge from
Sending heartbeat to
Ping acknowledge from
Ping acknowledge from

Quake / Re: my server no longer shown on
« on: May 24, 2013, 06:13:44 PM »
I see one server,, Golgo13's Lithium CTF.

Quake / Re: my server no longer shown on
« on: May 24, 2013, 12:20:47 PM »
The listmasters results you show would indicate you are communicating with the master. If you are communicating the number in the lastmsg column will change each time you use the listmasters command.

The setmaster result says otherwise.

All the other servers you have listed no longer exist as happy friar points out. doesn't respond as a Q2 master server.

The owner of is R1ch. He may respond if you post you question on his forum.

Check your firewall settings on the servers, if they are hosted sometimes hosting companies will block outbound traffic on the ports Q2 uses.

Make sure you aren't filtering your server list too. R1ch's quake 2 server browser remembers the filter settings and caught me off guard a couple of times.

What are your server names and IP addresses? I will take a look too.

Quake / Re: my server no longer shown on
« on: May 23, 2013, 10:11:59 PM » has been gone for at least a year. I took it off my configurations that long ago when I noticed it wasn't responding to my server pings. The domain is still valid but the subdomains or are no longer registered.

fishxz: r1q2dedicated defaults to without the need for it to be set with the setmaster command. I don't know if this is true for q2pro but it might be worth looking into. I know q2pro was following r1ch's development and using many of his changes. I still prefer r1q2 as a server, though. Check the server console logs and see if the server is acknowledging your server pings. You can see it in the server console stream if you set con_filterlevel 0, if q2pro supports the con_filterlevel and logfile_filterlevel that exist in r1q2.

You should also check that the domain name is properly resolved on your Q2 server machine.
Use nslookup to be sure it resolves.

If your servers are properly reaching you will get: "Ping acknowledge from" in your log stream. If the server can't resolve the IP address of a master server r1q2 server will print "Bad address: ..." in the console.

Also, commanding "setmaster" in the console of r1q2 will force a ping of the master server, thus:
Sending heartbeat to
Ping acknowledge from

If sv_global_master is 1, r1q2 will automatically use as its master.

I do not know if there are any other valid q2 master servers in existence.

One of the nice commands in q2pro server is the "listmasters" command which will tell you if the master is communicating with your server. This command doesn't exist in r1q2.

Pages: 1 ... 7 8 9 10 11 12 13 14 15 16 [17] 18 19 20 21 22 23 24 25 26 27 ... 82