RPG project

developing/porting a new game or gaming framework? post in here!
User avatar
Elminster
Posts: 4315
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: RPG project

Post by Elminster »

I remember playing Bards Tale 1 & 2 for many days, must have been on Amiga, before TSR brought the DND franchise officially to the computer (of which I had, and complete all of them on the Amiga).

Be interested see what you come up with.
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

Elminster wrote: Mon May 25, 2020 1:39 pm I remember playing Bards Tale 1 & 2 for many days, must have been on Amiga, before TSR brought the DND franchise officially to the computer (of which I had, and complete all of them on the Amiga).

Be interested see what you come up with.
At the moment, I'm not considering an auto-map feature. I wouldn't want to deprive players of the joys of graph paper. :twisted:
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

All sprite routines written!

MODE 130:
0.24 seconds to plot a compressed 80x128 sprite. Code is 264 bytes.
0.16 secs to plot the same sprite uncompressed. 200 bytes.
0.21 secs to mirror the uncompressed sprite. 214 bytes.

I'm not sure if that's good or bad, but it'll do for now. None of the tile sprites are as big as this, so it *should* ("should" being the operative word here) be fast enough to draw the pseudo-3D view.

I'm actually really chuffed. When I was doing this as a kid, I used someone else's sprite routines. These are mine. ALL MINE! Muahahaha!

*ahem*
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

As a result of some optimisation, it runs a bit faster.

MODE 130, 8 colour 80x128 sprite.

Uncompressed: 0.12 secs, 191 bytes
Uncompressed flipped: 0.18 secs, 206 bytes
Compressed: 0.17 secs, 240 bytes
Compressed flipped: 0.19 secs, 256 bytes

The sprite itself compresses down from 5123 bytes to 2017 bytes.
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

Things are looking more colourful in MODE2.

However, the tilesets don't compressed down as much as I had hoped. I may be limited to no more than 3 tilesets per map. This image uses two tilesets, the blue roofed house and yellow roofed house.

Maybe I'll just have all the peasants living in the same kind of house in each city, because they can't afford two architects.

Plus it's always daytime atm...

Hopefully I'll have a demo of walking round a city later on this week.

Image
User avatar
davidb
Posts: 3395
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: RPG project

Post by davidb »

Looking good! :D

Maybe you could do some simple bit manipulation when plotting to modify the colours? That would slow things down a little but make the architecture more varied.
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

davidb wrote: Thu May 28, 2020 9:32 am Looking good! :D

Maybe you could do some simple bit manipulation when plotting to modify the colours? That would slow things down a little but make the architecture more varied.
You mean like a palette swap? That's possible, I'm not sure how effective it would be though.

The peasants still only have one style of house but they get to paint them different colours. :D
User avatar
davidb
Posts: 3395
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: RPG project

Post by davidb »

Depending on the palette you are using, just masking one bit to remove the red, green or blue component could be effective.
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

davidb wrote: Thu May 28, 2020 11:19 am Depending on the palette you are using, just masking one bit to remove the red, green or blue component could be effective.
It's the standard MODE2 eight colour palette. I'll give it a test.

That's a good idea for the monster graphics, I was thinking about a palette swap for them.

Another thing I could do I guess is have a lookup table of substitute colours for each pixel combination. That would only need 64 bytes, and it would let me choose the combinations to make sure shadows look (more or less) right.

What I wouldn't give for a grey or brown!
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

OK, here goes.

This demo allows you to walk around a recreation of Skara Brae from Bard's Tale I. You start off in the Grand Plaza facing north.

Master only, and as you can see, it's all rather slow at the moment, and you can see the view drawing. The plotting logic is all written in BASIC, although the sprite routines are assembler. I can speed it up a little by moving that part into assembler as well, but to hide the screen redraw, I'll have to draw to a separate memory area and then blit that to the screen. Doable, but it eats 5k of main memory. I'll need to think about it.

Only 1 tileset is in use on this map, but I should be able to fit up to 6 using 3 banks of sideways RAM. The other bank will be reserved for other in-game graphics and data.

Still, it's a start. It uses sideways and shadow RAM, so I'm quite pleased with the progress so far.

Boot the disc to run the demo. Then wait about 20 seconds for everything to load. Cursor keys to move - turn left, turn right and go forwards.
Attachments
legend.dsd
(65.75 KiB) Downloaded 80 times
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

Because I couldn't sleep, here is the version that doesn't show the screen being redrawn. As mentioned above, it draws to a temporary space and blits to the screen.

However, there's a noticeable pause after pressing a cursor key before it responds. Is it fast enough to be acceptable?

This version also stops you from walking straight through houses. :)
Attachments
legend2.dsd
(65.75 KiB) Downloaded 96 times
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: RPG project

Post by 0xC0DE »

Looking good! =D> Imho you are taking the right route by making it work first and then make it fast. I usually focus too soon on making it fast :mrgreen:
I would love to see more variation in the houses but I'm sure that's next on your list. Keep going.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: RPG project

Post by ChrisB »

Well done. I don't think the pause is too long. These games aren't reflex based. I don't remember the bards tale being exactly snappy on a Master 512 ;). If you had an audio cue or another visual cue (compass rose?) as soon as the key was pressed it might improve the feel responsiveness.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
Lardo Boffin
Posts: 2977
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: RPG project

Post by Lardo Boffin »

ChrisB wrote: Sun May 31, 2020 8:29 am Well done. I don't think the pause is too long. These games aren't reflex based. I don't remember the bards tale being exactly snappy on a Master 512 ;). If you had an audio cue or another visual cue (compass rose?) as soon as the key was pressed it might improve the feel responsiveness.
Not wishing to divert the thread but you can play Bards Tale on the Master 512?!!!!
Adventure Language on GitHub
Atom, issue 5, YARRB + video noise killer
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: RPG project

Post by ChrisB »

Not wishing to divert the thread but you can play Bards Tale on the Master 512?!!!!
We'll have to move this to another thread if it gets serious. Yes - I'm 95% sure you can and I did BITD. I've just tried under emulation (b-em) and using dosplus 2.1 it will load as far as adding a party member but stops there. However the same emulation seems to have trouble with formatting a disk using the standard tools - so I don't know if it's an emulation issue or not.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
Lardo Boffin
Posts: 2977
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: RPG project

Post by Lardo Boffin »

ChrisB wrote: Sun May 31, 2020 2:45 pm
Not wishing to divert the thread but you can play Bards Tale on the Master 512?!!!!
We'll have to move this to another thread if it gets serious. Yes - I'm 95% sure you can and I did BITD. I've just tried under emulation (b-em) and using dosplus 2.1 it will load as far as adding a party member but stops there. However the same emulation seems to have trouble with formatting a disk using the standard tools - so I don't know if it's an emulation issue or not.
I’m certainly a fan of the game! Never managed to finish it for various reasons.

67EDE5AA-49EB-4FCA-968C-2C3144D7EB3C.jpeg
I started playing it on a mate’s Apple II (hence those versions) but that was replaced with an Atari ST before we finished it. Then that was sold...
Adventure Language on GitHub
Atom, issue 5, YARRB + video noise killer
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

The reason I wrote the original version of this game is because my friend had Bard's Tale II on the PC, and we spent hours playing it. I wanted something similar on the Beeb but we didn't have anything so I thought I'd write one. :)
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

Probably the last update before the weekend ABUG.

This version has 3 tilesets for houses. There's enough room for 3 more tilesets, the way I'm planning to use the memory but there will probably just be 2 more for cities - a city wall and one for "special" buildings, i.e. shops, healing places etc. Draw depth has been increased slightly.

There's also a compass and directional arrows to show you what you just pressed. I *may* have swiped the compass idea from Eye of the Beholder.

Load times are even slower than before. I'll have to do something like *LOAD a file completely and transfer it to SW RAM but I won't be able to do that with static graphics.

Curiously, *LOADing the main screen when Shadow RAM is paged in is also slow. Anyone know why that might be?
Attachments
legend2.dsd
(92 KiB) Downloaded 65 times
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

Here's the latest build as demoed on ABUG. Also attached is a listing of the assembler - don't laugh.

As always, comments, suggestions and feedback welcome.
Attachments
ALL CODEv2.txt
(8.38 KiB) Downloaded 80 times
legend2.dsd
(100.25 KiB) Downloaded 72 times
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: RPG project

Post by tricky »

Only had a very brief look and I don't know any 65c02 only instructions, but:

Code: Select all

.getbyte
STY temp%
LDA (readaddr%)
BIT #128
BEQ pair
AND #127
STA wbyte%
LDA #1
STA counter%
If you flip the meaning of the msb, the AND # can go, you could either count up or down to 127 (positive) to not have to add it elsewhere.
LDA () will be setting the Negative flag, so the BIT# could go and leave BPL pair or BMI pair with the suggestion above.
There is bound to be more to be had, but these are very minor changes (well, maybe not changing counting as it changes your encoder).
Hopefully they make sense and might inspire some other changes elsewhere.
I'll take another look, but it really felt fast enough to me.
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: RPG project

Post by dp11 »

a few more minor tweaks :

Code: Select all

.getbyte
STY temp%
LDA (readaddr%)
BIT #128
BEQ pair
AND #127
STA wbyte%
LDA #1
STA counter%

INC readaddr%
BNE nohigh    ; changed to branch directly to nohigh
bra inchigh    ; changed to use an existing inchigh

