English Amiga Board


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

 
 
Thread Tools
Old 28 August 2018, 10:44   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Misc Blitz Demos

Started open sourcing some random Blitz things to Github. I'll add some more over time.

https://github.com/earok/BlitzBasicDemos

Only two so far - the 1942 tutorials, and a splatoon anim demo thing ( [ Show youtube player ])

Last edited by earok; 28 August 2018 at 10:51.
earok is offline  
Old 28 August 2018, 11:51   #2
adolfo.pa
Registered User
 
Join Date: Aug 2017
Location: Spain
Posts: 30
Thanks Earok! This is much appreciated.

Are both code and resources (sprites) covered by the MIT licence, or only the code?
adolfo.pa is offline  
Old 28 August 2018, 12:59   #3
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by adolfo.pa View Post
Thanks Earok! This is much appreciated.

Are both code and resources (sprites) covered by the MIT licence, or only the code?
Just the code, I can't legit claim to own any of the other resources.
earok is offline  
Old 01 September 2018, 11:12   #4
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Added a new demo for sprite multiplexing, everything here is rendered with 16 colour sprites alone (no bobs). I hacked this together because I needed something a bit more powerful than the CustomSprites command.



It's pretty rough though - it only supports attached (16 colour) sprites and doesn't fully support all Sprite features (high resolution positioning etc). As above I only really made this for a very bespoke purpose, but it should be enough to help you get started on your own multiplexing solution if you need something a bit more powerful than what Blitz offers built in.
earok is offline  
Old 15 September 2018, 08:49   #5
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Some other random Blitz related repos:

https://github.com/earok/GloomAmiga <- Gloom is an ASM game, but the tools were written in Blitz and thus the source is available. They're all tokenised though so you'll need to open them in Blitz to be able to read them.

https://github.com/earok/MrZen <- Mr Zen is a platformer that was sent in to the Amiga Format Blitz Basic competition. Source is provided with permission from the original developer.

https://github.com/earok/SpaceMan <- Spaceman is an isometric shooter that was also sent in to the Amiga Format Blitz Basic competition. I haven't made contact with the original developers so I'm happy to take it down if they object. I have made a couple of my own changes to the source and checked it in (if you want to see the original source, you just have to go back to the initial commit)
earok is offline  
Old 12 October 2018, 11:41   #6
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Added a new demo, this covers Interleaved graphics mode for faster blitting.
earok is offline  
Old 13 November 2018, 21:12   #7
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Added a fifth demo, covers interlaced graphics (the demo displays a 640x512 image in AGA using DisplayLibrary)
earok is offline  
Old 26 December 2018, 11:40   #8
wilshy
Registered User
 
Join Date: Jan 2008
Location: SouthEast-ish UK
Posts: 372
Very much appreciated!
wilshy is offline  
Old 13 January 2019, 12:36   #9
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
Hi
I started doing similar thing with my old BB code.

First: HAM anim player
please us this link below to go to my blog where you'll find video showing how it looks like, plus a link to my GitLab with source code and assets.
In the blog post also some info how it was done. I'll add comments to code soon. Right now the code is compilable but not commented very well.

http://retronavigator.com/post/181974639563/amiga-ham-anim-player-in-blitz-basic

Enjoy and le t me know what you think
carrion is offline  
Old 10 February 2019, 03:53   #10
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
@carrion nice TimeGal and Road Avenger work on a similar principle, though images are constantly being loaded from disk, the animations are cycled on the vblank interrupt.

New demo, how to read a CD Table of contents. Note that the lengths are, on average, about 10 seconds too long - I presume this is due to the spacing between tracks (at least on my test disc).

It's posted to github but the source is here too.

Code:
WBStartup
DEFTYPE .w

NEWTYPE .Typ_Time
	Reserved.b ;Reserved (always zero)
	Minute.b ;Minutes (0-72ish) 
	Second.b ;Seconds (0-59)
	Frame.b ;Frame   (0-74)
End NEWTYPE

