Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Announcements and Showcase
Pathfinder with pathnodes
Author Text

sven
Registered User
Quote
2022-05-09 19:14:44

Newest WIP version:

Download:
https://5v3n.itch.io/coppercube-...

Multilevel map:
🔎︎




UPDATE 28/08/2022

This is a Pathfinder script that uses pathnodes..
script has game and edit -mode.

so you can edit connections between nodes in editmode and it will be saved to the file..
and you can load this file in game mode.

This works best on room-maps but can work on terrain also with some extra work.

Download:
https://5v3n.itch.io/coppercube-...







//OLD VERSION

Yes again the pathfinder -another one:D

Testversion-very ugly level and code but shows how it works.
Use WASD to move player-AI will follow you if activated( activates if sees player in its visual range)

https://drive.google.com/file/d/...

I made first version of this 9 months ago but this version is very different and probably easier to use if i finish it.

So it uses BOX-es as pathnode.
boxes must be in folder PathNodes
names must be P0 to ..

These boxes you can set invisible (collision must be on) at first so they dont annoy you,at game startup they will be deleted so they are not in game.

(this version doesnt look for shortest path)
You see this level has 2 floors and one stairs -if you goto second floor then AI uses stairs to get there also.

Any errors or problems you get with this project you can tell me so i can fix them and make it better.


sven
Registered User
Quote
2022-05-10 18:20:26

Updated.

Download:https://drive.google.com/file/d/...

Better AI
Better PathNode scanning.

AI can be set to go back at its starting location if didnt find player..will finish its PATH and if player out of range then moves back to startPos (closest pathnode to the startPos).

Read info.txt file and look info.bmp to get more info about this project.


This is not final version.


C o a
Guest
Quote
2022-05-10 18:40:15

sounds nice feature sven


sven
Registered User
Quote
2022-08-28 01:00:06

Updated first post..
UPDATE 28/08/2022


sven
Registered User
Quote
2023-01-10 16:41:02

UPDATE: 10/01/2023 (d/m/y)

Should be faster now.. because it doesnt scan for paths realtime now.. it scans all possible paths at game startup and uses them later if called.


Download:
https://5v3n.itch.io/coppercube-...


sven
Registered User
Quote
2023-01-11 22:33:36

UPDATE:

Download:
https://5v3n.itch.io/coppercube-...


Now you dont have to connect pathnodes manually.
Added editor plugin that helps you to edit and generate connections inside the editor instead of inside the game as in previous version.
Optimized code where you search start and end points.
Now its not scanning for path realtime so its fast now.
AI is simple to make to use it.. will relase complex AI soon
With random patrol with route and more.
Should be faster than previous version and less performance affective.

If you know programming you can store and use calculated paths independent of my script.

If you have complex game level you can add temporary blocks into game and then calculate paths..after that you can delete temporary blocks from game.

This pathfinder is step based.. it takes path with less steps.
Doesnt care if you have shorter path with 3 steps if it can find 2 steps path.

This will be the last update of this topic because it fits my needs and for me its ready to use. If you find a bug then let me know i will fix it.


DouweDabbe
Guest
Quote
2023-01-12 13:57:34

wow, nice !!!
I like it, this one and its previous iterations particular the easy update process !!!

but stricktly speaking this is "routing" and not "pathfinding".
(but almost there i would say)

as I understand pathfinding to be:

1 - an enemy node that at some unknown time and unknown location in the runtime game.
2 - by itself can find a path to the player who at the same moment is also at an unknown location in the runtime game.
3 - this mostly triggered by proximity or some event (player scored the key to room with upgrade or something like that).

pathfinding with path nodes would require some thing like:
1 - what is nearest path node of (A) player and the triggered enemy (B).
2 - what are the pathnodes that lie between A and B
3 - which of those pathnodes provide the shortest path between A and B
4 - make enemy B follow that path to A and attack player if is still there or about.


sven
Registered User
Quote
2023-01-12 14:18:46

DouweDabbe wrote:
wow, nice !!!
I like it, this one and its previous iterations particular the easy update process !!!

but stricktly speaking this is "routing" and not "pathfinding".
(but almost there i would say)

as I understand pathfinding to be:

1 - an enemy node that at some unknown time and unknown location in the runtime game.
2 - by itself can find a path to the player who at the same moment is also at an unknown location in the runtime game.
3 - this mostly triggered by proximity or some event (player scored the key to room with upgrade or something like that).

pathfinding with path nodes would require some thing like:
1 - what is nearest path node of (A) player and the triggered enemy (B).
2 - what are the pathnodes that lie between A and B
3 - which of those pathnodes provide the shortest path between A and B
4 - make enemy B follow that path to A and attack player if is still there or about.



Thanks. i am not sure what it is called exactly - but it finds a path so i called it like this :D
My version does:
1 - what is nearest path node of (A) player and the triggered enemy (B).
2 - what are the pathnodes that lie between A and B
3 - which of those pathnodes provide the shortest path between A and B
(i dont use shortest path in this version but step based)
4 - make enemy B follow that path to A and attack player if is still there or about.


sven
Registered User
Quote
2023-01-14 21:41:32

-


sven
Registered User
Quote
2023-01-15 13:52:37

-


hadoken
Guest
Quote
2023-01-15 14:45:36

@sven

Very interesting, thanks a lot for sharing! Could you possibly provide an example of a friendly NPC and another example of an aggressive attacking chasing enemy when you release the next version (v6?) to better illustrate the potential of your work?

Would it also be possible to put the created connections better somehow into one longer javascript or CopperCube variable for ingame & publishing use instead of loading from the created extra txt-file? THX


sven
Registered User
Quote
2023-01-15 15:06:03

hadoken wrote:
@sven

Very interesting, thanks a lot for sharing! Could you possibly provide an example of a friendly NPC and another example of an aggressive attacking chasing enemy when you release the next version (v6?) to better illustrate the potential of your work?

Would it also be possible to put the created connections better somehow into one longer javascript or CopperCube variable for ingame & publishing use instead of loading from the created extra txt-file? THX


Yes it can be put into javascript.. probably i will make it to export javascript code so it can be added to game script easily.
Example AI that is more complex than last AI will come with next version for sure.(its 80% done already)


With last version there is simple AI included.. if you set its visual range (high) and attackrange(about 50) then it will attack player (stand in front of player).. and chase player (by takeing path to the player) if cant see where player is.
(in example i may set those values very small so it can random patrol on map without player can inturept him)
Also PLAYER input in simpleAI behavior must be set to be player node(active camera) .( i maybe set it to another camera that is not active)


hadoken
Guest
Quote
2023-01-15 15:48:10

@sven

Nice, thanks!


creaturefreak
Registered User
Quote
2023-01-17 07:50:13

Amazing work as always Sven! You seem to have created a navigational mesh system for Coppercube ? very impressive !

Looking forward to seeing your updated final version.

best,
CF


sven
Registered User
Quote
2023-01-19 10:19:25

New version (test version) relased:

Download:
https://5v3n.itch.io/coppercube-...

Now you can insert connections data to javascript-so no file needed.
You can add/delete generated pathnodes inside the Coppercube editor.
You can delete node connections inside the Coppercube editor.
You can block pathnode generation by placeing obstacles to the level.
You can manually insert connection info to a file.
Added simple AI.
More info comes with download. INFO.png (took me huge time to write that info so make sure you read it before asking questions that is already answered :D )


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact