Pages: [1]
  Print  
Author Topic: Error: Too many cvars, cannot create a new one!  (Read 17600 times)
7
Member


Cakes 7
Posts: 278


Is 7 up?


« on: June 28, 2010, 01:12:41 PM »

OA 0.8.5 crashes on me when I join or start a mod game like E+. I know this happens because I define a lot of cvars in my scripts, but up until version OA 0.8.5 this never was a problem so I guess OA itself defines a lot more cvars than previous versions did.

From the crashlog:
Code:
----- CL_Shutdown -----
OpenAL capture device closed.
RE_Shutdown( 1 )
-----------------------
----- Server Shutdown (Server fatal crashed: Error: Too many cvars, cannot create a new one!) -----
==== ShutdownGame ====
AAS shutdown.
---------------------------
Error: Too many cvars, cannot create a new one!

I have removed all unnecessary stuff from my scripts already, but they are still too big to play the mods. I've been using these scripts for years and I'd very much like to be able to keep using them.

I've glanced over the OA source briefly and I think this is just a matter of cranking up the value of the MAX_CVARS macro in code/qcommon/cvar.c, so please, please, pretty please developers, could you fix this in the next release?
Logged

I'm on the ten most wanted list, I've got it dead in the groove.
My face is on every wanted poster in town, for the way I move.
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #1 on: June 28, 2010, 02:16:28 PM »

As a workaround, have you already tried to start the mod from the command line (openarena.exe +set fs_game modfolder), instead of using the "Mods" menu? Once it worked for me...
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #2 on: June 28, 2010, 02:24:54 PM »

The 0.8.5 binaries should have an equal or higher limit than before. Also the binaries should clean cvars during mod change.

Previously we was a rather long way from the number limit, it was always the 16 kiB limit that was the problem. That limit was increased to 128 kiB in 0.8.5. 
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #3 on: June 28, 2010, 02:45:02 PM »

Anyway, once I had this problem with Alternatefire mod. A first workaround was to start it from command line, and I resolved the problem deleting its quake3.cfg file and let it recreate it. I don't know exactly what it didn't like...
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
7
Member


Cakes 7
Posts: 278


Is 7 up?


« Reply #4 on: June 28, 2010, 03:30:29 PM »

Anyway, once I had this problem with Alternatefire mod. A first workaround was to start it from command line, and I resolved the problem deleting its quake3.cfg file and let it recreate it. I don't know exactly what it didn't like...

I've tried starting from the command line before but that makes no difference, deleting the q3config.cfg first doesn't either. The problem really is an abundance of cvars. In a default q3config.cfg there are 408 cvars already:
Code:
grep -c 'seta ' ~/.openarena/baseoa/q3config.cfg
408
With the E+ mod the count is up to 442 cvars.

I wrote scripts so I can in- and decrease net related parameters like cg_projectilenudge in 5 ms steps using keyboard keys and this takes a lot of cvars (one for each possible cg_projectilenudge value for instance). Having 408 cvars to start with, it's not difficult to bump into the 1024 maximum this way.

edit:
I have checked a default ioquake3 v1.36 q3config.cfg also, and it contains 262 cvars, so OA has 146 cvars more.
Logged

I'm on the ten most wanted list, I've got it dead in the groove.
My face is on every wanted poster in town, for the way I move.
GrosBedo
Member


Cakes 20
Posts: 710


« Reply #5 on: July 01, 2010, 02:12:35 PM »

The limit concerns only one file, so just split up your config amongst multiple files using /exec mainconfig1.cfg, /exec mainconfig2.cfg etc...

You can find an example of a config that is spit up in several parts :
http://superbots.co.cc/modules.php?name=Downloads&op=getit&lid=16
Logged
7
Member


Cakes 7
Posts: 278


Is 7 up?


« Reply #6 on: July 02, 2010, 06:40:01 AM »

My config is already split up into 10 different modules/files and one master file to exec them all. I really hit the maximum number of cvars because OA defines so many of them to start with.
Logged

I'm on the ten most wanted list, I've got it dead in the groove.
My face is on every wanted poster in town, for the way I move.
GrosBedo
Member


Cakes 20
Posts: 710


« Reply #7 on: July 02, 2010, 01:33:34 PM »

My config is already split up into 10 different modules/files and one master file to exec them all. I really hit the maximum number of cvars because OA defines so many of them to start with.

Then the question is : why do you need so many cvars ? If that's for different mods, you can avoid calling them at start, and call when needed with exec.

But indeed, I never saw this error and I think it could be cool to see if it can be patched in the engine, but then you should report that to ioquake3.
Logged
7
Member


