We need to specify the way the line algorithm should work exactly. (Same goes for maze generation and random placements, though I concentrate on lines in this post now)
This is no issue for any C64 caves, as they only can go into one of 8 directions. However, there are clones capable of using lines with any start and end coordinates, and problems occur on coordinates which has odd distances, ie. not possible to draw a thin line in a symmetrical pattern. To prevent this in BDCFF enabled engines, we should state an exact algorithm for line drawing.
Bresenham's line plotting algorithm is pretty much standard, but unfortunately, most implementations are optimized to a degree, and all do it somewhat differently, because of this.
Boulder Rush:
Code: Select all
Line 2,4 6,6 WALL
Line 6,9 2,7 WALL
Line 8,4 10,8 WALL
Line 14,8 12,4 WALL
GDash:
Code: Select all
Line=2 4 6 6 WALL
Line=6 9 2 7 WALL
Line=8 4 10 8 WALL
Line=14 8 12 4 WALL
And with the code from
C64 Codebase, which I implemented in my XDC engine (which is very early work in progress).
Test cave from assembler source file:
Code: Select all
.byte Line, WALL, 2, 4, 6, 6
.byte Line, WALL, 6, 9, 2, 7
.byte Line, WALL, 8, 4, 10, 8
.byte Line, WALL, 14, 8, 12, 4
You see, all got the exact same coordinates, and every one behaves differently, which in the worst case could make a ported cave impossible to play.
I would say that Boulder Rush was first and we could base the BDCFF specs on that, but unfortunately, it has no source code availabe. Any suggestions?