Mesh position synchro problem

Blitz3D Forums/Blitz3D Programming/Mesh position synchro problem

OverDozing(Posted 2006) [#1]
Hey,

I am having an issue on meshes positionement, this does not happen on my machine, but on slower cpu/gpu.
If I overload the game of sprites and stuff, the meshes start ‘’loosing’’ the correct positions.
I checked my code, did a few optimization but still, it happen…
While the actual virtual positions are correct, the meshes can’t follow the moves, I know the actual virtual positions are correct because if I use the weapon, it will fire from the position it should.
If I reduce the amount of sprites, then the meshes will get back in place.
If I keep overloading the game, the meshes will keep moving, but out of synchro.

So my question, do you have any idea how I could fix this problem?
I know it’s a vague question, but maybe someone have a magical tip… ^^

I added a picture to show better the problem:


Thanks.


jfk EO-11110(Posted 2006) [#2]
Sounds strange. I guess you're using some multithreaded alignement commands (alignto..?). Basicly, if the virtual position is correct, then the physical position should be ok too, if you use something explicit like PositionEntity. You should not get more than the duration of one frame delay.

To prevent troubles with diffrent machine speeds I use delta T correction to move things, so the steps are bigger on slower machines. As a result both, slow and fast machine are in sync.


semar(Posted 2006) [#3]
@OverDozing,
sorry for hijacking the thread, but I wonder, which blitz editor are you using there ?

Sergio.


OverDozing(Posted 2006) [#4]
@ jfk EO-11110
no, I am not using alignto... commands that could be linked to the problem, and i do use PositionEntity! I may have a few functions using MoveEntity in the process, could be linked to the problem?

I use 'tween' to adjust the game speed, could it be the problem also?
I will look at Delta T Technique , maybe I give it a try.
Thanks a lot.

@semar
I am using Blitz3d.


b32(Posted 2006) [#5]
I think it could be the tweening. Then, because the PC is slower, CaptureWorld() would be called less often, resulting in the render to fall behind ? (and your editor does seem quite nice, is this a new IDE version?)


OverDozing(Posted 2006) [#6]
This is Visual Blitz, no it isn't new, I use it for quite some times now, definitely an useful tool, easy, stable and efficient ^^


OverDozing(Posted 2006) [#7]
I just disable le tweening, running the game with no FPS control and it does solve the problem!!!!!! ^^

Alright, time to add the Delta t then.


Dreamora(Posted 2006) [#8]
Another possibility would be to position the object after updateworld. Then it wouldn't be affected by tweening.