WIP: Cometfall

Discussion, Reviews & High-scores

Moderator: Moderators

User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

WIP: Cometfall

Post by Kweepa »

Image
A text adventure for the VIC-20 with 16k expansion.

I'm writing this with cc65, and using Huffman compression on the text. Should be done soon-ish!
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

TIA from the text adventures guy :D .
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

And it's done!
http://www.kweepa.com/step/vic20/cometfall.prg
I'm interested to hear your thoughts :)
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

I was considering this enhancement:

Image

Thoughts?
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Anything that adds to readability is welcome :) . Another solution would be to add rows/columns keeping the VIC regular characters.
BTW, when playing those adventures in VICE, I use a lower aspect ratio (0.5):

before (0.825)
Image

after (0.5)
Image

This can be adjusted to a certain degree also on real hardware (C= monitors).
I'm playing this, it's very well written. Will post link to a map soon :wink: .
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Post by tokra »

Great work! I was going to suggest using a more eye-friendly font, but I see you are even going for a proportional font compared to fixed-width. I think that has never been done on the VIC, so way to go!
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Kweepa wrote:I was considering this enhancement: [...] Thoughts?
How about using MG BROWSE? ;) You find the source code of the display routines in the archive. This one is fixed-width, however.

An 8 pixel tall proportional font is most efficiently stored as 1 byte for each column. However, plotting the glyphs then is rather slow, as it has to be done pixelwise. Word wrap shouldn't be too difficult, you'd just have to remember the x-coordinate after the last blank, and copy that part of the bitmap down to the beginning of the next line.

What encoding do you use internally? ASCII or PETSCII?
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

I believe Mike has implemented a proportional font for the explanatory text before his spinning cube/dodecahedron demo, although I suppose that could be just a predrawn image.

I didn't want to use MG Browse as I wanted to make it proportional. I also wanted to "design" my own font, which is a width-reduced version of the VIC font. I just took the VIC font and sliced out columns. I think it keeps a nice VIC feel.

Implementation wise, I thought I'd just store it as 8 bytes per character with a separate table for the character width. Since I only have 64 characters that should be more efficient than the code overhead of column-wise rendering.

I'll probably not plot a word until I have decided whether it wraps or not. That's how I'm doing it currently with fixed-width.

I'm using the default cc65 encoding, which I believe is ASCII. I could easily switch to another encoding as all strings are stripped out of the C source by a preprocessor that compresses them.

PS Adjusting the aspect ratio is cheating! Although it does look nice!
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Post by tokra »

orion70 wrote:Anything that adds to readability is welcome :) . Another solution would be to add rows/columns keeping the VIC regular characters.
BTW, when playing those adventures in VICE, I use a lower aspect ratio (0.5)
And suddenly LONGSCREEN does not seem so silly anymore. I still wouldn't turn my monitor sideways though...
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Kweepa wrote:a proportional font for the explanatory text [...], although I suppose that could be just a predrawn image.
It is a predrawn MG picture. One nicety though: the display routine built into every MG picture serves to initialise the hires screen for the demo as well. :P

The font currently 'lives' on Acorn RISC OS, of 15 pixels height and derived from MS Sans Serif. I toyed with the idea to port it to the VIC-20 already some time ago.
I didn't want to use MG Browse as I wanted to make it proportional. I also wanted to "design" my own font, which is a width-reduced version of the VIC font.
As you please.
I just took the VIC font and sliced out columns. I think it keeps a nice VIC feel.
I find it more interesting to write programs for the VIC-20 that don't give away on the first glimpse of a screen shot that they're running on a VIC-20.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

What a great intro! I love suspense.
High Scores, Links, and Jeff's Basic Games page.
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Jeff, the game is very good indeed, and it definitely deserves a try also by those players not accustomed to text adventures. As you progress, you discover complexity, clever puzzles, some coups de théâtre, and even alternate endings (I finished the game twice, with different endings, both negative for me :? ).

Here's the game map so far. I guess it's far from being complete, but will investigate further :wink: .

[try to type KWEEPA :P]
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Thanks for the kind words!

Here's an (incomplete) beta of the proportional font version:

http://www.kweepa.com/step/vic20/cometfall_propbeta.prg
http://www.mdawson.net/vic20chrome/vic2 ... opbeta.prg

I still need to assemblify the character printing routine, add a flashing cursor, change colours, and parse Y/N type prompts correctly.
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

I use this routine to initialise the 160x192 hires screen. It also recenters the screen window, on both PAL and NTSC:

Code: Select all

.On
 CLC
 LDA #$10
 TAY
.On_00
 STA $0FF0,Y
 ADC #$0C
 BCC On_01
 SBC #$EF
.On_01
 INY
 BNE On_00
 LDY #$05
.On_02
 CLC
 LDA $EDE4,Y
 ADC Offset,Y
 STA $9000,Y
 DEY
 BPL On_02
 RTS

.Offset
 EQUB $02
 EQUB $FE
 EQUB $FE
 EQUB $EB
 EQUB $00
 EQUB $0C
The scrolling looks a bit strange, as if the screen was teared in the middle. But maybe it's only VICE that makes it look that way, couldn't test it on real HW thus far ...
I still need to assemblify the character printing routine, add a flashing cursor, change colours, and parse Y/N type prompts correctly.
... and also add a screen clear routine; a boot loader for a BASIC start at $2001 could also ease the executable from the lot of 0 bytes at the beginning. ;)
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Thanks Mike, that should save some bytes. (I realise I haven't recentred either :))

The screen tear is because the scroll is unrolled once, so it scrolls the left and right at the same time. I agree it's ugly. I might revisit it. Perhaps try scrolling top to bottom rather than left to right (which would be slower, but more aesthetically pleasing). Or perhaps if I just wait for the raster line, but I don't think it's quick enough to fit in the vertical borders.

Code: Select all

   lda #$00
   sta $61
   lda #$08
   sta $63
   lda #$11
   sta $62
   sta $64

   lda #$80
   sta $65
   lda #$88
   sta $67
   lda #$18
   sta $66
   sta $68

   ldx #10
top:
   ldy #0
loop:
   lda ($63),y
   sta ($61),y
   lda ($67),y
   sta ($65),y
   iny
   cpy #184
   bne loop

   lda #0
loop2:
   sta ($61),y
   sta ($65),y
   iny
   cpy #192
   bne loop2

   clc
   lda $61
   adc #192
   sta $61
   lda $62
   adc #0
   sta $62

   lda $63
   adc #192
   sta $63
   lda $64
   adc #0
   sta $64

   lda $65
   adc #192
   sta $65
   lda $66
   adc #0
   sta $66

   lda $67
   adc #192
   sta $67
   lda $68
   adc #0
   sta $68

   dex
   bne top
No, it takes a couple of frames :(

I'd rather have a single prg than a small file. Perhaps I'll run it through pucrunch to make the load times better.

Here's a screenshot.

Image
Post Reply