Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Streetwalrus on March 24, 2013, 03:16:31 pm

Title: Streetwalker's RPG engine
Post by: Streetwalrus on March 24, 2013, 03:16:31 pm
Hi !
I've been working on a smooth scrolling grayscale tile mapper for an RPG.
Don't ask info about the game, I'm still trying to find a good storyline.

Features :
-8*8 3 level grayscale tiles
-Pokémon style scrolling
-Hayleia's interrupt gray method for really smooth gray
-Couple ASM routines for fast horizontal scrolling
-The code is as optimized as I can alone. It's very fast and fits in 2.4k (speed optimized).
-8 frames walking animation + 4 directions for the character implemented but not visible since I put the same sprite 32 times.

To try it, send both progs to your calc, run MAP to create the data appvars then ATILE.
The source is in the SRC dir (the assembly routines are in THEGAME.z80 and compiled as an Axiom). Never mind the empty makefile. :P I was about to set it up but I didn't.

The gray actually looks better on calc. ;) You may want to calibrate it : change the value of Z under Lbl INTI).
Hold Alpha to run.
Title: Re: Streetwalker's RPG engine
Post by: Xeda112358 on March 25, 2013, 06:13:12 am
That looks great o.o Is that 6MHz or 15MHz?
Title: Re: Streetwalker's RPG engine
Post by: Streetwalrus on March 25, 2013, 08:15:50 am
It runs at 6 mhz. I'd like to keep compatibility with the 83+BE. It's actually slowed down unless you run, which just removes the delay. Full speed gives insane scrolling speed. :P
To do :
-Chunk handling
-Scripting engine
-NPC handling on the map (rendering + collision)
-Battle engine (I have some pretty neat ideas including a research system for spells instead of learning on level-up)
Title: Re: Streetwalker's RPG engine
Post by: Streetwalrus on April 05, 2013, 10:30:29 am
Can someone help me optimize the quad buffering renderers ? I feel it's not optimal at all (even though I spent quite some time on them).

Code: [Select]
:Lbl LIN
:-4→r6
:r1*°MAPW+X+MPTR-6→r5
:For(13)
:¦ Pt-Off(r6,-4,{r5}*16+TPTR→r4,L1)
:¦ Pt-Off(r6,-4,r4+8,L1+144)
:¦ Pt-Off(r6,4,{r5+°MAPW}*16+TPTR→r4,L1)
:¦ Pt-Off(r6,4,r4+8,L1+144)
:¦ r5++
:¦ r6+8→r6
:End
:Return
:
:Lbl COL
:-4→r6
:Y-4*°MAPW+r1+MPTR→r5
:For(9)
:¦ Pt-Off(-4,r6,{r5}*16+TPTR→r4,L1
:¦ Pt-Off(12,r6,r4+8,L1
:¦ Pt-Off(4,r6,{r5+1}*16+TPTR→r4,L1
:¦ Pt-Off(20,r6,r4+8,L1
:¦ r5+°MAPW→r5
:¦ r6+8→r6
:End
:Return

These routines are basically speed optimized tile mappers that respectively draw two rows or columns (respectively).
Title: Re: Streetwalker's RPG engine
Post by: Streetwalrus on May 10, 2013, 07:25:14 am
I recently started an ASM rewrite of this, you can find the source on GitHub here (https://github.com/Streetwalker/TheGAME).
I'll try to keep you updated on progress here. Right now, I'm trying to write the tilemapper sprite routines and this is going pretty well.