English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Contest

 
 
Thread Tools
Old 14 March 2019, 22:29   #881
DamienD
Banned
 
DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
Quote:
Originally Posted by mcgeezer View Post
Fixed the Giant Worm... makes it a bit easier.

[ Show youtube player ]
Looking good, well done Graeme
DamienD is offline  
Old 14 March 2019, 22:35   #882
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by DamienD View Post
Looking good, well done Graeme
Cheers Buddy!
mcgeezer is offline  
Old 14 March 2019, 23:15   #883
invent
pixels
 
invent's Avatar
 
Join Date: May 2014
Location: Australia
Age: 52
Posts: 476
Nice update mcgeezer, great to see new characters added

Forgive my question incase you mentioned it in recent past, the copper sky did you have plans to add it back later. I was quickly looking at your youtube post and last it was on was Feb 3 [ Show youtube player ]
invent is offline  
Old 14 March 2019, 23:25   #884
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by invent View Post
Nice update mcgeezer, great to see new characters added

Forgive my question incase you mentioned it in recent past, the copper sky did you have plans to add it back later. I was quickly looking at your youtube post and last it was on was Feb 3 [ Show youtube player ]
Yes mate they will be coming back at the same time i fix the background waterfalls properly, its a little tricky to code so will need to dedicate a good chunk of time to it.
mcgeezer is offline  
Old 15 March 2019, 00:19   #885
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,214
Quote:
Originally Posted by invent View Post
Don't want people to miss out on levels they can't get to.
Indeed; as a casual gamer I'm unlikely to ever play a game all the way through but I do like to have a go at every level. I realise I'm not the core audience but I suspect there are more casual gamers out there than the hardcore variety.
E-Penguin is offline  
Old 15 March 2019, 03:25   #886
invent
pixels
 
invent's Avatar
 
Join Date: May 2014
Location: Australia
Age: 52
Posts: 476
Thanks mcgeezer, no worries

As a slightly related thing, was looking at other Rygar related info (branding/flyers etc for arcade)
https://www.arcade-museum.com/game_d...p?game_id=9386
invent is offline  
Old 17 March 2019, 20:12   #887
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Another update.

I had some time this afternoon to add the last of the enemies that would appear in the first 4 rounds of the game, the dreaded Lavaman.

I'm very pleased with the way this enemy has turned out as it is extremely close to the arcade, what remains is to add the fireballs that he spits out but I need to write a general 16x16 and 16x8 blitter routine anyway for other things, for example when Rygar hits an enemy there is a little explosion, or in specific parts there are fireballs coming up from the ground...so I'll include the routine to handle all of those.

For those wondering the Lavamen are all hardware sprites while the Giant worms are all bobs.

From now on I'll concentrate on recreating the first 4 rounds of the game, tweaking the enemy speeds and debugging where needed (the game has lots of bugs).

Here's a nice video straight from WinUAE...

http://www.seismicminds.com/downloads/LavaMen.mp4

and a crap Youtube version of the same video...

[ Show youtube player ]
mcgeezer is offline  
Old 19 March 2019, 09:41   #888
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
If you encoded your video in HD you could have it running at 50fps on youtube
Hewitson is offline  
Old 19 March 2019, 11:23   #889
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Hewitson View Post
If you encoded your video in HD you could have it running at 50fps on youtube
I do encode them at 50fps using handbrake.
mcgeezer is offline  
Old 19 March 2019, 11:31   #890
ajk
Registered User
 
ajk's Avatar
 
Join Date: May 2010
Location: Helsinki, Finland
Posts: 1,341
I'm not sure if YouTube supports 50 fps at the lowest resolutions. You'd probably need to encode it at 720p (preferably with no smart interpolation, just by doubling the pixels).

The game itself is amazing work, in any case!
ajk is offline  
Old 19 March 2019, 20:13   #891
VincentGR
Registered User
 
VincentGR's Avatar
 
Join Date: Dec 2012
Location: Greece
Posts: 291
Indeed, for 50/60 fps the minimum resolution is 720p.
VincentGR is offline  
Old 24 March 2019, 13:46   #892
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Over the last week or so I haven't done much coding mainly because of family priorities but also because I have been upgrading the hardware in my current PC.

The upshot of it all is that I'm now geared up to do some tutorial game dev videos or live stream my real A1200, additionally I can now produce videos at a good resolution without affecting system performance, so those 720p videos at 60FPS now look good on Youtube.

[ Show youtube player ]

