English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. Blitz Basic (http://eab.abime.net/forumdisplay.php?f=126)
-   -   Misc Blitz Demos (http://eab.abime.net/showthread.php?t=93958)

earok 28 August 2018 10:44

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 (https://youtu.be/o4zDDVjbCAo)

adolfo.pa 28 August 2018 11:51

Thanks Earok! This is much appreciated.

Are both code and resources (sprites) covered by the MIT licence, or only the code?

earok 28 August 2018 12:59

Quote:

Originally Posted by adolfo.pa (Post 1264767)
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 01 September 2018 11:12

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.

https://i.imgur.com/hIaHe3m.png

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 15 September 2018 08:49

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 12 October 2018 11:41

Added a new demo, this covers Interleaved graphics mode for faster blitting.

earok 13 November 2018 21:12

Added a fifth demo, covers interlaced graphics (the demo displays a 640x512 image in AGA using DisplayLibrary)

wilshy 26 December 2018 11:40

Very much appreciated!

carrion 13 January 2019 12:36

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

earok 10 February 2019 03:53

@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


MickGyver 18 February 2019 10:10

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.

earok 18 February 2019 10:15

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

MickGyver 18 February 2019 11:47

Quote:

Originally Posted by earok (Post 1305465)
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.

activist 13 June 2019 15:25

Hi Earok, could you github the source for the 'Amiga Mode 7 test (Copper Chunky)' possibly if get a chance. Thought it was cool.

https://www.youtube.com/watch?v=s2dXdTxErZQ

earok 19 September 2019 08:55

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

https://www.youtube.com/watch?v=poX2FSl3dqk

activist 19 September 2019 11:38

Quote:

Originally Posted by earok (Post 1346428)
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

Havie 14 April 2020 00:55

Quote:

Originally Posted by earok (Post 1265939)
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.

https://i.imgur.com/hIaHe3m.png

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!

earok 14 April 2020 01:14

You need to do this if you haven't already (BB2OBJTYPES.RES will need to be present in your source folder)

https://i.imgur.com/bLGbR5x.png

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.

Havie 14 April 2020 11:17

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?

earok 14 April 2020 13:08

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


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.04811 seconds with 11 queries