Limit to the Number of Player Animation Sequences?
by Jerane Alleyne · in Torque Game Engine · 01/20/2003 (9:36 pm) · 2 replies
We've recently reached a total of 50 animation sequences (listed in Player.cs, not yet implemented in the player code) for our player, and ran across something peculiar. We get an 'Out of range write' error. What makes this odd is that when we get this error when we have more than 32 animations listed. When we remove or comment out the listed sequences up to about 32, the game runs fine.
I was wondering one of two things: Is there a limit to the number of animations set in the player code? I notice that there are about 30 animations in the default player for the demo. If there is a set limit, where might it exist in the code? The other thought I had was that the error was in response to listing sequences that were not implemented int the code (I should mention that I already have these sequences created, so there is not problem there. They show up fine in the model viewer), but we have had listed sequences that weren't implemented in the code before, and never got this error...perhaps because there are so many more past the limit (if there is one).
I thought I remember a post about the maximum number of animations in a player, but I can't find it. If there is one, I'd appreciate it if someone could point it out. Otherwise, if anyone knows something that could help, that would be equally great, if not better :)
Thanks a lot!!
I was wondering one of two things: Is there a limit to the number of animations set in the player code? I notice that there are about 30 animations in the default player for the demo. If there is a set limit, where might it exist in the code? The other thought I had was that the error was in response to listing sequences that were not implemented int the code (I should mention that I already have these sequences created, so there is not problem there. They show up fine in the model viewer), but we have had listed sequences that weren't implemented in the code before, and never got this error...perhaps because there are so many more past the limit (if there is one).
I thought I remember a post about the maximum number of animations in a player, but I can't find it. If there is one, I'd appreciate it if someone could point it out. Otherwise, if anyone knows something that could help, that would be equally great, if not better :)
Thanks a lot!!
#2
When TSShapeConstruct packs and unpacks data, it first writes the number of sequences out to the stream and then the names of the sequences: i.e. usually "fps/data/shapes/player/player_looknw.dsq looknw" you can see how the names are around 40 or more characters (and since we're not using wide characters, these names take up roughly 40-odd bytes each).
Unfortunately, it is trying to write out ALL the names of the sequences into the single stream it's been passed, and the stream was constructed to max out at MaxPacketDataSize number of bytes which is 1500. You can see that the number of sequences names of 40-50 characters it can fit into the one packet gets limited to ~30ish. If you used even longer names and paths, the number of sequences you could squeeze in would decrease.
To try and fix this, it would have to span multiple packets or to try and cheat it a bit, you can pass in the path (fps/data/shapes/player) part of the sequence filename separately to save space.
If you need help doing this, you can find me on IRC later. I've been awake too long and need sleep for work tomorrow.
01/22/2003 (1:34 am)
Since you aren't responding on IRC, I'm posting here:When TSShapeConstruct packs and unpacks data, it first writes the number of sequences out to the stream and then the names of the sequences: i.e. usually "fps/data/shapes/player/player_looknw.dsq looknw" you can see how the names are around 40 or more characters (and since we're not using wide characters, these names take up roughly 40-odd bytes each).
Unfortunately, it is trying to write out ALL the names of the sequences into the single stream it's been passed, and the stream was constructed to max out at MaxPacketDataSize number of bytes which is 1500. You can see that the number of sequences names of 40-50 characters it can fit into the one packet gets limited to ~30ish. If you used even longer names and paths, the number of sequences you could squeeze in would decrease.
To try and fix this, it would have to span multiple packets or to try and cheat it a bit, you can pass in the path (fps/data/shapes/player) part of the sequence filename separately to save space.
If you need help doing this, you can find me on IRC later. I've been awake too long and need sleep for work tomorrow.
Associate Kyle Carter