English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 02 December 2018, 13:37   #1
rothers
Registered User

 
Join Date: Apr 2018
Location: UK
Posts: 47
Are sprites faster than bobs?

I'm currently porting something over to the Amiga from the PC and I'm wondering which I should use, sprites or bobs for speed?

I'm aware of how the sprites work and their limitations.

I'm going for 16 colours, possibly using dual playfield, only scrolling up and down with hardware screens.

I'm assuming AMOS sprites (with how they work in hardware) might have speed issues and not be worth the effort, what's the consensus? Would I be better off using one of the dual playfield screens for bobs and using the clear trick?
rothers is offline  
Old 02 December 2018, 13:48   #2
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 1,288
Sprites are much, much faster but much, much more limited.

It depends a bit on screen depth/mode, but a good rule of thumb is that sprites are 10+x the speed of a bob.
roondar is offline  
Old 02 December 2018, 19:17   #3
frank_b
Registered User
 
Join Date: Jun 2008
Location: Boston USA
Posts: 441
To put a one line sprite (4 colours 16 wide) on the screen takes four dma ticks. Per line it is two.. there's 2 needed for the positioning IIRC.
To put it there via the blitter it takes something like.

a) background save 2 dma ticks * 2 * 2 words (for shifting) : 8 ticks
b) mask 4 ticks per word * 2 * 2 (for shifting) : 16 ticks
c) backround restore 2 dma ticks * 2 * 2 : 8 ticks

So yeah.. a bit more efficient to use sprites
frank_b is offline  
Old 02 December 2018, 22:49   #4
volvo_0ne
Registered User

 
Join Date: Mar 2015
Location: Sheffield UK
Posts: 360
Quote:
Originally Posted by roondar View Post
Sprites are much, much faster but much, much more limited.

It depends a bit on screen depth/mode, but a good rule of thumb is that sprites are 10+x the speed of a bob.
This is true...

Try writing a routine with bobs v bobs & collision detection

then the same routine using sprites v sprites or even sprites v bobs.

You'll find the change of pace amazing

just do Timer=0

before the routine

then Print Timer at the end

and repeat it a few times, it'll soon become obvious that even with the screen conversion overhead, sprites are MUCH faster.


[EDIT]
If you use AMAL for machine controlled sprites/Bobs There will be a another speed increase!

[/EDIT]

Last edited by volvo_0ne; 02 December 2018 at 22:57.
volvo_0ne is offline  
Old 03 December 2018, 10:18   #5
Steril707
Tigerskunk!

Steril707's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 971
Sprites are actually super fast, but you only got 4 of them if you need 16 colors, and those are only 16-pixel wide.

You could write yourself a multiplexer, though.
Steril707 is offline  
Old 04 December 2018, 03:44   #6
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 304
Sprites are probably best if treated like their own, narrow, relatively static, playfield as an overlay, like for scores, lives left, power, etc.
mc6809e is offline  
Old 04 December 2018, 21:52   #7
rothers
Registered User

 
Join Date: Apr 2018
Location: UK
Posts: 47
Quote:
Originally Posted by volvo_0ne View Post
This is true...

Try writing a routine with bobs v bobs & collision detection

then the same routine using sprites v sprites or even sprites v bobs.

You'll find the change of pace amazing

just do Timer=0

before the routine

then Print Timer at the end

and repeat it a few times, it'll soon become obvious that even with the screen conversion overhead, sprites are MUCH faster.


[EDIT]
If you use AMAL for machine controlled sprites/Bobs There will be a another speed increase!

[/EDIT]
Thanks! I shall use sprites.

Should be interesting back porting a game from PC, I've got some good hardware tricks in mind.
rothers 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
New tutorial on BOBs Yragael Coders. Tutorials 9 15 August 2018 00:00
Clipping bobs roondar Coders. General 18 24 September 2015 09:54
Most effective way of converting sprites /bobs jimmy2x2x Coders. General 10 27 November 2014 18:22
FS: Various bits n bobs jujasi MarketPlace 0 12 July 2009 19:13
Bobs Garden Big-Byte Amiga scene 7 26 October 2002 11:24

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 05:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06531 seconds with 15 queries