chaosfire / vdrift-ogre

Automatically exported from code.google.com/p/vdrift-ogre
0 stars 0 forks source link

Game multithreading doesnt work. #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As of current, using the mult_thr = 1 option, starting a game just leads to a 
car flying through the air.

Original issue reported on code.google.com by scrawl...@gmail.com on 24 Mar 2011 at 6:07

GoogleCodeExporter commented 8 years ago
Would be good if the simulation could go in a separate thread and rendering on 
it's own thread. This would give performance independence and higher fps on 2 
or more core cpu's. The simulation thread should just give output pos. & rot. 
of car and wheels which would be read in game thread so the data stays thread 
safe.
It is implemented but not working now, and far from being stable.

Original comment by Cry...@gmail.com on 2 Apr 2011 at 7:09

GoogleCodeExporter commented 8 years ago
So if I am right, It would be needed to handle pos / rot of car / wheels as 
boost mutexes?

Original comment by scrawl...@gmail.com on 2 Apr 2011 at 11:01

GoogleCodeExporter commented 8 years ago
no this is to avoid them

Original comment by Cry...@gmail.com on 2 Apr 2011 at 12:52

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hey guys no disrespect. But how can using "multithreading" in the age if dual 
core ARM bits be a "medium issue" ? 

Original comment by anotherr...@gmail.com on 9 Apr 2011 at 5:09

GoogleCodeExporter commented 8 years ago
You would be surprised how many games still are single threaded. Also, the game 
works fine as it is, multithreading is a kind of an optimization and as such 
not a critical issue.

Original comment by tapiovie...@gmail.com on 9 Apr 2011 at 8:08

GoogleCodeExporter commented 8 years ago
I already started this a while ago, it kind of worked, but there were strange 
jumps / synchronization problems with the car..

Original comment by scrawl...@gmail.com on 9 Apr 2011 at 9:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Since newPoses (get new from vdrift sim) and updatePoses (apply to ogre nodes) 
work right now its easier.
Its kind of working and not crashing but camera has problems.

Probably need to implement some interpolation (?extrapolation) because there is 
absolutely no synchronization between those 2 threads now (simulation and 
graphics)
(?or queueing or simulate camera smoothing better?).

Original comment by Cry...@gmail.com on 21 Apr 2011 at 5:15

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 1 Nov 2011 at 10:51

GoogleCodeExporter commented 8 years ago
One more idea is to get all camera code working without using any ogre nodes 
and such. So cameras would be simulated with vdrift simulation and ogre would 
just only read pos and rot and update camera.
Beside this, we need some synchronization (mutexes), or if the above works 
maybe not.
I'm going to make a graph control for hud, could be usefull to see the delays, 
fps and other stuff thats going on here.

Original comment by Cry...@gmail.com on 9 Feb 2012 at 11:35

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 19 Mar 2012 at 9:02

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 19 Mar 2012 at 9:02

GoogleCodeExporter commented 8 years ago
Kind of works.
The only problem now is some rare camera jump once in a while.
They happen more often in multiplayer.

Original comment by Cry...@gmail.com on 31 Mar 2012 at 3:21

GoogleCodeExporter commented 8 years ago
Fixed. Mostly works.
Only very rarely there is still some camera jump (once in a minute or less).
One problem left is starting on A4-Snake below road.

Original comment by Cry...@gmail.com on 5 Apr 2012 at 5:18

GoogleCodeExporter commented 8 years ago
Starting below road fixed. Road rebuild was on 1st render frame after loading.

Original comment by Cry...@gmail.com on 5 Apr 2012 at 9:03

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 8 Apr 2012 at 7:49