Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Path for enemies

Author
Message
En929
7
Years of Service
User Offline
Joined: 8th Feb 2017
Location:
Posted: 9th Mar 2019 22:41
I was wondering how do some of you handle pathfinding? For example, if I want enemies to move in directions and in a certain patterns what do I do? I was thinking I could do that with color schemes. For example, I could go to a paint program I could draw the path that I want using the color green, save it as a png file and then in the code write something like:



Ok, I'm sorry. The above would be Javascript/Java's way of writing LOL and I am new to Appgamekit. So, my MAIN question is how do some of you do pathfinding in Appgamekit? Thank you!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Mar 2019 14:06 Edited at: 10th Mar 2019 14:56
using a color method for pathfinding might be a good way you could use it as a background invisible image


often there are other alternatives for example

the cars follow the track but there is no pathfinding this was achieved by using invisible blocks ahead and attached
to the car. If the left block wasn't on the track the car AI made the car turn right theres other stuff added like brakes etc


The zombies in that if I remember correct only move a set amount ide have to check that's quite old but it could've been
achieved by placing invisible sprites where you wouldn't want the sprites(zombies) to go or color detection im not sure how
I did it now maybe it was color detection I forget lol

pathfinding is a whole new method on this thread I have a 2D path editor which you prob wont find useful
https://forum.thegamecreators.com/thread/222027
fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Mar 2019 17:19
Hi there ... fubarpk method is a good one. We could make a path of way points from one place to another , then you can use the distance to every waypont to change for the next one.
I'm not a grumpy grandpa
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Mar 2019 19:50 Edited at: 10th Mar 2019 19:51
Simplier to use a bread crumb method..
Place invisible objects that you make your ai point towards and walk to them in the order you want.
Very simple to do in your mapper for the game.

Player spotted point towards player and attack..
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 10th Mar 2019 20:30
A way I leaned on how to do waypoints in 3D

https://forum.thegamecreators.com/thread/223711

Login to post a reply

Server time is: 2024-11-23 02:46:19
Your offset time is: 2024-11-23 02:46:19