Frikbot / QW
Moderator: InsideQC Admins
25 posts
• Page 1 of 2 • 1, 2
Frikbot / QW
I got a tough one here.
I'm running / attempting to run a QW server with Frikbots.
Right now when someone logs in a bot is formed:
===========
ClientConnect
called when a player connects to a server
============
*/
void() ClientConnect =
{
ClientInRankings(); // FrikBot
bprint (PRINT_HIGH, self.netname);
bprint (PRINT_HIGH, " entered Spisi's Fragfest!\n");
// a client connecting during an intermission can cause problems
if (intermission_running)
GotoNextMap ();
stuffcmd(self, "impulse 100;\n"); //adds a bot when player connects to server
The problem arises when a second client attempts to log on. The server crashes every time when a client attempts to log on while there is an active bot.
Can someone point me in the right direction to solve this issue?
I'm running / attempting to run a QW server with Frikbots.
Right now when someone logs in a bot is formed:
===========
ClientConnect
called when a player connects to a server
============
*/
void() ClientConnect =
{
ClientInRankings(); // FrikBot
bprint (PRINT_HIGH, self.netname);
bprint (PRINT_HIGH, " entered Spisi's Fragfest!\n");
// a client connecting during an intermission can cause problems
if (intermission_running)
GotoNextMap ();
stuffcmd(self, "impulse 100;\n"); //adds a bot when player connects to server
The problem arises when a second client attempts to log on. The server crashes every time when a client attempts to log on while there is an active bot.
Can someone point me in the right direction to solve this issue?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
IFNOT 12540(foe)entity 2 branch 44
bot_fight.qc : bot_dodge_stuff
bot_ai.qc : BotAI
bot_phys.qc : PostPhysics
<NO FUNCTION>
runaway loop error
SV_Error: Program error
That's the error that shows up in the server console.
bot_fight.qc : bot_dodge_stuff
bot_ai.qc : BotAI
bot_phys.qc : PostPhysics
<NO FUNCTION>
runaway loop error
SV_Error: Program error
That's the error that shows up in the server console.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
unfortunatly this is not a newly discovered bug, and is fairly fundemental in explaining why frikbots never gained any real popularity in the qw scene.
Aaaanyway, the problem boils down to the QW engine trying to be a bit cleaner than NQ.
There's a bit where it clears ALL the entities fields before calling SpawnClient instead of only a few.
This means that some field on the frikbot is cleared and results in the player entity ultimatly linking to itself in the linked list marked with the player_head global. Which results in runaway loop errors.
The easiest solution is to rebuild the list entirly each time, rather than just adding to it. Or just using find instead of the list.
Alternativly you could spawn the bots from entities spawned via the spawn() builtin instead of finding unused player entities.
Unfortunatly with just relinking, there's a small time period where the list will be broken (disconnect at the 'right' time and it'll never be fixed). So you're best off removing the player_head global and fixing the code around it (nextent 32 times maybe?).
Or you can edit the engine, find the offending memset, and comment it out. (SV_Spawn_f in sv_user.c should be where it happens)
Aaaanyway, the problem boils down to the QW engine trying to be a bit cleaner than NQ.
There's a bit where it clears ALL the entities fields before calling SpawnClient instead of only a few.
This means that some field on the frikbot is cleared and results in the player entity ultimatly linking to itself in the linked list marked with the player_head global. Which results in runaway loop errors.
The easiest solution is to rebuild the list entirly each time, rather than just adding to it. Or just using find instead of the list.
Alternativly you could spawn the bots from entities spawned via the spawn() builtin instead of finding unused player entities.
Unfortunatly with just relinking, there's a small time period where the list will be broken (disconnect at the 'right' time and it'll never be fixed). So you're best off removing the player_head global and fixing the code around it (nextent 32 times maybe?).
Or you can edit the engine, find the offending memset, and comment it out. (SV_Spawn_f in sv_user.c should be where it happens)
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
The QW version was a 2 hour hack. For that reason, I don't 'officially support it'.
I didn't want to go around assuming the QC code classnamed all the players "player", which is why any find loops were dropped. You need to rebuild the list with nextent I guess.
Or just using find instead of the list.
I didn't want to go around assuming the QC code classnamed all the players "player", which is why any find loops were dropped. You need to rebuild the list with nextent I guess.
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
/me comes out of a giant fast food franchise mascot statue
1 mill - er, uh, 1 HUNDRED BILLION DOLLARS!!! Bwahahahahahaha!!!
/me strikes Dr. Evil-esque pose replete with the pinky finger thing
1 mill - er, uh, 1 HUNDRED BILLION DOLLARS!!! Bwahahahahahaha!!!
/me strikes Dr. Evil-esque pose replete with the pinky finger thing
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
redrum wrote:Is this asking too much? Sorry if it is.
Just the mere thought of setting right what QW set wrong would drive me insane. Not to mention you would have to require anybody who connects to use the same fixed engine.
Basically, if you want something more modder friendly, switch to regular quake.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Well what he's asking for is a fixed FrikBot, not a fixed QuakeWorld. And I suppose I could accommodate, QW limits me a lot, but not completely. It's just not a battle I really ever had my heart in engaging. Bots are typically for offline single player and QuakeWorld is for multiplayer, so the whole general thing never really seemed necessary and/or redundant.
The original QW FrikBot was born out of a desire to make a bot to play JBallou's FBI because at the time it was QW based and I was making FrikBot play all the MDQNet mods. It continued as a half assed port up until FrikBot 0.08 when I decided I hated keeping around the out-of-date crappy QW version, and decided to, for the most part, integrate it with the main bot code. In theory. In practice, there's always issues that crop in the QW version that I scramble to fix in the final released. FBX's QW support is more or less identical to 0.09, meaning I spent about the whole of 2 hours fixing it ( it was for the Qexpo crunch).
The original QW FrikBot was born out of a desire to make a bot to play JBallou's FBI because at the time it was QW based and I was making FrikBot play all the MDQNet mods. It continued as a half assed port up until FrikBot 0.08 when I decided I hated keeping around the out-of-date crappy QW version, and decided to, for the most part, integrate it with the main bot code. In theory. In practice, there's always issues that crop in the QW version that I scramble to fix in the final released. FBX's QW support is more or less identical to 0.09, meaning I spent about the whole of 2 hours fixing it ( it was for the Qexpo crunch).
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
FrikaC, that would be sweet if you could make the necessary adjustments!
Your bots are great, and I enjoy using skins which is why I prefer QW.
My mod is still new (just getting into coding). I would like that there would always be someone (a frikbot) on the server ready to do battle.
I would greatly appreciate it.
Your bots are great, and I enjoy using skins which is why I prefer QW.
My mod is still new (just getting into coding). I would like that there would always be someone (a frikbot) on the server ready to do battle.
I would greatly appreciate it.
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
25 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest
