Problems intializing both playerData and RTSUnitData datablocks
by Vijay Myneni · in RTS Starter Kit · 11/25/2004 (10:52 pm) · 5 replies
Hi,
I'm trying to get the regular FPS player back into my starter.rts project, but having both the PlayerData and RTSUnitData datablocks in there is causing me to trip the following assert, in SimDataBlockEvent::process(NetConnection *cptr). This only happens when I'm using a split server/client.
I'm hunting through the code, but I'm wondering if anyone has any theories. It looks like both datablocks are getting assigned the same mID or something.
Thanks,
Vijay
I'm trying to get the regular FPS player back into my starter.rts project, but having both the PlayerData and RTSUnitData datablocks in there is causing me to trip the following assert, in SimDataBlockEvent::process(NetConnection *cptr). This only happens when I'm using a split server/client.
I'm hunting through the code, but I'm wondering if anyone has any theories. It looks like both datablocks are getting assigned the same mID or something.
if (Sim::findObject(id,obj))
{
AssertFatal(obj->getClassName() == mObj->getClassName(),
avar("SimDataBlock::process - attempted to initialize invalid datablock! ('%s' -> '%s')",
mObj->getClassName(), obj->getClassName())
);Thanks,
Vijay
About the author
#2
11/26/2004 (6:31 am)
@Vijay: No, you don't have to have them loaded twice--however some of the files that are loaded in on startup sequence are extremely dependent on other files already loaded, and/or certain bootup stages being met. Be very careful moving/removing exec lines at each stage--it took me several days to figure out what I screwed up the first time I ported the RTS pack to our (very modified) start up sequence in our dedicated server/client setup.
#3
11/26/2004 (2:42 pm)
Thanks for the tip Stephen. Getting the original starter.fps player into the RTS game has been a very educational experience.
#4
11/26/2004 (10:28 pm)
Vijay, if you feel like posting a resource for your changes, that'd be cool.
#5
Hints for getting the FPS player back into the RTS starter game:
1. Know that the RTSCamera is set to only see RTS objects (RTSUnit, RTSProjectile, etc...). Check out RTSCamera::OnCameraScopeQuery to change this.
2. When you add the exec command to exec the fps player.cs, add it in server/init.cs so that the server knows to create the player's datablock.
3. You have to turn off the cursor to be able to control the fps player (having the cursor on causes the canvas to capture mouse move events).
The only issue I have yet to resolve is that in a split client/server setup, the player kind of jumps around as I run him around. It's not smooth motion like it is when I run it without a separate server (or like it was with the non-RTS build). Tomorrow I'll hunt through the code some more and see what's going on. If anyone's got tips on what to look for, I'd love to hear them.
Thanks.
11/26/2004 (11:42 pm)
I can do that when I'm done, but I'm not quite there yet. I can post up helpful hints here as I go along though (and let me know if I've got something wrong). Off the top of my head:Hints for getting the FPS player back into the RTS starter game:
1. Know that the RTSCamera is set to only see RTS objects (RTSUnit, RTSProjectile, etc...). Check out RTSCamera::OnCameraScopeQuery to change this.
2. When you add the exec command to exec the fps player.cs, add it in server/init.cs so that the server knows to create the player's datablock.
3. You have to turn off the cursor to be able to control the fps player (having the cursor on causes the canvas to capture mouse move events).
The only issue I have yet to resolve is that in a split client/server setup, the player kind of jumps around as I run him around. It's not smooth motion like it is when I run it without a separate server (or like it was with the non-RTS build). Tomorrow I'll hunt through the code some more and see what's going on. If anyone's got tips on what to look for, I'd love to hear them.
Thanks.
Torque Owner Vijay Myneni
Can someone explain to me why all the exec lines at the beginning of server/init.cs are also duplicated at the beginning of server/game.cs? Do you have to have them in both places?
Thanks a lot,
Vijay