Jump to content
IGNORED

1 FPS - Low Res - Slow as mud Raycaster 'Engine'


Sporadic

Recommended Posts

Hi all,

 

I've ported this engine to Android before and it went well. ahhhhh modern tech where you don't have to care.....

 

I thought for a laugh I would port it to rb+. Cause I hate myself like that lmao

 

Managed to get it from 0.25 FPS up to a full 1 FPS before giving up. The main gain was switching from real time COS/SIN functions to lookup tables to store the values the engine needs. Still not enough though.

 

If anyone fancies the challenge, see if you can make this faster lololololol

Perhaps removing all the floats might be a good start? who knows...

 

I already reduced the 320x240 res down to 80x240 (using 4px wide sprites) so it looks nice and blocky.

 

It's based off the widely available java source out on the interwebz - but i've included it in the project for completeness.

 

DPad to Move like some kind of swamp thing.....

 

I've not even bothered testing on a real Jag for obvious reasons.

 

Maybe I should put my bank holidays to better use in the future (didn't take long though i'm happy to say) :thumbsup:

 

EDIT: Although I have also ported this one before (non-textured version) to another platform too and the code looks like it might be more efficient. Damn, that's my next holiday gone.....

1fps Low Rez RayCaster.zip

Edited by Sporadic
  • Like 4
Link to comment
Share on other sites

If you could only see the smirk in my face right now :D.

 

Now, make a 0.5fps doom 3 port and you'll win the internets ;).

 

(will add to the ever growing rb+ examples if it's ok with you)

 

[EDIT] Changing the sine/cosine tables to 16.16 fixed point doesn't seem too impossible either - just needs a bit of time and motivation!

Edited by ggn
  • Like 2
Link to comment
Share on other sites

If you could only see the smirk in my face right now :D.

 

Now, make a 0.5fps doom 3 port and you'll win the internets ;).

 

(will add to the ever growing rb+ examples if it's ok with you)

Hahaha do what you will with it. Not sure its of much use to anyone except an example of what not to do ;)

 

Would be great to get something like that moving well. The other one I linked to was actually better code so I may try porting that one day.....

  • Like 1
Link to comment
Share on other sites

Still not sure how much it will help the speed because to draw the screen it loops 80 times (for each ray) and for each of those it steps forward until a wall is found.

 

That stepping loop may be quicker on the other code I linked to as it only steps on the joins of the array grid.

 

That looping and stepping is a killer :)

Edited by Sporadic
Link to comment
Share on other sites

Here is the second RayCaster example I said i'd do. This is based off Lode's tutorial found here.

 

To me this looks faster overall (more stable with whatever is on screen) - doesn't slow down when long corridors appear.

 

It's still slow but it might sometimes reach a whole 2fps lol.

 

I haven't bothered removing the floats yet and changing things to fixed point. To start with I just wanted to get it working and remove any functions for quick wins. Hence the precomputed COS and SIN value variables. Unfortunately the function that's left is a SQRT function, which are slow as shit, plus its a float version. I tried a couple of other implementations but they didn't look right so left as is for now.

 

Anyway, this one looks a bit better, it has different coloured walls depending on the face/side of the wall.

 

DPAD to move like swamp things slightly younger brother...

 

Still not bothered testing on real hardware. I don't have a fire extinguisher handy.

1-2 fps Low Rez RayCaster v2.zip

  • Like 3
Link to comment
Share on other sites

  • 1 year later...

Been wanting to try this for a while and had time today - made for a good side project distraction.

 

Changes;

 

- Have changed all math to fixed point and added more precalcs.

- (Offline) randomly generated maze.

- Shaded Walls

- A or C to Strafe

- 0 to disable floor

 

The upshot of the fixed point math? I think the FPS is now in double figures! Not bad for BASIC ;-)

 

There's other things i'd like to try with this, but i'd best get back to finishing other stuff first.

 

Binary attached for your consumption....

 

 

post-42253-0-08139000-1478184434_thumb.png

Sporadic FP Raycaster 031116.abs

  • Like 9
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...