A couple of coding additions shown here is that I now have the fireballs up and running and the lava men spitting fireballs isn't far away either, but the main difference is that I've cut the binary by a whopping 120Kb... and there's still much more to go, so currently the code is 68Kb and the data is around 62Kb making it 130Kb in size.

I'll finish the lavamen spitting fire and then remove the bugs I have for the first 4 rounds.

Enjoy.
mcgeezer is offline  
Old 25 March 2019, 02:41   #893
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by ajk View Post
I'm not sure if YouTube supports 50 fps at the lowest resolutions. You'd probably need to encode it at 720p (preferably with no smart interpolation, just by doubling the pixels).
Moreover, low resolution videos have horribly blurry pixels. It looks like YouTube compresses them with much lower quality than higher resolution ones.
Even if your capture resolution is 240p, the result is of much better quality if it is passed to YouTube as 720p by simply enlarging the pixels as ajk mentioned.

Never upload low resolution videos as is or YouTube just makes a mess out of them.
ReadOnlyCat is offline  
Old 25 March 2019, 03:35   #894
turrican3
Moon 1969 = amiga 1985
 
turrican3's Avatar
 
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
you did an amazing job guys !


Merci denis.
turrican3 is offline  
Old 26 March 2019, 10:33   #895
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Here's the implementation of the Lavaman completed, I'm very pleased with it.

As you can see, the engine can throw around quite a few sprites/bob's ... so much so that I had to disable the collisions to do the video.

[ Show youtube player ]

I came up with an idea for the vertical scrolling which I should be able to implement again quite quickly on round 5, I'l probably work on that next.

Geezer
mcgeezer is offline  
Old 26 March 2019, 11:23   #896
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
It looks 100% like the arcade!
Foul is offline  
Old 27 March 2019, 16:28   #897
MageMaster
Registered User
 
Join Date: Sep 2006
Location: USA
Posts: 106
With all the ground work programming this, your code could also be used for doing other games?
MageMaster is offline  
Old 27 March 2019, 16:35   #898
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by MageMaster View Post
With all the ground work programming this, your code could also be used for doing other games?
Yep - Probably most platformers, beat em ups...even shmups...
My sprite and scrolling routines are pretty decent now.
mcgeezer is offline  
Old 29 March 2019, 23:21   #899
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
In this update I've done a massive internal change to the sprite engine, it isn't shown in the video so I'll show it in the code... this means I'll be going technical.

The animation engine in Rygar was originally written back in October 2017 when I did Beer Edition, I did have to tweak it quite a bit for Rygar but I was just never happy with it and I suspect it is the likely cause of most of the crashes in the game.

For example, i I put in some stupid limitations by accident like I could only have 16 animation frames (but could loop them), another was the whopping amount of memory required... pretty much 1Kb per sprite pre-allocated. In addition the way the sprite definitions were put together meant they were difficult to manage with lots of absolute pointers that I relocated when I cast a new sprite during a game.

I was travelling back from London on Wednesday and just wrote down a few thoughts on paper about how to do the sprite engine better...

Here's what the code originally looked like...

Code:
; Pointer Offset
ANIM_DATASIZE:	equ	1200		; whole size of each sprite data structure
ANIM_POINTERS:	equ	256		; div by 4 for max onscreen sprites
ANIM_COORDS:	equ	16
ANIM_SET:	equ	12		; animation pointers
ANIM_TEMP:	equ	4		; temp variables for sprite
ANIM_SPEED:	equ	2		;
ANIM_FRAME:	equ	32		; max 16 frames per anim set	(32)
ANIM_SET_SZ:	equ	(ANIM_SET+ANIM_TEMP+ANIM_SPEED+ANIM_FRAME)


