Mrlegoboy 2020-12-11 04:40
Here it is in all its vector glory. I adapted someone elses code to draw the lines, I’ll credit them in the comments.
This may look promising but a lot of crazy things will need to happen for this to be made into the actual game.
GAMELEGEND 2020-12-11 04:51
this is so cool
was8bit 2020-12-11 05:22
Way cool! :)
SilverDragonBlade 2020-12-11 05:26
qwaffe 2020-12-11 09:07
i wonder how much you can optimize so that it doesn't flicker but doesn't get slower as well
nathanielbabiak 2020-12-11 12:36 (Edited)
If you pre-calculate the addressing math into one or two arrays, it won't flicker. Pretty similar to how the bitmasks are pre-calculated already.
This upload does it in a single 2D array with one element for every pixel: https://lowresnx.inutilis.com/topic.php?id=1433
Or you could do it the way my Pxl Library does, and use two 1D arrays, separating the X memory address, and Y memory offset (addition to that address). This uses far fewer array elements, but it's a little bit slower.
Mrlegoboy 2020-12-11 17:59
The plan is just to draw a ton of asteroids on the RAM memory and copy them when needed.
I'm having a hard time finding the original author of the line drawing commands.
nathanielbabiak 2020-12-11 18:29 (Edited)
If you're going to draw the asteroids ahead of time, you could even do it before runtime and save them into e.g. #2:MAIN CHARACTERS. In my ray caster demo, I did that to develop an anti-aliased HUD indicator, although it's not implemented yet. If you want to check it out in the Gfx Editor it's already uploaded in cells 68 to 76 using PAL 5.
But if you mean you're going to use a buffered display, I'm wondering if there's enough clock cycles available to implement that since a fast raster display uses ~6,016 CC per frame and the buffer copy command will use ~5,124 CC per copy. If you copy every frame, that only leaves ~6,416 CC for the main game loop every frame. Unless you plan to drop the framerate from 60 to 30 fps, and only copy every-other frame?
Also, I wrote the line drawing commands in Pxl Library myself - feel free to use them if you'd like. :-) They're pretty fast since they pre-calculate the memory addresses *and* take advantage of the LowRes 1 clock-cycle cost of floating point operations. My graphics demo even includes a benchmark for line drawing, since I know how important speed is. (I haven't checked the line drawing algorithm used here to see if it's using FP or DDA, but I will after work today, and compare it to the benchmark.)
Mrlegoboy 2020-12-12 03:56
Nah theres enough clock cycles. The sprites are monochrome, so its easier. Scattered updates help too. Just posted the demo!