Disable Tweening

Blitz3D Forums/Blitz3D Programming/Disable Tweening

HNPhan(Posted 2004) [#1]
Is there any way to bypass tweening for some objects using Mark's Tweening code that was included with b3D demo?

because i need to 'warp' an animated character to a position without having that weird trail


Rob(Posted 2004) [#2]
you can do the movement just before captureworld. Ie, queue them up with a type, then call captureworld as normal.


skidracer(Posted 2004) [#3]
As Rob says, if you call the Warp function before CaptureWorld so your mainloop looks like this (i think):

warpstuff
captureworld
updateworld
renderworld


AntonyWells(Posted 2004) [#4]
Unless you're applying this movement to a limb(I.e one being abused by an animated entity), in which case make a record and apply it after updateworld.


HNPhan(Posted 2004) [#5]
odd though ive been doing that, and it didnt work
heres a segment of the code
	While Not KeyHit(1)	

		Repeat
			elapsed=MilliSecs()-time
		Until elapsed
	
		ticks=elapsed/period
		tween#=Float(elapsed Mod period)/Float(period)
		
		For k=1 To ticks
			time=time+period
			If k=ticks

				If Warp_MHero = 1
					MoveEntity mHero,0,0,-107.974
					Warp_MHero = 0
				EndIf

				CaptureWorld
				Gosub CameraControl	;Camera Movement
				Gosub CharacterControl
				Gosub EnvironmentControl
				UpdateWorld
				Gosub PostAnimationControl
			EndIf
		Next

		RenderWorld tween#
		Gosub Draw2D
		Flip False
	Wend
	End




skidracer(Posted 2004) [#6]
It's been a while so I'm a bit vague, the MoveEntity is only taking effect at UpdateWorld so..., I think this is one of those times you need to either use PositionEntity or a call to ResetEntity is needed in addition to the MoveEntity.


Michael Reitzenstein(Posted 2004) [#7]
I think that the current tweening system definitely needs an overhaul. An entity flag that disables tweening would be a brilliant addition.


HNPhan(Posted 2004) [#8]
i just tried with positionentity and even resetentity, but it doesnt work :(

would there be any other work around?


Zethrax(Posted 2004) [#9]
I think that the current tweening system definitely needs an overhaul. An entity flag that disables tweening would be a brilliant addition.


I agree. Tweening needs a command to do for tweened entities what 'ResetEntity' does for collision entities (ie. Re-prime the entity's tween data so it behaves as though it was already at the position it has been moved to)


eBusiness(Posted 2004) [#10]
You could make the entity invisible for a short time.


Michael Reitzenstein(Posted 2004) [#11]
That's still an ugly work around, though. I never could get tweening *just* right in Juno. In fact, for the menu, I enable back face culling on the gui for a frame as it fades in in order to get rid of the very nasty effects of tweening on newly created entities.


jhocking(Posted 2004) [#12]
Don't use tweening. I use the delta time method for making my code framerate independent.


Zethrax(Posted 2004) [#13]
Don't use tweening. I use the delta time method for making my code framerate independent.


I used to use delta time in my main project but I had to switch my physics integrator from simple euler to verlet due to numerical instabilities. Due to the need for a fixed timestep for the verlet integrator, render tweening was a better fit.

Tweening is pretty good. It just comes up short of being as good as it needs to be. All it needs is a 'ResetTweenEntity/CaptureEntity' style command.


Rob(Posted 2004) [#14]
Tweening is perfect for physics. Tigerz, can you post a full example demonstrating this technique failing to work? pref with spheres as it should work.


HNPhan(Posted 2004) [#15]
ok sure, ill upload something in a few hours (got school in a few)


HNPhan(Posted 2004) [#16]
i just tried it on a sphere and theres no problem, it only happens when its on an animated (boned character) entity...

so im gonna have to find another way of doing things


Boiled Sweets(Posted 2006) [#17]


I think that the current tweening system definitely needs an overhaul. An entity flag that disables tweening would be a brilliant addition.




AGREED! This happens in all my apps and no I don'#t want to use Delta Timing. Come on BRL...


Damien Sturdy(Posted 2006) [#18]
I asked for this yonks ago.

Perhaps something similar to "resetentity" for tweening. :)


Boiled Sweets(Posted 2006) [#19]
What's the best way to get this requested?

I would love for BRL to actually do this.


carpman(Posted 2006) [#20]
Maybe if we just keep this thread going long enough it will create a response.
I've had this problem for years....thought it was just my lousy coding techniques. :)
I seem to spend hours creating ugly work around code.

A new command to do this, would be to me, what the DDS feature was for Mustang....absolute bliss. :)

I've tried Rob's idea of calling a movement function just prior to the CaptureWorld and while this works I suppose this in itself is really just a work around.


@rtur(Posted 2006) [#21]
>I would love for BRL to actually do this.

Me too.


Boiled Sweets(Posted 2006) [#22]
Well,

I have emailed Blitz Support and Mark directly. I'm thinking that perhaps a DisableEntityTweening function would not be the best way to do this but to add a flag to the positioning functions to state whether tweening should be employed, so...

PositionEntity entity, x, y, z, global, disable_tween

Anyhow we shall see.


Damien Sturdy(Posted 2006) [#23]
http://www.blitzbasic.com/Community/posts.php?topic=45287#505241


Boiled Sweets(Posted 2006) [#24]
Well yes, so is the answe rto use EntityType,0, postions then reset?

Is that the best option to solve this currently?

Not exactly elagant


Damien Sturdy(Posted 2006) [#25]
Nonono, i was just pointing out a thread that proves we've been after it for yonks! :)


Boiled Sweets(Posted 2006) [#26]
Ah. Well the request is with Mark. We shall see.


Hujiklo(Posted 2006) [#27]
Well?...waiting....dum de dum...sigh


Boiled Sweets(Posted 2007) [#28]
COME ON BRL!


TomToad(Posted 2007) [#29]

Top sphere warps, bottom sphere tweens.


Boiled Sweets(Posted 2007) [#30]
Cool BUT Marks render tweening code is structured like this...


	While g_main_state =  MAIN_STATE_GAME
		
		Starttime = MilliSecs()
		
		Repeat
			elapsed=MilliSecs()-frametime
		Until elapsed
		
		ticks=elapsed / period
		tween=Float(elapsed Mod period)/Float(period)
		
		For i=1 To ticks
			frametime=frametime+period
			If i=ticks Then
				CaptureWorld
			End If
			game_update()
			UpdateWorld
		Next
		
		RenderWorld tween 
		
		Flip
		
	Wend



notice the placement of the update_game routine.

Using your technique you would have to move the update to just prior to the capture. Not so good!