;
; ANIMATE
;
; The sprite handler is called with the sprite to work on in d0
; Then ANIMATE is called from the handler with the animate type in d1
;
; In
; 	d0 = sprite number animate in sprite list (player 1 is 0)
; 	d1 = Type of animation ie. (0 standing, 1 walk left, 2 walk right)
; Out:
;	d6 = -1 = End of sprite loop reached
;
ANIMATE:	;move.w	d0,d5
	
		lea 	SPRITE_SLOTS,a0
		move.l	(a0,d0*4),a0
		tst.l	a0
		beq	.exit
		move.l	(a0)+,d3		; d3/a1 now points to spr #
		beq	.exit
		move.l	d3,a1

		tst.w	(a1)			; If sprite is not active
		bmi	.exit			; then just exit.

		move.l	d1,d6
		add.w	d1,d1
		add.w	d1,d1
		moveq	#0,d2
		addq.w	#4,a0

		add.l	d1,a0

		move.l	(a0),a0			; Get the sprite pointer

		cmp.l	#0,a0			; Fail safe!!!!
		beq.s	.exit

		move.l	(a0),a1			; work pointer

		move.l	4(a0),a2		; frame index pointer
		move.l	8(a0),a3		; Speed pointer

		cmp.l	#0,a3			; Fail safe!!!!
		beq.s	.exit
	
		move.w	(a1),d1			; frame index
		move.w	2(a1),d2		; current speed at
		
		add.w	d1,d1
		and.l	#$ffff,d1
		add.l	d1,a2
		
		move.l	d3,a0
		move.w	(a2),(a0)

.nowrite:
		move.l	a2,a0
		addq.w	#2,a0		

; need to compare $fffe here for play sprite once.
; if true then we need to disable and pop the sprite from the list.
; Are we at the end of the loop?
		tst.w	(a0)
		bpl.s	.cont
; Yes we are, reset loop counter back to zero.
		clr.w	(a1)			; reset from start		
		moveq	#-1,d6

; Has the speed reached the set speed?
.cont:		cmp.w	(a3),d2			; speed reached?  next frame
		bne.s	.loopdone
		clr.w	2(a1)
		addq.w	#1,(a1)			; SPEED		
