Attempts at Pathfinding : Argg!!! The little technicalities

I have been spending the last few days wrapping my head around basic path finding with recursion for backtracking, and also stumbled across path finding with just for loops and a queue.

I have been trying to add the path-finding into both my games, and another really interesting idea I have which should actually be easier.

My stumbling points today have actually just been little python technicalities involving dictionaries, tuples, un-hashables, and for row in list meaning „row“ is actually part of a list instead of an int making it unhashable in dictionaries if I use the same variable again later etc etc. Stuff like that took up the whole day lol.

Also using a dictionary to hold coordinates as keys and as values for keys has been slow because of the above I guess.

Also just learning the best way to implement a graph and how the map should work with the grid.

Space Game I’m working on: Farscape Inspired: Path Finding

Farscape: My Brother's Prowler
Farscape: My Brother’s Prowler

I am working on a game based on Farscape where you get to fly a prowler as Commander Craise’s brother and try to not get killed by John Chriton’s „death-pod“. I plan to have a single Module appear along with a black hole sprite and the ship will be attracted to them both thus following the story line some what, only you have a chance to kill Chriton instead of crashing into him which would be an instant. game over.

Today though I decided to work on what may become an AI for a spaceship weapon. I learned about graphs to help me create a graph overlay on the screen that I could do path finding algorithms on.

What I have so far is graph points that do represent the range of the screen.
Then I have a function that with a given starting point actually right now it just maps the neighboring cells when you press ‚4‘ and creates objects in each of those cells.

What I was planning on doing was making each those objects detect collisions with other objects and use that as the bases for path finding. However, I’m rethinking this because path finding is supposed to be about nodes not cells.

I will have to decrease the number of enemy objects also and decrease the sixe of the ship and the objects, or increase the size of the screen and the graph, so that I can actually something where path finding would be useful. Maybe for evasion, or for homing. Also the path finding will have to account for the fact that the objects will move from where they were when the path was created.

etc etc.