Hi! Sorry for my repeating question,but it is very important for me. I have the great plan of revenge.I wonna kill lich and his brother and then attack a...
Hi JT, ... Maybe i write difficult to understanding... I have asked how many turns i have to the END of this test game :) ... J> Neither do we. When monsters...
... Hash: SHA1 ... Okay.. Atlantisdev is the forum for development of the game engine. Questions about a specific game (of which there are many and I have no ...
Hi JT J> Okay.. Atlantisdev is the forum for development of the game engine. J> Questions about a specific game (of which there are many and I have no J> idea...
I'm working on a 'mapping object' for a utility I'm working on. I need to work out the distance between two hexes. I *thought* that the distance was whichever...
Voidspace
mike@...
Oct 6, 2003 2:07 pm
5763
Hi, Hope I understand the problem correct, but with the distance I assume you mean the move-distance between two hexes. (abs(x1-x2) + abs(y1 - y2)) / 2 seems...
Thanks Henrik. Yes you understand the problem correctly and yes I missed off a +1 in one of the world wrap patches ! Thanks..... I *think* what you are saying...
Voidspace
mike@...
Oct 6, 2003 3:27 pm
5765
(Thanks Henrik - your method seems to work fine for every case and I think I even understand why !) My next task was to find the shortest route between two...
Voidspace
mike@...
Oct 7, 2003 9:17 am
5766
... Hi Fuzzy, It *is* pretty straightforward, with a little cunning: Consider, for simplicity's sake, a movement northeast-ish from (0,0) to (x,y) - that would...
... One other thing that I forgot - rather than have complicated if .. then statements for world-wrapping, just add the world's width to each of the x-coords...
For world wrapping (horizontal) - I just worjk out if the distance (x-seperation is > half of the world size). if it is then it's quicker to go the other way...
Voidspace
mike@...
Oct 7, 2003 10:40 am
5769
Hi Fuzzy, Prim's Algorithm is used for determining the MTS, Minimum Spanning Tree of a graph. What you need is a shortest path algorithm. The two algorithms...
Thanks. Yes it's the Dijkstra algorithm. The list in the example I have looks like : E=[('s','u',10), ('s','x',5), ('u','v',1), ('u','x',2), ('v','y',4), ...
Voidspace
mike@...
Oct 7, 2003 11:54 am
5771
... Hash: SHA1 ... You know, I run an interview problem for job candidates which this is a perfect description of. The interview question is phrased in terms...
I think I can even work out how to do that :-) I'll have to work out how you store the *path* to a node... not just the node..... it kind of flits in and out...
Voidspace
mike@...
Oct 7, 2003 2:36 pm
5773
... Hash: SHA1 ... Store it as a linked list. When you go to add a child node, copy the current path from the parent, then append the path from the parent to...
[snip].... Store it as a linked list. When you go to add a child node, copy the current path from the parent, then append the path from the parent to the ...
Voidspace
mike@...
Oct 8, 2003 8:21 am
5775
... Hash: SHA1 ... Mine also stops following paths which become bad. (or rather it follows them only after all better seeming paths have become worse :) ... ...
If my memory serves me correcy, JT's description sounds similar to Dijkstra's algorithm. However, you don't have to store a linked list of the path in every...
[snip..] I might still have a two tier node system (using provinces as nodes and then hexes within provinces). Not just for speed - if a lot of units are ...
Voidspace
mike@...
Oct 8, 2003 8:42 am
5778
What are the movement costs for flying units like balloons, floaters and gliders ? (units capable of moving over land and water ??) I'm more concerned if the...
Voidspace
mike@...
Oct 8, 2003 11:49 am
5779
... Hash: SHA1 ... Mine is a modified dijkstra's algorithm, yes. However, you cannot do what you suggested since when you visit a node for the first time,...
Hmmm....... Heres a pseudo code for the A* search method..... lloks good - you write your own 'heuristic' function which in my case would be the 'rawdistance' ...
Voidspace
mike@...
Oct 8, 2003 1:57 pm
5781
... Hash: SHA1 ... This should never be the case, since you only visit a given node once with the absolute best cost (that the reason for the priority queue) ...
Well, as stated in the algorithm, "Mark the node you just pulled off as visited (in some global structure) and continue.", you will have a global structure for...
... Hash: SHA1 On Wed, 8 Oct 2003, Voidspace wrote: 11 Set the cost of node_successor to be the cost of node_current plus the cost to get to node_successor...
Voidspace
mike@...
Oct 8, 2003 3:18 pm
5785
... Hash: SHA1 On Wed, 8 Oct 2003, Voidspace wrote: 11 Set the cost of node_successor to be the cost of node_current plus the cost to get to node_successor...
Voidspace
mike@...
Oct 8, 2003 3:54 pm
5786
... Hash: SHA1 ... Nope. The cost information in the priority queue is the 'total accumulated cost' from starting point to that node. Since it's a priority ...