.pair
STA counter%
LDY #1
LDA (readaddr%),Y
STA wbyte%
CLC
LDA #2
ADC readaddr%
STA readaddr%
BCC nohigh
.inchigh       ; add label 
INC readaddr%+1
.nohigh
LDA flag%
BEQ return
LDA wbyte%
TAY
AND #85
ROL A
STA temp2%
TYA
AND #170
ROR A
ORA temp2%
STA wbyte%
.return
LDY temp%
RTS
You can run some loops backward ( I think most loops with CPY #160)

e.g.

Code: Select all

.upper
LDY #0
LDA #60
.upperrowl
STA (&70),Y
INY
CPY #160
BNE upperrowl
LDA #160
becomes

Code: Select all

.upper
LDY #160  ; run loop backwards to remove CPY from the loop
LDA #60
.upperrowl
DEY
STA (&70),Y    
BNE upperrowl
LDA #160
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: RPG project

Post by 0xC0DE »

You're right but be careful those 2 loops are not the same. You are skipping the Y==0 case, and including the Y==160 case.

Edit: disregard anything I said here #-o :mrgreen:
Last edited by 0xC0DE on Sun Jun 07, 2020 2:53 pm, edited 1 time in total.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: RPG project

Post by dp11 »

0xC0DE wrote: Sun Jun 07, 2020 2:28 pm You're right but be careful those 2 loops are not the same. You are skipping the Y==0 case, and including the Y==160 case.
I could be wrong , but I've moved the DEY so I think I have corrected for that ?
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: RPG project

Post by dp11 »

A quick look suggests the counter% could actually be in X as getbyte doesn't use X , but please check
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: RPG project

Post by 0xC0DE »

dp11 wrote: Sun Jun 07, 2020 2:35 pm
0xC0DE wrote: Sun Jun 07, 2020 2:28 pm You're right but be careful those 2 loops are not the same. You are skipping the Y==0 case, and including the Y==160 case.
I could be wrong , but I've moved the DEY so I think I have corrected for that ?
#-o #-o #-o
You are right of course!!
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
Naomasa298
Posts: 394
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: RPG project

Post by Naomasa298 »

After the ABUG yesterday, I rewrote the tile sprite routines so that the temporary drawspace is laid out column-wise and the blit routine transposes it on screen. That means that the actual plotting routine is much simpler, it doesn't need to worry about crossing a character boundary and just carries on plotting the column, and I unrolled the loops in the blit routine as well as the clear screen routine. I applied the optimisations to getbyte suggested by tricky and dp11 above. Thanks guys.

The upshot of all of that is that the routines run about 12% faster. It might be my imagination but it feels more responsive.

Now onto more fun things.
Attachments
legend.dsd
(100.25 KiB) Downloaded 76 times
ALL CODE.txt
(7.56 KiB) Downloaded 74 times
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: RPG project

Post by dp11 »

Well done!! =D> =D> =D> =D> 12% is a good improvement.
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: RPG project

Post by dp11 »

A bit more work on getbyte

Code: Select all

.getbyte
LDA (readaddr%)
BPL pair

AND #127
STA wbyte%
LDA #1
STA counter%

INC readaddr%
BNE nohigh
BRA inchigh

.pair
STA counter%

STY temp%     ; save old Y locally so if we only do it if required.
LDY #1
LDA (readaddr%),Y
LDY temp%     ; restore Y

STA wbyte%

CLC
LDA #2
ADC readaddr%
STA readaddr%
BCC nohigh
.inchigh
INC readaddr%+1
.nohigh

LDA flag%
BEQ return

LDA wbyte%
AND #85 ; 64+16+4+1
ROL A
STA temp2%

LDA wbyte% ; Load A again as it is fast that TAY TYA
AND #170 ; 128+32+8+2
ROR A
ORA temp2%
STA wbyte%

.return
RTS
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: RPG project

Post by dp11 »

A few more cycles out of the inner plot loop

Code: Select all


LDY #0
LDA wbyte%  ; move outside inner loop
.iloopY
STA (writeaddr%),Y ; 6 cycles
DEC counter% ; 5 cycles  -> 2 cycles if it can be DEX
BNE icontinue ; 3 cycles
JSR getbyte
LDA wbyte% ; duplicate to get newer version
.icontinue  
INY       ; 2 cycles
CPY height% ; 2 cycles
BNE iloopY ; 3 cycles 
DEC xcounter%
LDA xcounter%
CMP #255
BNE iloopX


what is the average length of the rle lengths ? it might be better if counter% becomes zero to BEQ out of the loop and BRA back in. If the RLE length is >4 you win.
I think getting counter% into X would be a big win for plotting the rle strips

Can you reverse the height loop so that counts down and so you don't need the CPY?

If xcounter% is always <128 then you can do :

Code: Select all

DEC xcounter%
BPL iloopX
dp11
Posts: 1757
Joined: Sun Aug 12, 2012 9:47 pm
Contact:

Re: RPG project

Post by dp11 »

In your clearcity function

Use X in the inner loop two loops instead of xcounter% and use another zeropage location for the outer loop You have what looks good INY:TYA but LDA #8 is quicker

In fact if I understand the the loop correctly take the add 8 out of the loop and do it at the end add 64 instead and don't reset Y . You then can combine the two add 64s into one add 128. I may I have miss understood something so please check.
Post Reply

Return to “new projects in development: games”