Cakes 7
Posts: 278


Is 7 up?


« Reply #8 on: July 03, 2010, 03:02:19 AM »

Then the question is : why do you need so many cvars ?

Because I want to be able to change parameters like r_gamma and cg_projectilenudge without dropping the console each time. This takes a lot of cvars because for every possible value you have to define one.

Let me state again: these scripts worked for years without errors in OA, but with version 0.8.5 they don't because AO says I define too many cvars. In reality its not me defining more cvars than before but OA. I've cut down the number of cvars in my scripts by more than 10% already and I can't shave off more without crippling the scripts.
« Last Edit: July 03, 2010, 04:19:56 AM by 7 » Logged

I'm on the ten most wanted list, I've got it dead in the groove.
My face is on every wanted poster in town, for the way I move.
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #9 on: July 05, 2010, 03:56:28 AM »

This bug sucks for playing UIEnhanced. Agreed, engine patch.

*cough*limits on excessive bot files(ignoring bot entries from more files requiring merging botfiles into little 8kb .bot files to get around this), player models and shaders could be lifted too*cough* though for player models, that's a different topic
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Falkland
Member


Cakes 6
Posts: 590


« Reply #10 on: July 05, 2010, 10:48:43 AM »

ioquake3 uses 16KB for the command buffer ; UrT and defrag engine use 64KB ; OA use 128KB but since it doesn't seem to be enough the buffer can be expanded to 1MB for example :

Code:
--- ioquake3/code/qcommon/cmd.c 2009-09-15 15:38:49.000000000 +0200
+++ ioquake3_oa/code/qcommon/cmd.c 2010-04-25 18:46:46.000000000 +0200
@@ -24,7 +24,7 @@
 #include "q_shared.h"
 #include "qcommon.h"
 
-#define MAX_CMD_BUFFER 16384
+#define MAX_CMD_BUFFER 0x100000 // 1MB
 #define MAX_CMD_LINE 1024
 
 typedef struct {

Or a more sofisticated code with a new cvar could make it dynamically expandable starting by the actual OA value . Anyway in this case it should be also defined a high limit for obvious reasons.
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #11 on: July 05, 2010, 11:11:07 AM »

no 1mb buffer. if uie can't get through on a big buffer yet can on a small one (stock q3) there's no reason for it
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Falkland
Member


Cakes 6
Posts: 590


« Reply #12 on: July 05, 2010, 11:34:56 AM »

no 1mb buffer. if uie can't get through on a big buffer yet can on a small one (stock q3) there's no reason for it

- The topic is about the reached limit for creating new cvars
- The buffer limit is responsable for this error
- 128KB which is the default OA engine value is not enough
- "This bug sucks for playing UIEnhanced. Agreed, engine patch." : fromhell©
- How do you think to solve it if not by expanding the buffer ?
Logged
GrosBedo
Member


Cakes 20
Posts: 710


« Reply #13 on: July 07, 2010, 02:05:28 PM »

- How do you think to solve it if not by expanding the buffer ?

It seems not related to buffer since it was expanded in this release, and the bug happens in the new release, but not the older ones.
Logged
Falkland
Member


Cakes 6
Posts: 590


« Reply #14 on: July 07, 2010, 03:52:10 PM »

- How do you think to solve it if not by expanding the buffer ?

It seems not related to buffer since it was expanded in this release, and the bug happens in the new release, but not the older ones.

It could be probably related to this since cvars management is changed a bit because of the 2 ioquake3 fixes against mod cvars pollution and the READONLY cvars not writeable anymore.

I guess cvars are now managed separately for every mod , even if they or part of them are the same of baseoa or of the previous loaded mod.

My suggestion is to increase a bit more the size of the buffer , recompile the engine and see if it solves this problem. If not , then the buffer is not the cause of the bug.
Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #15 on: July 07, 2010, 05:03:44 PM »

It should be noted that the count limit is increased in the latest test binaries... you might try it to see if it is the problem.

http://openarena.ws/board/index.php?topic=1933.0
Logged

There are nothing offending in my posts.
Neon_Knight
In the year 3000
***

Cakes 49
Posts: 3775


Trickster God.


« Reply #16 on: March 14, 2011, 01:31:23 PM »

Bump!

It happens with Threewave CTF. Any time I want to start a match, it closes and shows this error.
Logged


"Detailed" is nice, but if it gets in the way of clarity, it ceases being a nice addition and becomes a problem. - TVT
Want to contribute? Read this.
Pages: [1]
  Print  
 
Jump to: