Page 1 of 1

moveing objects

Posted: Wed Feb 17, 2010 2:07 pm
by hutty
I have an idea for how to make movable objects in bzflag. They wuld work a lot like the current physics drivers.

lets say we have a moving cube. while the object moves according to a predefined path it comes in contact with a tank. The direction the cube is moving is the front, if the tank hits the front it's movement speed in the direction the cube is moving is added to the current movement

For example:
The cube is moving Y+ at speed 25.
It hits a tank going X- at speed 12.
now the tank is going both X- 12 and Y+ 25 (diagonal)
once the tank is ends contact with the moving object its Y+ speed is restored to normal.
note:: this is assuming that the tank player is moving X- 12 the entire time and gets hit on the side.

As for server and lag
the client would control the object. When a player first joins a server the server downloads the map to the client. The client build the map along with the moving objects. Then the server tells the client where the object currently is. the player joins. while the player is playing every minute or so the server resend the position of the moveing objects in order to maintain perfect synchronization.

I would code this myself but currently i dont know how to program things this advanced.

Re: moveing objects

Posted: Wed Feb 17, 2010 10:48 pm
by blast
Moving objects have been discussed before many, many times. The game state would need to be synced between all clients and the server. Plus, SomeOne(tm) has to write all the code to handle it.

Re: moveing objects

Posted: Thu Feb 18, 2010 5:16 pm
by hutty
I cannot code it myself yet, but i was stating how it could be done for anyone who has to code it.

and the game state already has to be synced with the server. otherwise the tanks would be all over the place.

if that is not what you meant, the moving objects would be controlled by the client. The server would tell the client where they are, where they are going and the predefined path, and then the client would take over, only double checking every now and then.

this would destroy any issues with lag ect. because interactions would be the same type as boxes and pyramids


unless i am entirely wrong and have no idea what i am talking about

Re: moveing objects

Posted: Thu Feb 18, 2010 6:36 pm
by JeffM
The game state is NOT currently synced with the server, that is why the tanks ARE all over the place (ever shoot someone and they not blow up?). You would not want the client to control the object. the server would have to do it, and have the clients sycn to that. It becomes more complex because unless they are in PERFECT sync, shots won't rico the same on every client, and that will make them really go all over the place. THe server doesn't actually KEEP a gamestate right now.

This is a feature that we would like to be able to add, but sadly the back end of bzflag is not setup to do it in a clean and secure way(as in to minimize cheating exploits). Once the backed is updated to be a proper server side state, then lots of fun things like this can be done.

Re: moveing objects

Posted: Fri Feb 19, 2010 1:28 am
by Spazzy McGee
huttymuncher wrote:For example:
The cube is moving Y+ at speed 25.
It hits a tank going X- at speed 12.
now the tank is going both X- 12 and Y+ 25 (diagonal)
once the tank is ends contact with the moving object its Y+ speed is restored to normal.
note:: this is assuming that the tank player is moving X- 12 the entire time and gets hit on the side.
This would feel really weird to the person driving the tank - there is no conservation of momentum. I know there is nothing 'realistic' about jumping tanks, but it would feel distinctly strange not having your momentum conserved (or a close approximation of it) when colliding with moving objects. This of course throws up further questions: What is the mass of a BZFlag tank? How do you calculate the mass of the block?

BZFlag is very good at simple gameplay that is based around simple (and very familiar) rules, which allow you to judge and predict the behaviour of tanks and shots in various situations with some accuracy. Perhaps it's more trouble than it's worth?

Re: moveing objects

Posted: Mon Feb 22, 2010 2:06 am
by hutty
oh, ok

Re: moveing objects

Posted: Wed Feb 24, 2010 12:06 pm
by tobylane
So is this one way to do one thing of many that you can't because of timing, so timing is on the todo list?

Re: moveing objects

Posted: Thu Feb 25, 2010 12:54 am
by joevano
tobylane wrote:So is this one way to do one thing of many that you can't because of timing, so timing is on the todo list?
Who's todo list? Yours? The only way it could be done is for Someone (tm) to care enough about it to code it up. I just don't see it happening anytime soon.

Re: moveing objects

Posted: Wed Mar 10, 2010 12:29 am
by adameros
I would look forward to platforms you can ride.

What happens when you get crushed by a moving object. Do you stop it (might be a nice feature for team play)? Does it kill you? Does it just pass through you?

If movable objects come in to being, maybe tanks having mass would follow. Be able to push people out of the way (and in to the lava. :-p) Or land on a team mate, and ride around acting like a turn-able turret (your team mate could be at the bottom of the trench dodging bullets for you, while you shoot that enemy).

Re: moveing objects

Posted: Wed Mar 10, 2010 1:42 pm
by hutty
That sound good, but as explained above it is complicated.

mabye later :D

Re: moveing objects

Posted: Wed Mar 10, 2010 2:34 pm
by joevano
Or never...

Re: moveing objects

Posted: Mon Mar 15, 2010 3:13 am
by hutty
could you at least try to be optimistic?

I am learning how to code, (look at my random map editor) and I hope to someday help with the project.

Re: moveing objects

Posted: Mon Mar 15, 2010 3:33 am
by blast
That's not a feature the project is likely to ever have.

Re: moveing objects

Posted: Tue Oct 19, 2010 1:45 am
by hutty
nexuiz has moving objects


edit---

The game state is NOT currently synced with the server, that is why the tanks ARE all over the place (ever shoot someone and they not blow up?). You would not want the client to control the object. the server would have to do it, and have the clients sycn to that. It becomes more complex because unless they are in PERFECT sync, shots won't rico the same on every client, and that will make them really go all over the place. THe server doesn't actually KEEP a gamestate right now.
oops should think before i speak
srry

Re: moveing objects

Posted: Sun Nov 07, 2010 1:12 pm
by alezakos
What about Planet Mofo? I think I saw some moving objects there

Re: moveing objects

Posted: Sun Nov 07, 2010 1:54 pm
by Cobra_Fast
It's no problem to create moving objects in BZFlag.
BUT: Tanks can't interact with them while they are moving.
That means: if you drive against a moving object you will go straight through it (like it was passable) because object movements are not synchronized between the clients. Another player might see you 50 units away the moving objects as you hit it.