Creating client-side ShapeBase objects?
by Keith Johnston · in Torque Game Engine · 09/08/2004 (6:37 am) · 10 replies
I am creating a single-player only game. Is there a way to bypass the server -> client serialization to speed up the level loading? I wouldn't mind if I could just create the objects on the client, but when I exec a mission file, it seems that server side objects are always created.
I need the objects to be scriptable, so I don't think I can use TSStatics.
I need the objects to be scriptable, so I don't think I can use TSStatics.
#2
09/08/2004 (12:15 pm)
I thought I could use that - but it uses TSStatics, which I don't believe can be scripted.
#3
You'd either have to change (in a major way) the way the engine works... ripping out the networking code and having the client do everything the server does, PLUS do the rendering. Or, you'll need to adapt to work with the way things operate.
Unless, of course, someone can show me the error of my ways.
- Brett
09/08/2004 (12:20 pm)
Well, the biggest issue that you need to understand is that when you run a single player game, the networking is short-circuited. This means that your machine is running both the client and the server. The server still controls all the action, so you need to have the co-existance of objects on the server and client. Ghosting is still an issue, and so are other network issues.You'd either have to change (in a major way) the way the engine works... ripping out the networking code and having the client do everything the server does, PLUS do the rendering. Or, you'll need to adapt to work with the way things operate.
Unless, of course, someone can show me the error of my ways.
- Brett
#4
09/08/2004 (5:01 pm)
Yeah so far it seems like a major change to get objects to be created on the client to begin with, or to have server objects render on the client.
#5
TSStatics are scriptable, although other objects expose more script functionality.
09/09/2004 (9:52 am)
One thing you could do is make objects "serialize" by simply passing a pointer directly through the network layer rather than writing a bunch of data out. This would work very well for the datablock load, which takes up a lot of the load time.TSStatics are scriptable, although other objects expose more script functionality.
#6
I'm seeing it take about 8 milliseconds to load each object. Not too bad until you have a level with 300 objects - then it takes almost 24 seconds to load the level. All the objects are ghost always, scoped always. Does that sound about right?
09/09/2004 (10:27 am)
That is a cool idea, Ben - I think I will try that serialization of a pointer.I'm seeing it take about 8 milliseconds to load each object. Not too bad until you have a level with 300 objects - then it takes almost 24 seconds to load the level. All the objects are ghost always, scoped always. Does that sound about right?
#7
Why are you making all the objects ghost always/scope always? That's probably a big time/resource sink right there for the clients.
09/09/2004 (4:11 pm)
I think your math might be about - you mean 2.4 seconds, right? :)Why are you making all the objects ghost always/scope always? That's probably a big time/resource sink right there for the clients.
#8
09/09/2004 (5:27 pm)
Oops - I guess I meant 80 milliseconds for each tube to be sent. It definitely takes 24 seconds for all the pieces to be sent.
#9
The reason I need all the objects to be ghost always / scope always is that all the objects are all always visible. The pieces are tubes (this is for TubeTwist).
09/10/2004 (3:56 am)
Thanks, Ben - your idea worked and my level loading times are about half of what they were. I made a slight modificaiton - I serialized the object id and did a lookup on the client (since it is all one process).The reason I need all the objects to be ghost always / scope always is that all the objects are all always visible. The pieces are tubes (this is for TubeTwist).
#10
Object ID is a good idea. Nice thinking.
Since it's all loop back you could also try turning the packet size up to a few kilobytes instead of the mere 1400 bytes it's at now.
09/11/2004 (7:35 am)
Yup, that makes sense. :)Object ID is a good idea. Nice thinking.
Since it's all loop back you could also try turning the packet size up to a few kilobytes instead of the mere 1400 bytes it's at now.
Torque Owner Kevin Johnson