JRPG experiments with BASIC

People are still making stuff for the Sinclair related machines. Tell us about new games and other software that runs on the Spectrum, ZX80/ZX81, Pentagon and Next.
Post Reply
+3code

JRPG experiments with BASIC

Post by +3code »

Hi, I‘ve made a very simple JRPG-like game in BASIC (also sloooooow) with Charade and SQIJER:

It's here:
https://sites.google.com/site/plus3code ... ects=0&d=1

Graphics are from nes games.
Controls: OPQA and I (for Status).

Chao
User avatar
Joefish
Rick Dangerous
Posts: 2058
Joined: Tue Nov 14, 2017 10:26 am

Re: JRPG experiments with BASIC

Post by Joefish »

I don't understand the language but it looks good.
Shame about the speed. Looks like your map is based on 2x2 blocks. Are you re-drawing the local area each time from a map you hold in a BASIC array, or are you just filling in at the edges of the screen as you scroll?
I know it uses 4x4 tiles but CharAde's own map mode is a lot faster for one big fixed-size map - if you can master it!!! :twisted:
+3code

Re: JRPG experiments with BASIC

Post by +3code »

Joefish wrote: Fri Jan 17, 2020 1:54 pm Are you re-drawing the local area each time from a map you hold in a BASIC array, or are you just filling in at the edges of the screen as you scroll?
I know it uses 4x4 tiles but CharAde's own map mode is a lot faster for one big fixed-size map - if you can master it!!! :twisted:
Re-drawing from a DIM (24x176). I need a map-mode example, I tried it but without luck :?
User avatar
Joefish
Rick Dangerous
Posts: 2058
Joined: Tue Nov 14, 2017 10:26 am

Re: JRPG experiments with BASIC

Post by Joefish »

I'll try and write an example. I can't see your code though. If I break in it crashes and reloads. I'm afraid I'm not familiar with +3 disk operations.

Are you using the Background screen and the Foreground screen together? You should be able to draw part of your map on the background screen, then you only need to redraw a bit of the map when you move to add a new row in the direction you're scrolling. That's what the Spec-Spiker demo is doing. It only redraws what is just off the edge of the screen.
+3code

Re: JRPG experiments with BASIC

Post by +3code »

Joefish wrote: Fri Jan 17, 2020 3:22 pm I'll try and write an example. I can't see your code though. If I break in it crashes and reloads.
Sorry, you can see the source code in the xtras folder (files .bas and .htm), or MERGE it.
Joefish wrote: Fri Jan 17, 2020 3:22 pm Are you using the Background screen and the Foreground screen together? You should be able to draw part of your map on the background screen, then you only need to redraw a bit of the map when you move to add a new row in the direction you're scrolling. That's what the Spec-Spiker demo is doing. It only redraws what is just off the edge of the screen.
Yes, use back and foreground, I think I use just that technique.
+3code

Re: JRPG experiments with BASIC

Post by +3code »

+3code wrote: Fri Jan 17, 2020 3:49 pm Yes, use back and foreground, I think I use just that technique.
Ups, I use just one, sorry. I used it but here:
https://sites.google.com/site/plus3code ... ects=0&d=1
User avatar
Joefish
Rick Dangerous
Posts: 2058
Joined: Tue Nov 14, 2017 10:26 am

Re: JRPG experiments with BASIC

Post by Joefish »

Actually looks like there's a big bug in the rendering from a map.
When you print blocks on the background or foreground screen, they come out right. But when you try to render a map of blocks they come out all wrong!

I have seen it working, so maybe the version on here for download needs updating.
+3code

Re: JRPG experiments with BASIC

Post by +3code »

Joefish wrote: Fri Jan 17, 2020 4:06 pm Actually looks like there's a big bug in the rendering from a map.
When you print blocks on the background or foreground screen, they come out right. But when you try to render a map of blocks they come out all wrong!
I did tests a long time ago and that was what I thought, that the map mode was not implemented or that it had a bug. :cry:
User avatar
Joefish
Rick Dangerous
Posts: 2058
Joined: Tue Nov 14, 2017 10:26 am

Re: JRPG experiments with BASIC

Post by Joefish »

I've got an idea what it might be. I seem to remember the bytes that represent the UDGs in the screen memories need to be multiplied by 32 during the screen rendering operation (triggered by the ')' ). As such, they're rotated by 5 bits to the left whenever they're printed so it's easier to do the maths later.

Now the block-print-function just calls the character-print-function 4x4=16 times. That's always worked, so block-print gets it right too.

But the map-print-function doesn't make repeated calls to the block-print-function. That would be too easy! (and wouldn't have a bug!) I thought I could do it faster with a dedicated map routine. I bet I forgot to pre-rotate the UDG bytes when printing them from a map. So it then renders the wrong UDGs when you perform the ')' instruction.

Sorry! I'll check the code for a fix later!
Post Reply