NEWTYPE .Typ_TOCSummary
	FirstTrack.b ;First track on disk (always 1)
	LastTrack.b ;Last track on disk
	LeadOut.Typ_Time ;Beginning of lead-out track
End NEWTYPE

NEWTYPE .Typ_TOCEntry
	CtlAdr.b ;Q-Code info  
	Track.b ;Track number
	Position.Typ_Time ;Start position of this track
End NEWTYPE

NEWTYPE .Typ_TOCData
	Summary.Typ_TOCSummary
	Tracks.Typ_TOCEntry[100]
End NEWTYPE

*TocPointer.Typ_TOCData

if InitCD32
	CDType = ExamineCD32
	*TocPointer = TocCD32
	NPrint "Number of tracks: " + Str$(*TocPointer\Summary\LastTrack)
	
	if *TocPointer\Summary\LastTrack > 0
		for i = *TocPointer\Summary\FirstTrack to *TocPointer\Summary\LastTrack
		
			;The starting position of this track
			Minutes$ = Str$(*TocPointer\Tracks[i-1]\Position\Minute)
			Format "00"
			Seconds$ = Str$(*TocPointer\Tracks[i-1]\Position\Second)		
			Format ""
			
			;Calculate the time of this track
			StartTime = *TocPointer\Tracks[i-1]\Position\Minute*60 + *TocPointer\Tracks[i-1]\Position\Second
			if i = *TocPointer\Summary\LastTrack
				EndTime = *TocPointer\Summary\LeadOut\Minute*60 + *TocPointer\Summary\LeadOut\Second				
			else
				EndTime = *TocPointer\Tracks[i]\Position\Minute*60 + *TocPointer\Tracks[i]\Position\Second
			endif
			
			TotalTime = EndTime - StartTime
			Minutes2$ = Str$(TotalTime / 60)
			Format "00"			
			Seconds2$ = Str$(TotalTime mod 60)
			Format ""
			NPrint "Track " + Str$(i) + " Offset: " + Minutes$ + ":" + Seconds$ + " Time: " + Minutes2$ + ":" + Seconds2$
			
		next
	endif
else
	NPrint "Cannot initialise CD drive"
endif

End
earok is offline  
Old 18 February 2019, 10:10   #11
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Thanks for these demos earok! Could you perhaps make a demo of the 8-way scrolling system you made for Kiwi's Tale? It seems to be really smooth, I would love something similar for an overhead rpg/adventure game but I can't figure out the vertical scrolling part.
MickGyver is offline  
Old 18 February 2019, 10:15   #12
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Vertical scrolling was painful to implement. I've posted some of it in the Kiwi's Tale thread (the one in the blitz forum) but the gist of is:

- use the copper to split /wrap the bitmap at edges
- use clipblit twice when the Bob needs to be blitted on both sides of the divide (otherwise, regular blit is fine)

I'll think about doing a proper demo sometime
earok is offline  
Old 18 February 2019, 11:47   #13
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Quote:
Originally Posted by earok View Post
Vertical scrolling was painful to implement. I've posted some of it in the Kiwi's Tale thread (the one in the blitz forum) but the gist of is:

- use the copper to split /wrap the bitmap at edges
- use clipblit twice when the Bob needs to be blitted on both sides of the divide (otherwise, regular blit is fine)

I'll think about doing a proper demo sometime
Ok, thanks man! I will see if I can to figure it out from that thread.
MickGyver is offline  
Old 13 June 2019, 15:25   #14
activist
Registered User
 
Join Date: May 2017
Location: Dublin Ireland
Posts: 46
Hi Earok, could you github the source for the 'Amiga Mode 7 test (Copper Chunky)' possibly if get a chance. Thought it was cool.

[ Show youtube player ]
activist is offline  
Old 19 September 2019, 08:55   #15
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
The copper chunky demo is bit of a mess, I might dig it up and post it sometime.

With permission of the original author, the source code to Blitzeroids (one of the Amiga Format Blitz Basic competition games) has been uploaded to github.

