LZ: A few optimizations and congrats for Daedalus Raytracer


[Prev][Next][Index][Thread]

LZ: A few optimizations and congrats for Daedalus Raytracer



Hello.  I tried the Daedalus Raytracer from Sam Davies and I'm quite impressed.


Sam should be commended for a relatively fast raycasting engine on a 6Mhz
2-color calculator! :D


However, here are a few suggestions:


1) Speed.  OPTIMIZE OPTIMIZE OPTIMIZE!!!  The doom of all programmers :)
2) Put some kind of border around the screen a la DOOM / other games... perhaps
    with ZCP.
3) The raycaster algorithms create sinusoidal distortion.  You haven't made
a filter
    for that yet, it gives the virtual world a fish-eye lens effect.  "More
Tricks of the
    Game Programming Gurus" covers raytracing in greater detail and tells
you how
    to remove the sinusoidal distortion. :)
4) My guess is you're still using "CALL GET_KEY", and that's a BIG bottleneck.
    My suggestion would be to visit Jingyang Xu's page and get the SCANKEY
    routines.  They are MAJOR fast ( I'm using them in Spy Hunter and have
to use
    delay routines to slow it down to playable speeds ) and also give you
support for
    multiple keys and no delay on held keys.


    You basically can do multiple keys using SCANKEY like this:


MainLoop:
        ld      b,6             <--- 6 is what I use for SpyHunter, you'll
want it less.
DelayMainLoop:
        halt
        djnz    DelayMainLoop
        SCANKEY(M_LEFT, P_LEFT)
        CALL_Z(MoveLeft)
        SCANKEY(M_RIGHT, P_RIGHT)
        CALL_Z(MoveRight)
        ...


And so on.  With the exception of the Quit key, using CALLs with SCANKEY
allows multiple keys held at once, and without delay.  And, again, it's
REALLY fast.


If you could give me the source code it would be much appreciated.
Ryan Myers ( rmyers@teleport.com )
http://www.teleport.com/~rmyers/
"Canthus" on DARKWORLD


C> Warning: REALITY.SYS may be corrupt.  Reboot universe(y/n)?