Advertisement

If it ain't broke then don't fix it...DOH!

Started by November 01, 2012 08:43 PM
0 comments, last by Krohm 12 years, 3 months ago
This has got to count as one of the most stupid things I have ever done in programming...nope, nothing comes close! O_O

So, I've been writing a ray-casting engine over the last few weeks, and despite numerous complications, I finally got my textured walls and so, to go one better I decided to finish off the engine with floor-casting...

So, I decided to use a different texture to the one I used for the walls - which had nice different colours in it. However, for this one I opened up MS Paint and filled in a blue base and then...well...using a pixel width brush, drew some lines to create a brick like pattern...

...so, with my new floor texture, I then wrote the floor casting code, and then...

A WHOLE LOAD OF FLICKERING LINES!

...oh dear, my code seemed to be at fault! So, seven days later I eventually came to the conclusion that I simply didn't understand floor-casting, and that Permadi and Lode were talking bollocks in their tutorials. I even went to the length of reversing the maths to get original casting distances using the projection plane! Something simply wasn't right here, but I vowed to build this engine without any assistance...so asking for help here would have been pussying out...

So tonight, I thought I would muck about by using a more detailed texture from Wolfenstein3D...and discovered a truly spine-tingling fact...

...THERE WAS NOTHING WRONG WITH THE BLOODY THING!!!! O_O

...turns out my original floor texture simply didn't have enough detail to display properly! I honestly feel like such a twat for spending seven days trying to fix something that wasn't broken in the first place! o_O

Sigh, the engine is now complete and I am feeling relieved I can begin with tidying it up and optimising...then making a game of some description...

Has anyone else here done the same thing? Tried to fix something that wasn't broke in the first place? happy.png

Languages; C, Java. Platforms: Android, Oculus Go, ZX Spectrum, Megadrive.

Website: Mega-Gen Garage

Unfortunately, yes.

I had a game entity not performing as expected. I went great lengths debugging. Days, at least. I wrongly assumed the error would stem from the end of the system.
It didn't. The asset had a vector pointing in the wrong direction, thus exporting the data with a negated value. Whoops.

This is the only thing I can recall now, but I'm afraid I could write a book on this. Hopefully it would be a short book.

Previously "Krohm"

This topic is closed to new replies.

Advertisement