Game Development Community

Mapping string" warnings/errors slow the game

by Ahmed@ · in Torque Game Engine · 02/09/2008 (4:22 pm) · 3 replies

I added about 50 Korks and I keep getting errors like "Mapping string: Kork2 to index: 13" which slow the game for a while and once the mapping finishes the game goes back to normal. I tried it with 10, 20, and 50 korks and sometimes it just keep going on for some time and I give up. Could someone please help.

Thanks

-------------------
new Item() {
      position = "421.992 369.401 226.951";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "AIPlayerMarker";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
new Item() {
      position = "421.992 369.401 226.951";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "AIPlayerMarker";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
Error output--------------
Mapping string: Kork2 to index: 13
Mapping string: Kork3 to index: 14
Mapping string: Kork4 to index: 15
Mapping string: Kork1 to index: 16
Mapping string: Kork20 to index: 17
.....

#1
02/09/2008 (5:40 pm)
These aren't errors. The game engine is telling the clients that the server will be sending string table index 13 instead of "Kork2" in all future communications. Think of it as data compression.

This is likely a very small part of everything that happens when you initialize a new AI character. (The time consuming portions are likely the many other jobs this task requires.)


Is your game going to be singleplayer-only or multiplayer?
Why did you include those AIPlayerMarker Item definitions in your post? If you happen to be creating 50 Korks all in the same place, well, that sounds like it could be Very Bad.
#2
02/10/2008 (4:01 am)
Thanks Matthew. It was just a quick way to see how Torque scales. What seems to happen is that the engine is sending more than one mapping for each Kork. Sometimes 19 times and sometimes about 39 times with different indexes. Any idea why it would do that?


Mapping string: Kork43 to index: 29
Mapping string: Kork50 to index: 11
Mapping string: Kork42 to index: 2
Mapping string: Kork37 to index: 18
Mapping string: Kork56 to index: 6
Mapping string: Kork36 to index: 25
Mapping string: Kork35 to index: 10
Mapping string: Kork34 to index: 0
Mapping string: Kork33 to index: 4COUT Mapping string: Kork50 to index: 28
Mapping string: Kork42 to index: 17
Mapping string: Kork51 to index: 3
Mapping string: Kork40 to index: 2
Mapping string: Kork53 to index: 25
Mapping string: Kork39 to index: 11
Mapping string: Kork54 to index: 23
Mapping string: Kork38 to index: 15
Mapping string: Kork55 to index: 24
Mapping string: Kork28 to index: 21
Mapping string: Kork1 to index: 22
Mapping string: Kork2 to index: 0
Mapping string: Kork29 to index: 9
Mapping string: Kork49 to index: 4
Mapping string: Kork43 to index: 19 ----------reasigned different index
#3
02/10/2008 (9:44 am)
You are still focusing on very much the wrong thing, hehe. This is not mapping Kork the character, the model, or anything else--ALL this line is talking about is the 6 characters K o r k X X, and how it is giving that string of characters an index, so that next time it has to send the data, it can send two characters (the index), not 6 (the string itself).

It does appear unusual that it's mapping it twice, but seriously--this has nothing to do with the model's performance, the sim's performance, or networking in general, other than those 6 letters (which ironically don't need to be sent again very much in the demo).

String mapping is a useful, but very minor optimization in the long run, and only serves to save a few bytes (well, sometimes quite a few if it's a long string like "adgr4adasdaihwerwf1426asfdaskfsdgsuhafajk" or something) when transmitting strings of characters across the network.

PS: It shouldn't be in red text, for this exact reason--someone probably did that way back when just to highlight the message, but it makes people think it's an error.