FAO Vorderman re z-virus

Miscellaneous Forums/Blitz Showcase/FAO Vorderman re z-virus

Was messing about earlier today and I think I've nailed the original mouse control - I haven't implemented yet but can you tell me if this is what you remember?

Mousewheel to change mouse sensitivity...

Sample code ...

Graphics3D 640,480, 16,1

Global HGW# = GraphicsWidth()*.5
Global HGH# = GraphicsHeight()*.5
Global Light = CreateLight()
Global Pivot = CreatePivot()
Global YawPivot = CreatePivot()
Global Mirror = CreateMirror()
Global Plane = CreatePlane()
Global camera = CreateCamera()
Global p.SHIP
Const Gravity# = .005
Global GRAVITYon= True
Global JX#, JZ#, Mx#, Mz#, Thrust#
Global SENS# = 10.0
Global MinDist#, MaxDist#

Const FPS = 30
Global Timer = CreateTimer( FPS )

Type ship
	Field Model
	Field Yaw#
	Field Pitch#
	Field Momentum#
	Field Thrust#
	Field Vx#,Vy#,Vz#
End Type

init()

While Not KeyDown(1)

	WaitTimer Timer

	MOUSEinput()
	SHIPupdate()
		
	RenderWorld()
	OVALdraw( 55,55, Mindist*.25 , 1 , 150, 30, 30 )
	OVALdraw( 55,55, MaxDist*.25,0, 200,200,200 )
	Text 0,140,"Mouse Sensitivity : "+SENS
	OVALdraw( 55 + mx*.25 ,55 + mz*.25,3,0,200,200,50 ) 
	OVALdraw( 55,55,(MinDist+MaxDist)*.5*.25,0, 200,50,50 )
	Flip
	
Wend

;===================================
;===================================
;===================================

Function SHIPupdate()

	p\pitch =  limit( p\pitch + JZ , 0,180 )
	p\yaw = p\yaw + JX 
	RotateEntity yawpivot,0,p\yaw, 0
	RotateEntity p\model , p\pitch , p\yaw , 0
	
	TFormNormal 0,1,0, p\model,0
	p\vx = p\vx * p\momentum + TFormedX() * Thrust
	p\vy = p\vy * p\momentum + TFormedY() * Thrust - gravity
	p\vz = p\vz * p\momentum + TFormedZ() * Thrust
	TranslateEntity p\Model,p\vx,p\vy,p\vz
	If EntityY( p\Model ) < 2
		TranslateEntity p\Model,0,2.0-EntityY(p\model),0
		p\vy = -p\vy * .5
	EndIf
	
	tx# = ( EntityX( p\Model ) - EntityX( camera) ) * .5
	ty# = ( EntityY( p\Model ) - EntityY( camera) ) * .5
	tz# = ( EntityZ( p\Model ) - 10 - EntityZ( camera) ) * .5
	TranslateEntity camera, tx, ty, tz
	PointEntity camera, p\Model
	
End Function

;===================================
;===================================
;===================================

