Back to the Vavoom Forum Archives


Forum

Player stats number limit

Wed, 30 Nov 2005 18:52:09

Crimson Wizard

Client_state_t structure allows to add up to 128 integers size of additional fields. In my progs exactly 100 integers are added, but when I launch game an error occurs, saying that number of stats is too big. I found out by testing that it allows no more than 96 fields. What the heck is this?? <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
Wed, 30 Nov 2005 22:29:10

Janis Legzdinsh

Yes, the number that you can add is 128, but the number of stats that is sent from server to client is limited to 96. It may be a bit confusing, since you don't have other reason to add fields to client_state_t structure.
Thu, 01 Dec 2005 13:05:17

Crimson Wizard

I was able to pass this restriction by a trick - using a pointer. Created a structure, that contains all my prog specific player attributes, and added to Player class both structure variable itself and a pointer to this structure. The pointer is sent to client (and structure - is not, ofcourse). However, I met another strange thing. The 'cl->pclass' variable is not working. It is always equal to PCLASS_FIGHTER for some reason.
Thu, 01 Dec 2005 18:43:59

Janis Legzdinsh

I was able to pass this restriction by a trick - using a pointer. Created a structure, that contains all my prog specific player attributes, and added to Player class both structure variable itself and a pointer to this structure. The pointer is sent to client (and structure - is not, ofcourse).
It's O.K. for single player, but it will crash multiplayer. If you project is ment for single player only, then it's fine.
Fri, 02 Dec 2005 09:09:08

Crimson Wizard

Oh, I was sure, that there must be something bad in this... <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> Well, and is there another way to have these 100 stats? I need most of them only for current player only, since I wish to make him able to read his Role-playing statistics thru menu.
Fri, 02 Dec 2005 17:24:40

Janis Legzdinsh

You can pack some variables with limited value range together.
Sat, 21 Jan 2006 14:43:16

Crimson Wizard

Well, it seems that my mod is for single player only. But please, can you answer on my question I asked some time earler:
The 'cl->pclass' variable is not working. It is always equal to PCLASS_FIGHTER for some reason.
Is it ok? Or maybe it is a bug?
Sun, 22 Jan 2006 11:49:33

Janis Legzdinsh

It appears to be unused, even status bar reads the console variable "class" directly.

Back to the Vavoom Forum Archives