UnderwareDESIGN

PlayBASIC => Beginners => Topic started by: Scott_Bro on June 29, 2021, 02:11:26 PM

Title: Looking for a bit of help.
Post by: Scott_Bro on June 29, 2021, 02:11:26 PM
I've started a raycaster engine over again hoping for less trouble and better operation.
So far so good but...
I'm having trouble with the way some corners are looking leaving open cracks.
Does anyone have a way to fix this or a work around?
Tnanks
Scott B.
Title: Re: Looking for a bit of help.
Post by: stevmjon on July 01, 2021, 08:53:04 PM
having a look at this now. see what i come up with.

i like breaking down code to see how things work. i like making game engines more than actually designing a game level.
just allow some time for me to break down the code to test. i will post as soon as i come up with any idea's.

stevmjon
Title: Re: Looking for a bit of help.
Post by: stevmjon on July 02, 2021, 11:48:06 PM
i found the issue. what is happening is when you calc the slope for x1_ray/y1_ray when this is very close to the corner, eg. x cell = 3 , y cell = 2. then when you calc the ray a second time for the slope x2_ray/y2_ray when this is very close to the same corner the values are slightly different, so now x cell = 2 , y cell = 2. so it now thinks the wall is not a collision and calcs past it.

the values we are talking is only @0.3 of a difference on a value, but that takes it to the other cell.
see pic for a visual explanation.

hope this helps, stevmjon
Title: Re: Looking for a bit of help.
Post by: Scott_Bro on July 27, 2021, 04:06:29 AM
Got the corners now.

But can anyone figure what is causing it to crash ever so often???

I need to work out this bug!

Any help would be greatly appreciated.
Thanks ahead of time.
Title: Re: Looking for a bit of help.
Post by: stevmjon on July 27, 2021, 08:34:27 PM
i haven't seen the crash yet on my rig, but i did notice the frame rate is very low. so for a bit of a speed boost use fx images instead of video images. video images are default using command "loadimage", but these are very slow to read from, in this case using the "texturestripv" command. i recommend using the "loadfximage" command instead.

hope this helps till you figure out the crash, stevmjon