.loopdone:	addq.w	#1,2(a1)
.exit		rts

	
;
; PUSH_SPRITE
; 
; Adds a sprite in the sprite list
;
; In:
; 	d0 = Sprite type (0, bombjack, 1=MUMMY
; 	d1 = start xpos
; 	d2 = start ypos
; 	d3 = sprite control word to set
; 	a0 = address of handler to assign
;
; Out:
;	d4 = Allocated Sprite number
PUSH_SPRITE:
	move.l	d6,-(a7)
	cmp.w	#MAX_ACTIVE_SPRITES-1,NUM_SPRITES_INPLAY			; Sprites may be pushed 
	beq	.exit
	addq.w	#1,NUM_SPRITES_INPLAY
 	lea	SPRITE_SLOTS,a2    	; Pointer to available sprite list
	lea	SPRITE_FREE_LIST,a1
	moveq	#0,d4
	moveq	#0,d5
	moveq	#0,d6
	moveq	#0,d7
.spr1:	cmp.w	#-1,(a1)		; Find next spare sprite
	beq	.spare			; In free list.
	addq.w	#1,d4			; Slot count!
	addq.w	#2,a1
	bra.s	.spr1
	
.spare:
	move.w	d0,(a1)
	
	move.l	MEMCHK0_SPR_STRUCTURES,a3
	move.w	d4,d5			
	mulu	#ANIM_DATASIZE,d5    	; d5 = Index to sprite slot 
	swap	d5
	clr.w	d5
	swap	d5
	lsl.w	#2,d4    		; 
	add.l	d4,a2    		; a2 = Sprite slot pointer now
	add.l	d5,a3 			; a3 now points to sprite structure 
					; in chip ram
	move.l	a3,(a2)			; copy base location to Sprite list

	move.l	a3,d6			; save a3
	add.l	#ANIM_POINTERS,d6    	; Anim pointers list size (max 32)
	move.l	d6,(a3)    		; Store pointer for Sprite Coords
					; section.
	move.l	d6,a2		
	clr.w	(a2)    		; Initialize Sprite number (unused)
	move.w	d1,2(a2)    		; Store x pos
	move.w	d2,4(a2)    		; Store y pos
	move.w	d3,6(a2)    		; Store control word 1
	move.l	a0,4(a3)		; Store sprite handler address

	addq.w	#8,a3			; Index to buffer pointers
	
; Thats all about we can do with the destination data now
; we now have to get the rest from the specific sprite configuration.
	
	add.l	#ANIM_COORDS,d6		; wtf??? don't add up.  BUG
	
	lea 	SPRITE_DEFS,a0    	; Get sprite configuration pointer
	lsl.w	#2,d0    		; Index to correct sprite.

	swap	d0
	clr.w	d0
	swap	d0

	add.l	d0,a0    		; a0 now has correct sprite address
	
	move.l	(a0),a0			; Get the pointer to sprite coords
	addq.w	#8,a0    		; Jump over vars and control handler

; a0 now points to addresses for each animation set.
; eg.  dc.l ANIM_BJ_STAND, ANIM_BJ_WALKLEFT, ANIM_BJ_WALKRIGHT, $ffff
		         		
	moveq	#0,d7
	move.l	a3,d3		 		

	move.l	a0,a2	

.loop:			 
	move.l	(a0)+,a1 		; a1 is now has the animation set addr
	addq.w	#1,d7	 		; count number of animation types
					; for later use.

	move.l	d6,(a3)+		; Store animation type pointer
	
	add.l	#ANIM_SET_SZ,d6		; Point to next animation set
	cmp.w	#-1,(a0)		; Are we at the end of the
					; frame pointers yet?
	bne.s	.loop
	move.l	a2,a1			; restore pointers
	

	subq.w	#1,d7			; d7 now has number of animations
					; per sprite, eg walking left,
					; walking right, standing, jumping.
;--- now we copy each animation set
	
.anim_loop:
	move.l	d3,a3	

; --- This is now the start of the Animation sprite loop
	move.l	(a3)+,a2		; eg ANIM_BJ_STANDING in a4
	move.l	a2,d6			; 
	add.l	#12,d6			; d6 now points to ANIM TEMP
	move.l	d6,(a2)
	add.l	#ANIM_TEMP,d6
	move.l	d6,4(a2)		; store Frame set pointer
	add.l	#ANIM_FRAME,d6		;
	move.l	d6,8(a2)		; store Animation speed pointer
;
; a1 now has pointer to Anim_set to be copied (3 pointers)
; a4 now has pointer to Anim_set destination
	move.l	(a2),a3			; copy sprite frame attributes

	move.l	(a1),a0
	cmp.l	#0,a0
	beq	.next
		
	move.l	(a0),a0	
	move.l	(a0),(a3)

	move.l	(a1),a0
	
	move.l	8(a2),a3
	move.l	8(a0),a0
	move.w	(a0),(a3)
	
	move.l	(a1),a0
	move.l	4(a2),a3
	move.l	4(a0),a0
	
; Now we copy the animation frame set

.loop1:
	move.w	(a0)+,(a3)+		; copy Animation frames set
	cmp.w	#-1,(a0)
	bne	.loop1
	move.w	#-1,(a3)		; must end with -1

.next:	addq.l	#4,a1	
	addq.l	#4,d3
	dbf	d7,.anim_loop
.exit:	lsr.w	#2,d4
	move.l	(a7)+,d6
	rts
Experienced coders will look and that and come up with the realisation that it is a pile of shit... I'm dealing with absolute addresses all over the place is the main concern.

I'll reiterate... that was written 18 months ago, and before that I never touched 68K for 25 years.

And here's the new routines...

Code:
;
; ANIMATE
;
; The sprite handler is called with the sprite to work on in d0
; Then ANIMATE is called from the handler with the animate type in d1
;
; In
; 	d0 = sprite number animate in sprite list (player 1 is 0)
; 	d1 = Type of animation ie. (0 standing, 1 walk left, 2 walk right)
; Out:
;	d6 = -1 = End of sprite loop reached
;
ANIMATE:	
		move.l	d0,-(a7)
		move.l	d1,-(a7)
	
		lea 	SPRITE_SLOTS,a0
		move.l	(a0,d0*4),a0		; PLR_RYGAR
; a0 points to sprite base.	
		
		move.l	a0,a1
		move.l	a0,a2
		move.l	a0,a3
		
		addq.w	#6,a0			; Point to Animation Sets
		add.w	(a0,d1*2),a1		; a1 now pointing to base animation set
		
		move.l	a1,a0
		move.l	a2,a1

		add.w	0(a0),a1		; a1 points to variables
		add.w	2(a0),a2		; a2 points to frames
		add.w	4(a0),a3		; a3 points to speed
		
		lea 	SPRITE_SLOTS,a0		
		move.l	(a0,d0*4),a0
		add.w	(a0),a0			; a0 points to global sprite vares
		
;----		
		move.w	(a1),d1			; Current frame
		move.w	(a3),d2			; Current speed
		
		moveq	#0,d6
		move.w	(a2,d1*2),d3		; Store the current frame

; need to compare $fffe here for play sprite once.
; if true then we need to disable and pop the sprite from the list.
; Are we at the end of the loop?
		bpl.s	.cont
; Yes we are, reset loop counter back to zero.
		clr.w	(a1)			; reset frame from start		
		addq.w	#1,d3			; is value $fffe->$ffff or $ffff->$0000?
		beq.s	.end			; If not zero then do not set end of animation flag.
		moveq	#-1,d6			; Was $fffe (-2) so set end flag.
		
.end:		moveq	#0,d1
		move.w	(a2,d1*2),d3		; 		

; Has the speed reached the set speed?
.cont:		move.w	d3,(a0)			; Set Frame
		cmp.w	2(a1),d2		; speed reached?  next frame
		bne.s	.loopdone
		move.w	#-1,2(a1)
		addq.w	#1,(a1)			; Next frame		
.loopdone:	addq.w	#1,2(a1)		; Increase speed.
.exit		
		move.l	(a7)+,d1
		move.l	(a7)+,d0

		rts


;
; CAST_SPRITE
;
; Adds a sprite in the sprite list
;
; In:
;       d0 = Sprite type (0, bombjack, 1=MUMMY
;       d1 = start xpos
;       d2 = start ypos
;       d3 = sprite control word to set
;       a0 = offset address of handler to assign
;
; Out:
;       d4 = Allocated Sprite number
PUSH_SPRITE:
        cmp.w   #MAX_ACTIVE_SPRITES-1,NUM_SPRITES_INPLAY                        ; Sprites may be pushed
        beq     .exit
        addq.w  #1,NUM_SPRITES_INPLAY
        lea     SPRITE_FREE_LIST,a1

        moveq   #0,d4
.spr1:  cmp.w   #-1,(a1)+               ; Find next spare sprite
        beq     .spare                  ; In free list.
        addq.w  #1,d4                   ; Slot count!
        bra.s   .spr1

.spare:
	move.w	d0,-2(a1)
	lea	SPRITE_DEF_BASE,a1
        lea     SPRITE_DEFS,a2
        add.w   (a2,d0*2),a1            ; CHECK THIS FOR OVERFLOW.
; a1 now points to source

        lea     SPRITE_SLOTS,a2         ; Pointer to available sprite list
        move.l  (a2,d4*4),a2
; a2 now points to available sprite space.
; copy the sprite to a2

.copy_sprite
        move.l  (a1)+,d5
        cmp.l   #$80808080,d5
        beq.s   .copy_done
        move.l  d5,(a2)+
        bra.s   .copy_sprite

.copy_done:
; a2 now has copy of the sprite data.
        lea     SPRITE_SLOTS,a1         ; Pointer to available sprite list
        move.l  (a1,d4*4),a1

; a1 now back at the head of the sprite data.

        move.l  a0,2(a1)                ; Save the sprite handler address
	move.l	a1,a2
        add.w   (a1),a2                 ; a2 now pointing to sprite vars
        move.w  d0,(a2)                 ; Initialize Sprite number (unused)
        move.w  d1,2(a2)                ; Store x pos
        move.w  d2,4(a2)                ; Store y pos
        move.w  d3,6(a2)                ; Store Type
.exit:  rts
The two rewritten routines are miles faster and less complicated. They work much better and have very few limitations, they're also easily expandable too!

I'm pretty sure my ability to solve complex problems in the last 18 months drastically increased!!!!! Learning and practising assembler has some lifestyle benefits!

On another note I've added the vertical scrolling parts, now in this one I'm cheating a little. I could have opted to use the copper to do a video split, but this would have meant I would have had to modify the sprite plotting routine quite alot... instead, I'm simply blitting the upper and lower parts required to rebuild the vertical display because I have enough DMA to do it with the required number of sprites that are in the arcade game.

[ Show youtube player ]

Geezer
mcgeezer is offline  
Old 30 March 2019, 01:43   #900
turrican3
Moon 1969 = amiga 1985
 
turrican3's Avatar
 
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
mcgeezer,
how and when did you learn assembler ??? from a book ??
turrican3 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Entry: Rygar AGA Edition mcgeezer Coders. Entries 75 28 February 2019 20:41
On the Ball - World Cup Edition AGA djcasey request.Old Rare Games 4 25 January 2013 12:39
On The Ball League Edition AGA , Player Manager 2 StarEye Games images which need to be WHDified 11 22 January 2010 18:21
The Vague #1 AGA-RTG edition is released ! kas1e Amiga scene 12 30 October 2007 00:27
On The Ball: World Cup Edition AGA CodyJarrett request.Old Rare Games 11 27 May 2003 06:14

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18157 seconds with 14 queries