Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (opm), 778 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: Tip of the Week #10: New Pathfinding Solution! [Re: Superku] #446684
10/27/14 22:53
10/27/14 22:53
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Changing the number in str_clip to 4 (or 5 for that matter) didn't allow me to use Treg_ and Tpath_, but it's cool because I can still use custom names. reg_tee and path_tee work perfectly without any need to edit your code at all. Curiously, the code block that contains "draw_text(str_for_num(NULL,i),temp.x-10,temp.y-10,COLOR_RED);"
doesn't seem to work with my custom names. I know it's merely for debugging purposes to let us see the nodes' locations during run time, but I thought it might be worth pointing out.

How do I disable hpf_path_get_target_collision? Would changing
Code:
var hpf_path_get_target_collision = 1;

in line 63 to
Code:
var hpf_path_get_target_collision = 0;

do the trick?

The values I got after replacing the error code with the printf you suggested were
"Start: -1, Target: 1, Max_nodes: 12" (got this a few times)
"Start: 7, Target: -1, Max_nodes: 10" (same path as above after I deleted 2 unnecessary nodes. They weren't connected to the rest of the nodes)
"Start: -1, Target: 1, Max_Nodes: 6"
"Start: 6, Target: -1, Max_nodes: 10"
I still haven't found a way of reproducing the error 100% of the time. Sometimes, I'll try about 8 times and the AI will make his way to the target perfectly each time. The only pattern I've been able to notice is that the error pops up ONLY when the AI (and hence, the start node) is in a different region from the target/the player's position when I press "t" to trigger the function.
The error usually doesn't pop up as soon as I hit "t", but when the NPC has already traveled about halfway to his target, sometimes when he's just about to reach the target. Sometimes, the game still hangs without any error message.

Re: Tip of the Week #10: New Pathfinding Solution! [Re: tolu619] #446725
10/29/14 09:30
10/29/14 09:30
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I assume the project is not that big yet? Can you send it to me please for debugging purposes?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #10: New Pathfinding Solution! [Re: Superku] #446761
10/30/14 11:30
10/30/14 11:30
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Will send you a direct message. Thanks.

Re: Tip of the Week #10: New Pathfinding Solution! [Re: tolu619] #446925
11/06/14 14:16
11/06/14 14:16
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Sorry, I couldn't find a way to add this thread to my watched topics without posting a reply so consider this reply an empty string laugh

Re: Tip of the Week #10: New Pathfinding Solution! [Re: tolu619] #446926
11/06/14 14:35
11/06/14 14:35
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I've had a look at my code and the corresponding functions twice and tried to force an error by using two different regions (and paths) for start and target nodes but I couldn't find anything or reproduce the error yet.
I sadly don't have an idea right now what could be the cause of the error but I will keep on thinking about it.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #10: New Pathfinding Solution! [Re: Superku] #446959
11/08/14 14:48
11/08/14 14:48
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Ok, thanks. When you run my own game on your computer, does it crash like I said it does on my computer? I noticed that if the AI is in another region and I call the function to make him come over to the player's position, he starts coming and the game doesn't crash until the second he steps into the player's region. And the crashes only seem to happen 1 out of 8 times.

Re: Tip of the Week #10: New Pathfinding Solution! [Re: tolu619] #447152
11/20/14 13:06
11/20/14 13:06
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
So I was wondering...what's the advantage of breaking the level into small sections, each with its own path and region? As it is, even though we're not yet sure what it is about my code/level structures that causes the occasional crash, your code won't crash in my game if I used only one region and one path. For relatively small levels, why don't I just use one big region with one path?

Re: Tip of the Week #10: New Pathfinding Solution! [Re: tolu619] #447154
11/20/14 13:35
11/20/14 13:35
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
As I am using the same pathfinding code in my sidescroller game I hope to find the cause for the error some time soon but I didn't have much time for Gamestudio the last couple of weeks.
Until then it's fine to use just a single region and path for your enemies and objects.
The advantage of multiple regions and corresponding paths is not only ease of usability (in terms of level creation) and performance but the movement in non-regions is more flexible and smoother because the entity will not try to follow a path but move directly to the (potentially dynamic) target.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #10: New Pathfinding Solution! [Re: Superku] #447174
11/22/14 09:07
11/22/14 09:07
Joined: Jun 2014
Posts: 97
Lagos, Nigeria
T
tolu619 Offline
Junior Member
tolu619  Offline
Junior Member
T

Joined: Jun 2014
Posts: 97
Lagos, Nigeria
Your game is almost complete and the code has given you no problems. It probably has something to do with tracking in 3 dimensions. Anyway, thanks. I'll use a single large region in the mean time

Re: Tip of the Week #10: New Pathfinding Solution! [Re: tolu619] #453766
08/11/15 20:07
08/11/15 20:07
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
There is a new and improved version available!
Major new feature is debugging function which you can call each frame:
void hpf_debug(ENTITY* ent, var mode, COLOR* color);

This should help with debugging and isolating problems. There are some other features and more customizability so make sure you check the "hpf_pathfinding.h" configurable stuff area.

Download: http://superku.de/HPF_v1.25.zip



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 4 of 5 1 2 3 4 5

Moderated by  adoado, checkbutton, mk_1, Perro 

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