<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/2370" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2009-04-22T22:11:27+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/2370</id>

		<entry>
		<author><name><![CDATA[jorjee]]></name></author>
		<updated>2009-04-22T22:11:27+00:00</updated>

		<published>2009-04-22T22:11:27+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13429#p13429</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13429#p13429"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13429#p13429"><![CDATA[
<blockquote class="uncited"><div>I'm not sure exactly how it works, but directly moving objects could at least cause problems with contacts and hinges and so on, right?</div></blockquote>From what I know of bullet, the only safe way to directly move objects around is by using kinematic objects. If not, the dynamics of the world (collision response for example) becomes unpredictable.<br><blockquote class="uncited"><div>One thing I don't understand is how to do rigidbodies that are mostly simulated but also slightly kinematic and controlled by the system. Maybe not applying any impulses (even gravity and collision impulses) and setting the velocity explicitly each internal simulation step would work.</div></blockquote>If you do not apply any impulses, aren't you  in effect making them completely kinematic objects? They are not affected by the world dynamics anymore are they?<br>Don't know if this is feasible; how about making a compound object with the parent as a kinematic object and the children as dynamic objects? The kinematic parent will be completely in your control but the dynamic children will be affected by the kinematic parent but also by the world dynamics.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=4366">jorjee</a> — Wed Apr 22, 2009 10:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wavesonics]]></name></author>
		<updated>2008-07-21T02:36:04+00:00</updated>

		<published>2008-07-21T02:36:04+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9414#p9414</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9414#p9414"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9414#p9414"><![CDATA[
Just an idea, but lots of games use use very simple prediction code when they weren't getting updates from the server.<br><br>You could *only* run the simulation on the server, and do very simple client side prediction in-between updates.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2458">Wavesonics</a> — Mon Jul 21, 2008 2:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Zeal]]></name></author>
		<updated>2008-07-15T19:10:45+00:00</updated>

		<published>2008-07-15T19:10:45+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9331#p9331</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9331#p9331"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9331#p9331"><![CDATA[
<blockquote class="uncited"><div>What I really need is a top-level guide to this stuff, Preferably some maths to make things clear.</div></blockquote>I would also love to see a high level guide that explains this stuff, MINUS the math (for all us who are not CRAZY MATH NUTS <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> ).<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2045">Zeal</a> — Tue Jul 15, 2008 7:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sparkprime]]></name></author>
		<updated>2008-07-15T11:33:57+00:00</updated>

		<published>2008-07-15T11:33:57+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9326#p9326</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9326#p9326"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9326#p9326"><![CDATA[
I'm not sure exactly how it works, but directly moving objects could at least cause problems with contacts and hinges and so on, right?<br><br>It works for kinematic objects though.  One thing I don't understand is how to do rigidbodies that are mostly simulated but also slightly kinematic and controlled by the system.  Maybe not applying any impulses (even gravity and collision impulses) and setting the velocity explicitly each internal simulation step would work.<br><br>What I really need is a top-level guide to this stuff,  Preferably some maths to make things clear.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2472">sparkprime</a> — Tue Jul 15, 2008 11:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chunky]]></name></author>
		<updated>2008-07-15T04:33:07+00:00</updated>

		<published>2008-07-15T04:33:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9321#p9321</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9321#p9321"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9321#p9321"><![CDATA[
<blockquote class="uncited"><div>Am I the onlyone who has been told NOT to manually move bodies like this though? I was always told if you want to move a body, you MUST do so by applying forces, ect...</div></blockquote>No, that's common practice with physics engines and considered "right". Sometimes that simply isn't feasible<br><blockquote class="uncited"><div> So youre saying the worst thing that could happen is two objects overlap and go flying (at least on the client, the server remains the same)? But I imagine if you interpolate slowly this is unlikely eh? Hrmmm..</div></blockquote>Potentially. I figure I'm gonna cross that bridge if I get to it.  It hasn't been a problem so far, through practical experimentation. If it becomes a problem, then I'll look into it...<br><br>Gary (-;<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2063">chunky</a> — Tue Jul 15, 2008 4:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Zeal]]></name></author>
		<updated>2008-07-15T03:14:23+00:00</updated>

		<published>2008-07-15T03:14:23+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9319#p9319</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9319#p9319"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9319#p9319"><![CDATA[
