Thursday, September 8, 2011

One step forward, Two steps back.

Today is a sad day, my friends.  After wrestling with a problem in my pathfinding code I have come to a conclusion:

I know where the problem is, but I have no clue how to fix it.

Well, that's not entirely true, that's just the more dramatic and depressing way to say it, which I'll go with for now.

Exactly how I feel right now
That's on top of starting school again too.  So much programming ahead of me... and that doesn't even include my own projects I want to do.  I hope I don't become a shut-in this quarter for all the programming required of me.

Anyway, the problem with my pathfinding, if any of you care (raise your hands.... oh... nobody?) actually had to do with my "genius" implementation of influence modifiers.  If you remember from a few posts back, influence modifying is adding on points to the scores of individual nodes, to make them more costly to go through, effectively marking the node as a "no-no" during a path search.

YOU SHALL NOT PASS!

On it's own, this practice is perfectly fine, but I, in my infinite wisdom (sarcasm) used influence modifiers to try and keep ships from crashing into each other.  A ship would spawn, and then it would mark it's path with artificially high costs.  Not a problem, initially.  When a whole bunch of little ships start spawning however, and they are all going to generally the same spot, the most-efficient-path method of A* gets really screwed up if all of the best path's are marked with artificially high costs, and it ends up spitting back a failed path search.

Now in some implementations of A* it will just end up searching EVERY SINGLE NODE in an effort to find a route, but mine doesn't go that far.  I'm not entirely sure if this means that the pathfinding method I implemented isn't A* still because it doesn't but the fact of the matter is I'm going to have to make some fundamental changes to the system yet again because I didn't used my head earlier on in the process.


This is me.  Yes, my nose is that big.
Seeing a trend here, are we?  Me too.  Hopefully I learn to think before I code.

Anyway, this doesn't necessarily mean I need to change how I operate my influence modifications, but... yes.  I realize now I can't just add on scores to the score designed to find the fastest route.  If all the nodes around the end node have too high of artificial scores, then the end node won't be found.  I either adjust the implementation, or re-work how the influence scores actually influence or I adjust my A* algorithm to search every last node to find the target.  Which would end up just taking the system longer and in the end would be lazy programming on my part, and I would probably end up learning less from it.

...Like I'm learning anything at all from all of this?

Yeah I'm with Stupid here.  I also have Schizophrenia. ...wait... crap.
So... I'm stuck re-working my pathfinding probably for the next few days.

You know it.
On the bright side... wait, there is no bright side.  Not that I can see initially, anyway.  I've got class starting, they won't be easy.  Lots of programming ahead, and like I said, my game work will all be on my own costly time now.

My academic adviser, possibly one of the most awesome professors on the planet, much less the North American continent, has given me a position grading for him, as well as a position as a lab moderator.  And Sensei wants me to try to ready up for the next tournament.  These things can be taken in a negative light, more work and more Judo, but work equates to food, and I love Judo, as well as the physical activity that I'm desperately going to need after sitting around on my fat butt all day.

And so it beings.
I think it's a zombie.  Who knows.

WHAAAAAAAAAAAAAAAT?!

See?  Not everything I draw is repulsive... I hope.

Hopefully the next update finds me in a better mood.

Until then, denizens of the world wide tangled mess of interwebs,

-Kev

No comments:

Post a Comment