BB4W or BBCSDL??

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
Hated Moron

Re: BB4W or BBCSDL??

Post by Hated Moron »

kigohhere wrote: Mon 19 Dec 2022, 08:58 On the other hand, I tried to read a tutorial about platform game development (another BASIC language) some years ago but I could not fully understand it. Thus I always think that programming platform game is hard.
The whole approach to writing games changed when PCs became fast enough to redraw the entire 'scene' every frame, just like a video.

Prior to that, various special techniques had to be adopted to achieve an acceptable speed: hardware scrolling, sprites, palette animation etc. They could make a huge difference to the performance, but were quite limiting. For example hardware scrolling might only be able to scroll the entire screen, so if you wanted to scroll just a portion, it didn't help. Sprites might be limited in their size, and might have only a binary transparency (each pixel entirely transparent or entirely opaque).

Now everything is done differently. At the start of each frame you completely clear the screen and then you draw, from scratch, everything in the scene (generally working from the back towards the front, so foreground objects naturally appear in front of background objects). So long as you can draw everything in one frame period, all the limitations are removed.

All DW's games work this way. I can't see any obvious reason why a platform game should be any more difficult than any other when this approach is used. And although you say DW has never written a platform game before, I would draw your attention to the Treasure Tower sub-game in his prizewinning Maisie Bones submission of a few years ago. That is to all intents and purposes a platform game, in my understanding of the term.
kigohhere
Posts: 69
Joined: Fri 20 Apr 2018, 00:56

Re: BB4W or BBCSDL??

Post by kigohhere »

Hated Moron wrote: Mon 19 Dec 2022, 11:49
kigohhere wrote: Mon 19 Dec 2022, 08:58 On the other hand, I tried to read a tutorial about platform game development (another BASIC language) some years ago but I could not fully understand it. Thus I always think that programming platform game is hard.
Prior to that, various special techniques had to be adopted to achieve an acceptable speed: hardware scrolling, sprites, palette animation etc. They could make a huge difference to the performance, but were quite limiting. For example hardware scrolling might only be able to scroll the entire screen, so if you wanted to scroll just a portion, it didn't help. Sprites might be limited in their size, and might have only a binary transparency (each pixel entirely transparent or entirely opaque).
I never heard of these techniques and the above description is inspiring. Game development was really difficult and challenging in 70's and 80's!
All DW's games work this way. I can't see any obvious reason why a platform game should be any more difficult than any other when this approach is used.
I see. Good point.
And although you say DW has never written a platform game before, I would draw your attention to the Treasure Tower sub-game in his prizewinning Maisie Bones submission of a few years ago. That is to all intents and purposes a platform game, in my understanding of the term.
Right. I actually overlooked the game. ;)
Hated Moron

Re: BB4W or BBCSDL??

Post by Hated Moron »

It's interesting that one of the comments on DW's game was that it has no full-screen option. Had he used BBCSDL, full screen operation would have come for free because of the scaling provided by OpenGL! To make almost any program automatically scale to the window size (whilst preserving the aspect ratio) add this line in the initialisation:

Code: Select all

      ON MOVE PROCresize(@msg%, @wparam%, @lparam%, @size.x%, @size.y%) : RETURN
where PROCresize() is:

Code: Select all

      DEF PROCresize(M%, I%, L%, X%, Y%) IF M% <> 5 OR INKEY$(-256) = "W" ENDPROC
      LOCAL W%, H%
      W% = L% AND &FFFF
      H% = L% >>> 16
      IF W%/H% > X%/Y% THEN
        @zoom% = &8000 * H% / Y%
      ELSE
        @zoom% = &8000 * W% / X%
      ENDIF
      IF @zoom% < &8000 @zoom% = &8000
      IF (@platform% AND 7) < 3 THEN
        @panx% = (X% - W% * &8000 / @zoom%) / 2
        @pany% = (Y% - H% * &8000 / @zoom%) / 2
      ENDIF
      ENDPROC
This code also makes most use of the display on a mobile device if rotated between landscape and portrait orientation.
kigohhere
Posts: 69
Joined: Fri 20 Apr 2018, 00:56

Re: BB4W or BBCSDL??

Post by kigohhere »

Created with 'BBC BASIC for Windows'
https://www.youtube.com/watch?v=UY71NNBVyL4&t=37s
Hated Moron

Re: BB4W or BBCSDL??

Post by Hated Moron »

kigohhere wrote: Sat 04 Feb 2023, 04:19 Created with 'BBC BASIC for Windows'
https://www.youtube.com/watch?v=UY71NNBVyL4&t=37s
Yeah, another DW game that I would love to port to BBCSDL, but sadly he didn't publish the source code.

David's games are amazing, but he's very self-deprecating and often won't release the source code on the grounds that it was written in a hurry and poorly structured (that's not the case, in my experience, the few that I have seen are some of the best structured BBC BASIC programs I've ever encountered).

I once succeeded in reverse-engineering one of David's programs (with his permission, because he'd lost the source code): Xmas Demo II. But it was hard work, and only practical with a relatively short program.

Personally I would prefer it if Syntax Bomb required the source code of competition entries to be published, that way others would be able to learn from the skill and experience of the writers. But currently that's not the case.
kigohhere
Posts: 69
Joined: Fri 20 Apr 2018, 00:56

Re: BB4W or BBCSDL??

Post by kigohhere »

Hated Moron wrote: Sat 04 Feb 2023, 10:37
kigohhere wrote: Sat 04 Feb 2023, 04:19 Created with 'BBC BASIC for Windows'
https://www.youtube.com/watch?v=UY71NNBVyL4&t=37s
Personally I would prefer it if Syntax Bomb required the source code of competition entries to be published, that way others would be able to learn from the skill and experience of the writers. But currently that's not the case.
Maybe nobody will join Syntaxbomb's contest if entrants are required to disclose source code of games.
:)