<blockquote class="uncited"><div>On a client, temporarily: possibly.</div></blockquote>So youre saying the worst thing that could happen is two objects overlap and go flying (at least on the client, the server remains the same)? But I imagine if you interpolate slowly this is unlikely eh? Hrmmm..<br><br>Am I the onlyone who has been told NOT to manually move bodies like this though? I was always told if you want to move a body, you MUST do so by applying forces, ect...<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2045">Zeal</a> — Tue Jul 15, 2008 3:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chunky]]></name></author>
		<updated>2008-07-15T02:47:06+00:00</updated>

		<published>2008-07-15T02:47:06+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9318#p9318</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9318#p9318"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9318#p9318"><![CDATA[
<blockquote class="uncited"><div>Wait is it safe to do that? Just manually set the transform brute force style? What happens if this new position overlaps with ANOTHER body in your simulation? Wont that cause both objects to go flying?</div></blockquote>On a client, temporarily: possibly. On the server: no, since I'm not doing that moving on the server.<br><br>Gary (-;<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2063">chunky</a> — Tue Jul 15, 2008 2:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Zeal]]></name></author>
		<updated>2008-07-15T02:22:56+00:00</updated>

		<published>2008-07-15T02:22:56+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9317#p9317</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9317#p9317"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9317#p9317"><![CDATA[
Wait is it safe to do that? Just manually set the transform brute force style? What happens if this new position overlaps with ANOTHER body in your simulation? Wont that cause both objects to go flying?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2045">Zeal</a> — Tue Jul 15, 2008 2:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chunky]]></name></author>
		<updated>2008-07-14T23:45:24+00:00</updated>

		<published>2008-07-14T23:45:24+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9316#p9316</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9316#p9316"/>
		<title type="html"><![CDATA[Re: Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9316#p9316"><![CDATA[
<a href="http://developer.valvesoftware.com/wiki/Lag_Compensation" class="postlink">http://developer.valvesoftware.com/wiki ... mpensation</a><br><br>Also a good read.<br><br>Personally what I'm doing in my game is just warping my physics objects from where my client simulation thinks they are, a certain percentage towards the position that they're predicted to be based on the position and velocity when the server sent them, compensating for lag.<br><br>This won't work, since I stripped out a bunch of angle-related stuff and other unnecessary stuff for the example, but I hope it makes it clear:<br><div class="codebox"><p>Code: </p><pre><code>bool TWSpaceShip::setPosVel(float xpos, float ypos, float xvel, float yvel, int delta) {// Delta is the time in milliseconds, compared to now, that the packet was sent. It's usually negativeif(NULL == mShipBody) return false;btVector3 newpos(xpos, ypos, 0);btQuaternion newrot(btVector3(0,0,1), theta);btTransform newtrans(newrot, newpos);btVector3 newvel(xvel,yvel,0);btTransform currtrans = mShipBody-&gt;getWorldTransform();btVector3 currpos = currtrans.getOrigin();btVector3 predictpos = newpos - newvel * ((float)delta/1000.0);predictpos = predictpos * SPACESHIP_CORRECTION_LINEAR + currpos * (1.0 - SPACESHIP_CORRECTION_LINEAR);btQuaternion predictrot(btVector3(0,0,1), predicttheta);btTransform predicttrans(predictrot, predictpos);mShipBody-&gt;setWorldTransform(predicttrans);mShipBody-&gt;setLinearVelocity(newvel);return true;}</code></pre></div>SPACESHIP_CORRECTION_LINEAR, if set to 1.0, always warps the ship instantly to the considered correct position. at 0.0, it never warps it to a correct position, and 0.5 warps it halfway. Personally, I have it set to about 0.75 and that "feels right" for my game.<br><br>Gary (-;<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2063">chunky</a> — Mon Jul 14, 2008 11:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Zeal]]></name></author>
		<updated>2008-07-14T23:27:35+00:00</updated>

		<published>2008-07-14T23:27:35+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9315#p9315</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9315#p9315"/>
		<title type="html"><![CDATA[Synchronizing a simulation for multiplayer...]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=9315#p9315"><![CDATA[
I found a good article here...<br><br><a href="http://www.gaffer.org/game-physics/networked-physics" class="postlink">http://www.gaffer.org/game-physics/networked-physics</a><br><br>One general question though, how do you syncronize TWO simulations over a network. I was always under the impression that if you manually set the position of a rigid body, the entire universe would EXPLODE! <br><br>So a simple question - if a body on the client falls out of sync with the server, how can the client 'force' it back to its 'correct' position?<br><br>Thanks<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2045">Zeal</a> — Mon Jul 14, 2008 11:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