https://github.com/earok/blitzeroids

[ Show youtube player ]
earok is offline  
Old 19 September 2019, 11:38   #16
activist
Registered User
 
Join Date: May 2017
Location: Dublin Ireland
Posts: 46
Quote:
Originally Posted by earok View Post
The copper chunky demo is bit of a mess, I might dig it up and post it sometime.
No worries,thank you and fair play for sharing all the code so far.

Question. Do you know of any examples of old school pseudo 3d 2d driving game in blitz. Doesn't seem to be much out there. Am interested in the genre and finding out whats possible thanks
activist is offline  
Old 14 April 2020, 00:55   #17
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Quote:
Originally Posted by earok View Post
Added a new demo for sprite multiplexing, everything here is rendered with 16 colour sprites alone (no bobs). I hacked this together because I needed something a bit more powerful than the CustomSprites command.



It's pretty rough though - it only supports attached (16 colour) sprites and doesn't fully support all Sprite features (high resolution positioning etc). As above I only really made this for a very bespoke purpose, but it should be enough to help you get started on your own multiplexing solution if you need something a bit more powerful than what Blitz offers built in.
Hi Earok - was possibly going to try and use your code for my Flappy Bird game as need a few more sprites to play with but I can't get you demo code to compile. Gets stuck here:

Code:
*s.sprite = Addr Sprite(MegaSprites()\ID)

		;Default Positions
		XPos = MegaSprites()\X + 64
		YPos = MegaSprites()\Y + 44

		pos.w = ((YPos & $ff) lsl 8) | (XPos & $ff)
		ctrl.w = (((YPos + *s\_height - 1) & $ff) lsl 8) | $80
		d1.l = *s\_data
		d2.l = d1 + *s\_nextoff
I'm obviously missing something as *s.sprites comes up with unknown type (and so do all the *s lines). I guess this is something to do with passing the sprite data to your routine but it has me beat.

Help!
Havie is offline  
Old 14 April 2020, 01:14   #18
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
You need to do this if you haven't already (BB2OBJTYPES.RES will need to be present in your source folder)



I'm not so sure that a multiplexing routine would be a good fit for a flappy bird clone? Just hypothetically, you could do:

- Flappy Bird as a single 16px wide, 16 color sprite. Channels 1-2
- For an entire pipe section, including top, middle gap and bottom, do this as a single really tall, 16px wide 4 color sprite. That should allow you to get six pipes on screen at once.
earok is offline  
Old 14 April 2020, 11:17   #19
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Thanks I think that's my problem.

Yes, if my pipes were 16 pixels wide, all would be easy but I am using original graphics and the pipes are 24 pixels wide and need 2 sprites each hence the need for extra sprites. Trying to make my clone as accurate as possible.

Does you multiplex routine allow more than 1 sprite per scan line?
Havie is offline  
Old 14 April 2020, 13:08   #20
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Ah, I see.

The routine doesn't allow reuse of sprites on the same scanline, though that's certainly possible on Amiga hardware (see Codetapper's article on Jim Power), but that'd be hard to pull off. To reuse a sprite on the same scanline, you'd need to program the copper to wait until after the sprite was drawn the first time, and then reposition the sprite to the new area (and repeat this for every single scanline with the sprite)


I'd be impressed if you could do it, but still there's some much easier ways:
- AGA (32x wide sprites)
- Or, if you really want to target OCS, I'd recommend using a horizontal scrolling routine with the pipes blitted to the background
earok 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
[blitz basic] How much amiga-blitz friendly is this? saimon69 Coders. Blitz Basic 105 21 April 2022 19:45
Source Code for finished games/demos in Blitz? diablothe2nd Coders. Blitz Basic 15 14 November 2012 22:04
FS: Misc stuff BinoX MarketPlace 6 08 June 2007 12:34
Misc questions Frootloop project.SPS (was CAPS) 12 02 August 2003 04:39
abe.misc Twistin'Ghost Retrogaming General Discussion 16 15 October 2001 20:55

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 20:24.

Top

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