Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 7th_zorro), 877 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Space StarMap Stargates #204677
04/30/08 18:20
04/30/08 18:20
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Hello.
Im wondering, how could i get the ship to calculate the number of jumps needed to get from the K1 point to the K4 destination.
Lines means that there are startGates( teleporters) connections for those stars.

In this example the the quick way to get from k1 to k4 is goin directly, since there is a stargate that connect those points. So its just 1 jump (fastest). Though you could go from K1 to K2 to K3 and K4 too, though it would be slower ( 3 jumps).

Im asking this because i want a button to turn auto pilot on, and let the player click on the destination in this example K4 , and then the AI system will calculate the fastest waypoints, and will show a list with the waypoint route (order) and drive the ship for those stargates.

Anyone expert on this can give me a hand?

Last edited by MMike; 04/30/08 18:23.
Re: Space StarMap Stargates [Re: MMike] #204682
04/30/08 18:26
04/30/08 18:26
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
Serch pathfinding (with nodes) in contribution forum. \:\)


Never say never.
Re: Space StarMap Stargates [Re: tompo] #204699
05/01/08 04:19
05/01/08 04:19
Joined: Oct 2006
Posts: 175
G
Gumby22don Offline
Member
Gumby22don  Offline
Member
G

Joined: Oct 2006
Posts: 175
Yep - any pathfinding you use should be able to count the jumps. Because its node based from the start, it should be relatively easy to implement \:\) Have fun

Don
have a great day

Re: Space StarMap Stargates [Re: Gumby22don] #204773
05/01/08 16:14
05/01/08 16:14
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
I searched but there are very complex Ai systems i just need some basic ai path finding, Like.

Each dot, is an place, with a name, or number, and need to get the lowest combination possible to reach the same destination..
I was expecting some expert could writte a simple thing.
Whats the mechanism?

Re: Space StarMap Stargates [Re: MMike] #204778
05/01/08 17:23
05/01/08 17:23
Joined: Aug 2006
Posts: 652
Netherlands
bstudio Offline
User
bstudio  Offline
User

Joined: Aug 2006
Posts: 652
Netherlands
Search for the perfect AI series in the AUM magazines. There is something similar to what you want there.


BASIC programmers never die, they GOSUB and don't RETURN.
Re: Space StarMap Stargates [Re: bstudio] #204787
05/01/08 18:00
05/01/08 18:00
Joined: May 2005
Posts: 133
Germany, Passau
AlexDeloy Offline
Member
AlexDeloy  Offline
Member

Joined: May 2005
Posts: 133
Germany, Passau
You could try to implement the Dijkstra Algorithm to find the shortest path in a set of nodes.
The easiest way might be to save the distances between the nodes in a two-dimensional array: e.g. distance[3][5] = 70 for a distance of 70 between the nodes 3 and 5

Re: Space StarMap Stargates [Re: bstudio] #204789
05/01/08 18:07
05/01/08 18:07
Joined: Jul 2004
Posts: 1,205
Greece
LarryLaffer Offline
Serious User
LarryLaffer  Offline
Serious User

Joined: Jul 2004
Posts: 1,205
Greece


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!
Re: Space StarMap Stargates [Re: LarryLaffer] #204799
05/01/08 19:13
05/01/08 19:13
Joined: May 2005
Posts: 133
Germany, Passau
AlexDeloy Offline
Member
AlexDeloy  Offline
Member

Joined: May 2005
Posts: 133
Germany, Passau

Re: Space StarMap Stargates [Re: AlexDeloy] #205147
05/04/08 14:08
05/04/08 14:08
Joined: Oct 2006
Posts: 175
G
Gumby22don Offline
Member
Gumby22don  Offline
Member
G

Joined: Oct 2006
Posts: 175
Awesome - clear, precise. Well done Alex.

Don
have a great day

Re: Space StarMap Stargates [Re: Gumby22don] #205912
05/09/08 14:57
05/09/08 14:57
Joined: Jan 2006
Posts: 59
Desert Zone
WolfCoder Offline
Junior Member
WolfCoder  Offline
Junior Member

Joined: Jan 2006
Posts: 59
Desert Zone
I was thinking of first a comparison of all the stars that make a circuit, and then an algorithm that first gets you in that circuit and then finds the closest star in that circuit.

For example stars K1, K2, K3, and K4 make a circuit and you can go around in a circle with them. There's another circuit with K2, K3, and the star off to the side. Those two stray stars would be considered a circuit even though there is 1, but both are their own circuits.

First step is to get yourself in the circuit the star is in, but the starting location is in the circuit which contains K4. Then, you've got to travel either left or right, and check the total distance of all the lines from the left and right, and in this case the left path is shorter (directly).

I'm not sure if this is a good algorithm or not, but I would write a function to run through and recursively catalog all the stars and which circuits they make up. For faster speeds, this would run at compilation.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1