![]() |
AI - Artificial Inteligence - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: AI - Artificial Inteligence (/showthread.php?tid=233) |
AI - Artificial Inteligence - Dragoons Master - 12-08-2006 I would like to continue talking about this w/ the community so I'll quote this post from the old forums Quote: Well, since I dont know if old posts from old forums will be backed up back I'll continue the discusion we were having on the old forums. I prepared this post to post on Xackery Topic and I'll post it here: Actualy, I used the same system to build Mouse Movement, so player's can move w/ mouse ^^ - Misunderstood - 12-08-2006 I did this too(in KoC), though I used a slightly different algorithm. I remember us talking about it on the other forums. Well I did the mouse movement, I didn't get to change the npcs movement, but it wouldn't be that hard. - Krloz - 12-08-2006 Sry but I dont get it - Misunderstood - 12-08-2006 right now npc searching sucks. You could be on the other side of several blocks, like around a table, with the npc on the other side, and he could never get to you. This makes it more advanced, allowing the npc to actually get to you. Its kinda complicated. - Dragoons Master - 12-08-2006 Well, I'll try to explain better. Look at this: ![]() This is a simple graph. Graphs are made of vertexes(the dots) and edges(the lines). Mirage's map can be consider a graph, but a very specific graph becouse all vertex havefrom 2 to 4 edges(connections, and most of them have 4): ![]() We can say that a distance from vertex(1) and vertex(13) is 4, becouse that's the shortest path between them going thru other vertexes. For a human, to find this path is prety easy becouse this graph is veeery simple, and for a computer its even easier. You have a few algorithms to do that. I think that BFS(Breadth-first search) is the best on for our case, becouse an other thing tha make this graphs very unique is that the edges have all value 1, graph's edges can have any value, even - Krloz - 12-08-2006 Ah I see and I think this will be a bit hard - Obsidian - 13-08-2006 there was a link on the other forums to a much better algorithm that i was going to start trying to convert over for my MS game. If i end up doing it, i'll release a tutorial on it, so it can be included in future versions of MSE, because it is a pretty needed thing. |