0 votes

I'm making an RPG for a class, and I have no idea how to:
1-Make an enemy move on its own
2-Make the enemy move towards the player when they are within a specific radius of each other.
I'm a newbie to Godot, and any help would be greatly appreciated!!

in Engine by (12 points)

So you basically want to make an AI (Artificial Intelligence.)
Here's something in the docs
http://docs.godotengine.org/en/stable/learning/features/physics/ray-casting.html?highlight=AI
I also recommend checking out some github projects. To get an idea of how some AIs work.
Here's Godot's official demo projects.
https://github.com/godotengine/godot-demo-projects
And here's Dolphin Island 2.
https://github.com/janmarcano/Dolphin-Island-2

Thanks. Useful starting points.

1 Answer

+1 vote

This is an answer as generic as the question.

For basic movement, you can set simple rules and make it move according those rules.

There are many techniques to detect and follow, that should be part of the mechanics of your game, you can do some basic things easy trying to reproduce your mechanics with code.

For a RPG proper, there is a lot of study and research on general AI, you will need to learn about finite state machines first, then steering behaviours and other stuff, depending always on the design complexity.


An advice, write the basic mechanics on paper (basic, leave extra features for later), draw everything, try to reproduce that with the engine.
Then you will have more clear where you lack of knowledge and what to ask on specific problems.

ps: godot lacks of resources for people starting from zero but there may be a couple of tutorials around for that.

by (7,866 points)
edited by

This post while general, was surprisingly helpful to me. Thanks.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.