Function OVALdraw( x#, z#, rad# , fill#, r,g,b )

	Color r,g,b
	Oval x-rad, z-rad, rad*2+1,rad*2+1, fill

End Function

;===================================
;===================================
;===================================

Function MOUSEinput()

	;change sensitivity
	SENS = LIMIT (  SENS +  MouseZSpeed() * .25 , 2.0, 10.0 )

	MinDist# = 4.0 * SENS
	MaxDist# = 22.0 * SENS

	dx# = MouseX() - HGW
	dz# = MouseY() - HGH
	d# = Sqr( dx*dx + dz*dz )
	nx# = dx / d
	nz# = dz / d
	d# = limit( d , 0 , MaxDist )
	mx# = nx * d
	mz# = nz * d
	MoveMouse HGW +mx , HGH + mz
	thrust# = MouseDown(1) * p\Thrust

	;yaw
	If d > 0 
		PositionEntity pivot, mx, 0, - mz
		JX# = DeltaYaw( yawpivot , pivot )  * .2
	Else
		JX# = 0
	EndIf	
		
	;pitch
	If d >= MinDist
		JZ# =  ( ( ( d - MinDist) / ( MaxDist - MinDist ) *180.0 ) - p\pitch ) *.2
	Else
		JZ# =  - p\pitch * .1
	EndIf

End Function

;===================================
;===================================
;===================================

Function Init()

	EntityAlpha plane,.5
	EntityColor plane,25,25,100
	
	grid_tex=CreateTexture( 32,32,8 )
	ScaleTexture grid_tex,10,10
	SetBuffer TextureBuffer( grid_tex )
	Color 0,0,64:Rect 0,0,32,32
	Color 0,0,255:Rect 0,0,32,32,False
	SetBuffer BackBuffer()

	plane=CreatePlane()
	EntityTexture plane,grid_tex
	EntityBlend plane,1
	EntityAlpha plane,.6
	EntityFX plane,1
	
	p.ship = New Ship
	p\Model = CreateCone( 5,1 )
	RotateMesh p\Model, 90,0,0
	PositionEntity p\Model, 0,5,0
	EntityColor p\Model,50,200,50
	UpdateNormals p\Model
	ScaleMesh p\Model,.5,.25,.5
	p\thrust = .02
	p\momentum = .9925

	flame = CreateSphere( 3, p\Model )
	ScaleMesh flame,.25,.1,.25
	EntityColor flame,200,200,50
	PositionEntity flame,0,-.1,0

	PositionEntity camera,0,100,-100

	MoveMouse HGW, HGH

End Function

;===================================
;===================================
;===================================

Function LIMIT#(n#,n1#,n2#)
	
	If n>n2 Then n=n2
	If n<n1 Then n=n1	
	Return n

End Function

;===================================
;===================================
;===================================

Function WRAP#( q# , hi# , lo#=0 )
	
	If q < lo Then q = hi + (q-lo)
	If q >= hi Then q = lo + (q-hi)
	Return q
	
End Function



Blimey, that's a bit complex! And very VERY difficult to control!!

I think the original had much simpler controls, but the resulting possibilities were much more complex, in that the ship could point in any direction, and it also had two thrust modes - right mouse for fast thrust, middle mouse for slow thrust.

try this - http://www.jameskett.dsl.pipex.com/BlitzGL_Zarch.zip

I think it just has left and right mouse buttons for fast and slow thrust, with no weapons etc...

In the original, as in my demo program, you can turn the ship upside down and thrust straight down if you want to. You can also stand the ship on its tail to shoot stuff above you. There were no limits to movement in any direction - you could spin it over and over and over if you wanted, making great big spirals in the sky.

Out of curiosity - how long ago did you last play this - 15 years? The lander demo on RedSquirrel archimedes emu is exactly like I've just shown you above .. hmmm. At any rate it's exaclt the same as the st & Amiga versions.

Cheers for looking anyway :)

You're right - it was a looooong time ago - on the Archimedes at school. I never played the Amiga version I don't think. Perhaps they toned down the controls for the release versions of the game

edit : just played the Amiga version of Virus, and it's just like your program above - yeugh. Very awkward to play and you seem to get stuck upside down very easily. Certainly that is not how I remember the Arch version being.

Perhaps you could add an option to switch between the control modes so everyone is happy?

I know what you mean Vorderman - however, up until recently I found the Amiga controls quite intuitive as I'd been playing that version for a long time. When I then went to play Z-Virus for the first time the controls definitely weren't right (it seemed to be that there was less fine control). I then played Z-Virus for a few days, got used to it then tried the Amiga version again ...... and found I could barely play it!

I do though welcome the addition of the 'original' control method but I also think it would be useful for Stevie to leave in his newer, easier control method as a user-selectable option. Meanwhile I have some controls to re-learn. :)

Perhaps my memory is bad then - maybe the Arch version had these controls, but I was just used to them back then???

I still think the free-rotate 360-degree aiming is easier to get to grips with and makes the game much better as it's easier to track targets and attack enemies as they buzz around you.

With the Amiga controls, as with Stevie's demo, I seem to get the ship stuck upside down after every attempt at a fast turn, and it seems to be impossible to right it again - you end up frantically moving the mouse in every direction and the ship just stays resolutely upside down until you crash into the floor. The free-rotation 360-degree controls don't seem to have this problem - you can always recover from a spin - even if this isn't accurate to the original then I certainly think it's more fun.

Try the ST version through emulation.