English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 27 July 2017, 19:12   #1
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
2D Platformer Engine

OK time to start a new thread.
As mentioned elsewhere I started to work on a 2d Platformer Engine some time ago. Posted even as example in Gallahad's thread in Amiga Scene forum on EAB.
Well. Today's the time to show the latest progress with this little Blitz Basic Platform Engine.

http://retronavigator.com/post/16349...-2d-engine-v05

Facts about this early version (0.05)
- It's Blitz Basic 2.1 with no Asm code yet - pure BB2
- It's AGA (and decided to remain AGA)
- It uses sprites (no blitting yet) and 16 color tilemap bitmap (will change to more colors or dbl-plfld)

I count on your help guys! There's a lot to be done!
I still don't know so many things about BB2, so expect lots of questions
carrion is offline  
Old 27 July 2017, 19:31   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
There is a hack for dual playfields I have never seen done before. AGA can bank switch a playfield palette to another set of 16 with a single Copper move to allow double buffering of color changes or more. A platformer would be uniquely suited for such an effect.
Samurai_Crow is offline  
Old 28 July 2017, 00:16   #3
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,644
Good job!
Amiga1992 is offline  
Old 28 July 2017, 12:35   #4
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
ok. continuing discussion from other thread...
I think I get the idea of Double buffering. I still think it's hardly adaptable to my case as I should have repaint all tiles. Will investigate though.

But I started to have more questions regarding current version of my engine - the sprites.
I have 32pix wide sprites - 16 colors.
But I can only display 2 at the same time. Is it OK? I thought that in this mode I could display 4 of them if I understand sprite channels correctly.
what I do is

DisplaySprite COP0, shape, x,y, 0 - for player sprite
DisplaySprite COP0, shape2, x,y, 2 - for enemy1

but when adding
DisplaySprite COP0, shape2, x,y, 4 - for enemy2
the 3rd sprite is colored badly as it would lack free chanels

how should this work to show 4 sprites ?
carrion is offline  
Old 28 July 2017, 12:41   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
You don't have to repaint all tiles when doublebuffering unless you're repaint all tiles when singlebuffering as well.

You have eight sprite channels, with four colours per sprite. A sprite with 16 colours consumes two channels (a so-called attached sprite). One sprite is 16 pixels wide, which means that a 32-pixel, 16-colour sprite consumes four channels.

This is how OCS sprites work. With AGA, you can have 32- and 64-pixel sprites, but you must set the correct fetchmode (I think) to use those features.

Last edited by idrougge; 28 July 2017 at 12:50.
idrougge is offline  
Old 28 July 2017, 13:48   #6
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
I set correct fetch mode I guess because as seen on the move above sprites are displayed correctly
I did it the way the shmup demo does
my problem is I can't display more than 2 sprites, sprites on channel 4 and 6 are displayed incorectly
carrion is offline  
Old 28 July 2017, 15:41   #7
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
If you scroll horizontally you have to allow space on the left side of the screen to fetch the first section of the playfields before it is offset to the right.
Samurai_Crow is offline  
Old 28 July 2017, 16:12   #8
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
@Samurai Crow
Sorry I don't get that. What you mean?
carrion is offline  
Old 28 July 2017, 16:42   #9
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Leave a wide border and see if it works.
Samurai_Crow is offline  
Old 28 July 2017, 16:48   #10
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
OK I think I fixed it.
I was experimenting with InitCopList "type" parameter. Seems it should be $14438 and I had $12438 before.

OK next thing on features list - parallax scrolling.
carrion is offline  
Old 28 July 2017, 17:32   #11
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Which resolution are you going to use?
Samurai_Crow is offline  
Old 28 July 2017, 17:50   #12
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
I use lores . main level window is 320x224. Why?
carrion is offline  
Old 28 July 2017, 18:31   #13
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
You will lose sprites if you scroll horizontally at 320 pixels wide. Try 276x224 with the left border set at 104 pixels offset to allow the sprites and 32 bits of horizontal offset for the smooth scroll register to fetch the data.
Samurai_Crow is offline  
Old 29 July 2017, 11:20   #14
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
Quote:
You will lose sprites if you scroll horizontally at 320 pixels wide.
well that's exactly why I started to notice when adding more sprites.

I started to play with DisplayAdjust command
DisplayAdjust CopList#,fetchwid,ddfstrt,ddfstop,diwstrt,diwstop

but TBH even looking into HRM it's still a mystery and I just try and fail rather than know what I'm doing.
for now when the params are set like this:

Code:
DisplayAdjust CopList#,-1,7,0,16,-16
I see all sprites but the scrolling gets broken (jumpy) when scrolling.
I think I need some help from more hardware experts

@Samurai Crow
how the params you suggest apply to the DisplayAdjust command?
carrion is offline  
Old 29 July 2017, 11:23   #15
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Sorry, I am unfamiliar with Blitz BASIC, I program in AmigaE.

Edit: If the last 2 parameters are the left and right side adjustments, change them to 32 and -32 respectively.

Last edited by Samurai_Crow; 29 July 2017 at 11:41.
Samurai_Crow is offline  
Old 29 July 2017, 13:55   #16
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
The HRM won't really help you since it's OCS/ECS only. I think the Blitz manual has some pre-made values for your situation.
idrougge is offline  
Old 29 July 2017, 15:44   #17
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
I played a bit with the parameters and looks like I've found the solution
DisplayAdjust cop0, -2,8,0,16,-16

looks like these parameters are also used in one example in BB manual. Thanks idrouge - I'll look in there more often.
carrion is offline  
Old 01 August 2017, 17:41   #18
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
OK parallax scrolling works fine.
+ more new features.
Take a look
http://retronavigator.com/post/16367...2d-platfoermer
carrion is offline  
Old 01 August 2017, 21:31   #19
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
This is looking really impressive and very smooth.
Havie is offline  
Old 02 August 2017, 01:28   #20
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
I'll read/view all of it later. Keep proceeding anyway, best wishes from me.
Cylon 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
Best ever Amiga platformer? Fingerlickin_B Retrogaming General Discussion 104 11 February 2016 20:39
a little platformer I'm working on mjnurney Amiga scene 8 03 March 2015 20:22
Best PD Platformer? Dreedo request.Old Rare Games 11 13 August 2011 17:45
puzzle platformer Asimir Looking for a game name ? 4 19 November 2005 23:50
3d platformer superquake Looking for a game name ? 4 04 October 2005 20:42

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 14:22.

Top

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