SetBase = poorly coded, any alternatives?

Discussions about Coding and Scripting
Post Reply
Myth
Inhuman
Posts: 988
Joined: Tue Feb 12, 2008 5:57 pm
Personal rank: Low Poly Freak

SetBase = poorly coded, any alternatives?

Post by Myth »

I've been fiddling whit SetBase function. What I've found out that you can attach any actor to any other actor. Cool huh? It only has a few major problems.
One of the problems is that when an actor gets unattached while the base is in motion the unattached actor will not fly off in the direction the base was moving. Just jump off a fast non vertically moving platform and you'll see what I mean. Lift jumping is possible in 1 axis but that's just a tweak in player physics.
The major problem is only in multiplayer games, poor replication. The attached actor's location, velocity, rotation and everything should be replicated relative to the base actor. This doesn't happen. It's always replicated relative to coordinates. It's a simple thing which should have been implemented in the engine. It causes thousands of bugs and wasted bandwidth. If there are more players on a lift you can see that they slowly fall into the lift and lag around. If you have a decoration actor on a moving mover. The actor's location is always replicated even if it doesn't move relative to the mover. When the mover's state gets replicated every attached actor should be updated by the mover, well this doesn't happen instead the same motion is sent again over the network at different rates, and some milliseconds later.
The bandwidth loss is quite huge...

This is quite a major bug. I have no idea how epic missed this when they were developing the engine, as far as I've seen it, every unreal engine 1 game suffers from it. (yay, just tasted that multiplayer code from the original unpatched unreal)

So my question is... are or were there any alternative solutions? I'd guess it should be possible to re-implement SetBase in Uscript for new actors. The old ones are doomed anyways. Since the game is 10 years old, I hope that somebody came up whit solutions...
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Re: SetBase = poorly coded, any alternatives?

Post by TheDane »

well, it's no bug, you must remember when this game was released the net speed was like a common k56 dial up connection, so I think they actualy did right by not replication unnessesary things as attached actors. You can easily make up for that by subclassing the actors you want to attach to something and make your own replication for these actors.
Retired.
Myth
Inhuman
Posts: 988
Joined: Tue Feb 12, 2008 5:57 pm
Personal rank: Low Poly Freak

Re: SetBase = poorly coded, any alternatives?

Post by Myth »

Meh... you didn't quite understand. By not implementing proper replication for attached actors, they use the standard replication. Which sucks away all the bandwidth. The problem isn't that they don't get replicated. If you specify that they are relevant the engine replicates them using very poor code and wastes 100 times more bandwidth on them. Their location and rotation is sent every tick when they change relative to the world, instead when they change relative to their base.

I can't really explain this in more simpler terms sorry.

In a standard game only 5000-7000 bytes/sec are sent over the net. In closed maps 3000-5000 bytes/sec. Ut can even be playable whit speeds like 2000 bytes/sec. When this bug occurs whit about 25 actors at least 20000 bytes/sec are needed. And that's only 25 attached actors.
If you have 50 attached actors this number gets as high as 30000 bytes/sec.

Now you shouldn't think that you have a 3 megabyte per sec download speed. The server is the one that suffers. If the server has 32 players
5000-7000*32=192 kilobytes/sec and 20000-30000*32=800 kilobytes/sec and that's 600 kilobytes per second wasted on bullshit. And the bigger these nubers get, the laggier the whole game gets for everyone.

And no, internet speeds that your friendly internet service provider tells you are much higher that what you get. What you get is always slow. They always do everything they can to get you confused and sell better.
If you want you can test you speeds here http://www.speedtest.net/. If you want to be realistic test it across the sea. I nobody cares if you have high speed in your man/lan. If you live in europe test america or reverse. The tester displays values in megabits/kilobits, not bytes. Divide that by 8 to get the value in bytes. My upload speed to NY is only 200Kilobytes/sec at 100ms ping.
Post Reply