I hope I have posted this in the correct place, it rather semi development+ feedback related. It is a long post so if that puts anyone off better stop reading now. (Since I want to share this success since it has been so long in comming and its not for the lack of good advice, I just didnt get AI for a while it seems)
Essentially I have used this site on an off for some time. I learned what I have done pertaining to roguelike development in the C language, I wanted proper understanding so I'm not one for using premade librarys until I had sucessfully coded a proof of concept for each part of the roguelike. I learned in a modular fashoin and the best I ever had was:
1: a UI
2: a basic turn based system
3: a dungeon map(had a rough as hell procedurally generated one but Im taking advice for once and going static maps so I can get my first rl finished this time)
4: a character class for implementing levels later
5: character movement
6: NPC placement (NO AI)
I did lots and lots and even more lots of reading on A* + breadth first search and other things, I would always end up with some broken form of a search, I spent months! People on this forum gave me lots of help but I still couldnt put it all together in a neat way that worked. Anyway so I leave it for ages thinking its beyond me, and for some mad reason I took a differant approach I spent 2 days drawing p pseudo code but the clincher was I had 2 people to follow my pseudo code logic to the letter and if it failed I would add in the relevant conditional code.
Suffice to say having studied in various educational establishments sometimes I find they want documentation for things before you even get your hands dirty to learn the exact basics of your enviroment, documentation is essential but I sometimes find its abstraction and documentation for documentations sake to the point of detracting from the real problem area. In short I have a healthy dose of cynisism but doing the pseudo code and also involving other people to follow it has had a remarkable positive effect(1 was a ccoder, one was not) In the end when I came to do the code I was seeing strange behaviour at each development stage of my ai except this time I understood with some precision why it was behaving as such and how to fix it!
Something thats stopped me going further for months I come back after a long break, read no more books/no google and just follow my pseudo code and wham I have really cool search AI, I even catered for the situation where the player doesnt get found from the monster and the ai searches eventually every damn square! The way it briefly works is with a visited array and if it gets caught down a 1 wide alley or similiar where all squares are vistited it backtracks until it finds unvisited squares and trys another route . It seems that I just needed to have alot more patience than anticipated but Im so happy to get this done and hopefully this will help someone motivation wise who is feeling a bit down hearted trying to get the ai working, also now that I finally have something stable Its helped me understand why I was failing and some of the caveats that were catching me out. The AI was the missing link now I know I can make a full but basic roguelike and I am so pleased.
Thanks for the patience throughout the last year or maybe more? Its so good as I finally feel I have gotten to the point in my game where it has a bit of life/fun to it and Im in shock how teaming up with someone to follow your pseudo code to the letter can make such a differance.
MY AI is the most basic of the basic , I know this but am very happy with it all the same but I have a healthy respect for AI programmers! Its so tough and theres so many variations/more complicated ways of doing things but for anyone considering their first roguelike AI well from one newbie to another get all the stages of the ai in your head and coded in such a way that you completely comprehend each stage and how it pertaings to your screen array . I understood most of the basic c language structure etc but Iin hindsite I realise my understanding of 2d arrays 1d arrays and pointers maybe wasnt as good as I thought it was so in short understand everything you are using, assume nothing, make sure your conditionally stuff its not vague and cleanly pertains to a certain stage of the AI process.
Ive got a new enthusiasm for development of this genre again, things I need to do is sort the screen flicker, I know this is because I clear the screen which is bad and I need to utilise some windows.h functions/api calls however its been a long while so I willl google that again but tbh I dont know whether to sort the screen flicker out later when I break my record for getting further in development than I ever have.
Thanks a bunch to the community who has stayed patient with mee and keep working on it to the fellow newbies
Happy times my little AI 'M' sign is Alive lol