Spending all day on one problem...

Miscellaneous Forums/General Discussion/Spending all day on one problem...

Ever done this?

I have just spent a good 6 hours ripping my hair out on a particular effect!

A brief description (whilst not giving the game away):

An array of 300 elements representing the heights of columns. The idea is that the columns can start off at any height (completely random, or based on a simple rule) and then an iterative function changes the heights of the columns based on the state of its neighbours.

Tricky thing #1: When you add up the heights of every column, it must stay the same from one iteration to the next. You're not allowed to add extra height without taking it away somehwere else.

Tricky thing #2: The iterative function should favour higher columns in the middle of the array at the expense of the ones at the edge.

This is so that, during the game, if columns get destroyed, you start to lose the ones near the edge first.

This is really a 1-dimensional cellular automata thing. I had to add a random element to get it looking like I wanted but overall, I've spent 6 productive hours today :)

I'll post the code when I've ironed it out a bit, it's a very rough & ready playabout in blitzmax right now.

How about 3 days? I spent 3 days (4 to 6 hours each) trying to figure out why my .x model wont export the animation propperly. It exports in such a way that all the bones are positioned well at the moment of each frame but between frames they interpolate in screwed up ways so the arm for example goes 360 degrees around and gets squashed etc. I DON'T need advice at the moment, i've tried everything trust me, only if someone has a sure solution. Dont wanna open another thread, but i wanna say, persist and you will solve it. Your problem is at least logical, or mathematical and depends on your intelligence, mine is totally technical and has to do with god knows what :( lucky you.

I spent a week making my quintuple buffer dirty rects system and converting XMas Bonus to run on it. I also spend hmm 8 months on a multi-site module. That was boring, mind you it wasn't a "problem" as such although I DID encounter huge problems that made me want to quit and become a farmer.

Lenn: I fair solved the thing, to my unbounded satisfaction of a job well done :) The only thing is, my paranoia kicks in and I think "I bet some clever sod knows how to do this with less code, nicer and in 5 minutes flat".

Grey: Quintuple buffer dirty rects? I take it you were designing for P166 S3 Virge?! :-o

Actually not far off, my game original ran on 2GHz and above, but by the end it ran onf 300MHz and above. I read some stats about PC speeds recently and realised I increased my market size by > 100%, so it was worth doing :-)

I DID encounter huge problems that made me want to quit and become a farmer.

lol

I spend most time trying to find examples on the Internet. If I can not solve a particularly difficult problem then I leave it and do something else. I find that my subconsious goes to work and the solution becomes clear when I'm sitting on the toilet :)

I will never spend more than 1 hour on 1 issue.

@Vinylpusher, would this have helped you : http://freespace.virgin.net/hugo.elias/graphics/x_water.htm

@Indie: I almost read that as "I never spend more than 1 hour on the toilet" ;)

The application of my code is not immediately obvious and I've only ever seen it used in one place, and that was a freebie game on a C64 cover tape.

All will become clear in due course :)

**EDIT** That water demo thingy is kinda semi-related but totally unsuitable to the task in hand :D

Actually, there's code at http://www.stefanholmes.com/forum/index.php/topic,28.0.html but it lacks an interface and is a terrible mess.

I ended up waiting 2 days for my computer to finish raytracing a 360 degree rotation of a 3D model, only to find out that I made a typo and ended up with a very smooth animated 1 degree rotation instead.

It takes me a lot of time to debug things, or make things work that should work in theory, but simply refuse to work.
So far I have learned that my span of total attention

a) doesn't last as long as it used to 20 years ago.

b) may be the cause for many many troubles. So I have this simple rule: when you cannot find a bug for more than a hour, then it's about time for a break that last at least one hour. You can spend 10 hours seeking for the the reason why a code doesn't work, then you go sleep and next morning you'll find the sucker in 2 Minutes!

That's why I think I am most productive in the first 2 hours of a coding session.

Due to the lack of something like "Explicit" in Blitz3D I just had this idea:
How about a Parser that checks the sourcecode for Variable names etc. and when there are two very similar names, eg:
Max_Handle and Max_Hanlde

then it will list them in a "suspicous variables report". This may help to find typos quickly.

How about a Parser that checks the sourcecode for Variable names etc. and when there are two very similar names, eg:
Max_Handle and Max_Hanlde

You could probably do something simple with that using a soundex function.

Well, lucky you vinyl, i have trouble sleeping from unsolved problems, especially ones that haunt for days... like this one... will the gods have mercy on me? *sigh*

Lenn: I've never not been able to solve the problem. It's just that it seems to be a lot harder than it used to be. I'm 28 now and as far as I'm concerned, well past my prime.

When I was last sat in front of a computer messing about with code, it was when I was younger than 19 (started at 7) and stuff was so much easier. I used to know loads of things just off the top of my head without referring to reference books and I could read other peoples code and debug it wihin a minute.

these days, it's all I can do to concentrate enough to remember the name of the project I'm working on :)

I spent a week on a problem only to find out it was a typo in Blitz3D. (Granted, I didn't sit down and work on it for very long at a time, but it's a fairly long time to allow a bug to exist)

vinylpusher, I am 37 and its hard to rember where I live sometimes.

If I cannot see a route to the solution when I look at a problem, it probablly isn't solvable*.

*Does not imply my own route is a good one, only that if one cannot see the wood through the trees then it's probably best to do some embroidery for a bit.

Well they say problems should be broken down to tasks of roughly 8 hours work, so I think that's rather succesful. I always get problems too small (max. 4 hours) or way, way too long (16+ hours).