Trip2018 Posted June 20, 2018 Share Posted June 20, 2018 I would like to make a Raycaster for a game i'm working on but all the engines I found didn't work, are in assembly and hard to implement, or just don't suit my needs. Needs: Interactive sprites that move around the map doors (windows maybe) and changing walls on/off toggle to switch between main game and a screen/menu what do you think? I know how to scale sprites and provide layering. However I'm confused as to how I can accomplish the calculations needed. Thx. Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/ Share on other sites More sharing options...
+Gemintronic Posted June 20, 2018 Share Posted June 20, 2018 I know in the standard batari BASIC kernels pfpixel commands are "slow". The 2600 doesn't have a frame-buffer per se to draw those rays. Not sure if those pfixel commands are present/working in DPC+ anyway. You're better off waiting for SpiceC so you can offload the calculations onto the ARM. Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/#findComment-4053291 Share on other sites More sharing options...
Trip2018 Posted June 21, 2018 Author Share Posted June 21, 2018 I think somewhere on RandomTerrain's bB commands page that dpc+ pfpixel has three arguments, y, x1, x2. Also, I never heard of SpiceC. Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/#findComment-4053802 Share on other sites More sharing options...
+Gemintronic Posted June 21, 2018 Share Posted June 21, 2018 I think somewhere on RandomTerrain's bB commands page that dpc+ pfpixel has three arguments, y, x1, x2. Also, I never heard of SpiceC. SpiceC is an upcoming C compiler for DPC+. Not out yet. If pfpixel works for DPC+ then, well.. there you go! I'd start testing out using that command to plot pixels where you hit a ray. My hunch is that you need to resort to straight assembly. There's a game called Merlin's Walls that just barely does it.. and, it has to do it sideways. Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/#findComment-4053804 Share on other sites More sharing options...
Trip2018 Posted June 21, 2018 Author Share Posted June 21, 2018 First: I think somewhere on RandomTerrain's bB commands page that dpc+ pfpixel has three arguments, y, x1, x2. I meant x, y1, y2 Second: I'm taking some info from this and this Both require trigonometry and square roots. Is that even achievable in bB (or the 2600 in general)? Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/#findComment-4053998 Share on other sites More sharing options...
ZackAttack Posted June 22, 2018 Share Posted June 22, 2018 Both require trigonometry and square roots. Is that even achievable in bB (or the 2600 in general)? I was playing around with ray casting the other day. The algorithm I used was based on this article. The equation with sqrt is simplified so that sqrt is not actually required. For sin() I just created a lookup table with 128 elements. This is easier than using radians or degrees because a simple bitwise and with $7F will always convert an angle to the proper range. cos() can be accomplished with the same table. You just have to offset by 1/4 rotation before anding with $7F. vec2 rotate(int direction, vec2 vec) { f32 s = SineLookup[direction & 0x7f]; f32 c = SineLookup[((direction + 32) & 0x7f)]; vec2 v = { F32Add(F32Mul(c, vec.x), F32Mul(s, vec.y)), F32Add(F32Mul(F32Mul(F32(-1), s), vec.x), F32Mul(c, vec.y)) }; return v; } Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/#findComment-4054155 Share on other sites More sharing options...
+SpiceWare Posted June 22, 2018 Share Posted June 22, 2018 SpiceC is an upcoming C compiler for DPC+. Not out yet. Close, for CDF not DPC+ Also, I never heard of SpiceC. If you might be interested then follow my blog series on SpiceC. There's just a few entries so far as RL intervened - we learned another definition for TIA (dad's doing much better now) and took a vacation for a road trip to Wisconsin. I'll be returning to work on SpiceC next month. 5 Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/#findComment-4054423 Share on other sites More sharing options...
chewy Posted December 17, 2018 Share Posted December 17, 2018 [NON PROGRAMMER TAKING HERE] you know for the amount of raycasting games on the vcs , im suprised we havent yet had a port of 'doom' or the doom-style, as opposed to simple maze style games- recently i got a rom off here that is similar to a doom style game, but with a smaller portion of the screen for viewing, while the rest of the screen is for other things, it looks pretty good though. but i mean what about a full screen raycasting shooter--- Quote Link to comment https://forums.atariage.com/topic/279939-raycasting-with-dpc/#findComment-4178542 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.