GDQuest / godot-steering-ai-framework

A complete framework for Godot to create beautiful and complex AI motion. Works both in 2D and in 3D.
http://gdquest.com/docs/godot-steering-ai-framework
MIT License
1.15k stars 78 forks source link

Add additional behaviors #24

Open Razoric480 opened 4 years ago

Razoric480 commented 4 years ago

There are more behaviors out there and they could prove useful for certain games. They should be their own issues, but they are gathered here for discussion and as a central location for now.

Some contenders:

Individual

Group

Razoric480 commented 4 years ago

Full-3D, six-axis enabled behaviors from #32 would fit here as well.

realkotob commented 4 years ago

Hello, I have some experience with 3D steering boids in godot and can probably help with some of these. Which of these are free to take and which have higher priority?

Here is a sample project that shows the 3D boids AI that I made from scratch: https://asheraryam.itch.io/flying-game

(Excuse the strange control scheme, it works best with a controller)

It has pursuit, evasion, alignment, grouping, follow the leader (which I use for staying within orbit range), and is fully multi-threaded and supports several hundreds per cluster with little noticeable slowdown (the in-game bottleneck is from my custom trail render graphics code which I put on the same thread).

I actually started porting the class to c++ for more speed but it would be a better use of my time to contribute here and optimize it instead 😄

P.S. I can also share the project source if it would be helpful

NathanLovato commented 4 years ago

@asheraryam your help would certainly be welcome! I'll let @Razoric480 tell you which behaviors you could work on.

Also, here are our style guides and contributor's guidelines:

If you have any questions, we're here to help, or on [Discord]()

I actually started porting the class to c++ for more speed but it would be a better use of my time to contribute here and optimize it instead smile

The day GDNative becomes really easy to set up and to use, and if GDScript's future performances aren't enough, we may port the slower behaviors to C or C++. But currently, it's hard to distribute that kind of code.

realkotob commented 4 years ago

@NathanLovato Thank you, I'm looking forward to it.

The day GDNative becomes really easy to set up and to use

Haha tell me about it, I definitely wasn't suggesting this project should shift to C++.

Razoric480 commented 4 years ago

I'm not working on any of them at the moment, so they're all free. If I had to prioritize a couple, however:

  1. Raycast obstacle avoidance. Ideally, you should be able to give it a generic "raycast configuration" object that determines how the raycast works, and there should be some prebuilt ones (3 rays fanning out, a single one shooting forwards, etc.) The tricky part is that it should work in 2D or in 3D with minimal hassle. We may have to split this one into two classes because Godot's physics is split between 2D and 3D and it would make more complicated code to differentiate them. That or we have the one class, but the raycast configuration is abstract, and is extended into a 2D and 3D abstract classes, from which the prebuilt configurations are made from.
  2. Wander.
  3. Alignment group behavior.

Not that I'd reject code that implements the others.

Like the rest of the framework as it is, some inspiration has been taken from GDX-AI so feel free to source some ideas from it.

Razoric480 commented 4 years ago

As for GDNative, yeah; needing to distribute a DLL, dylib, and so file would bloat up the size of the framework, and expecting everyone to pull in and learn how to use scons to compile their own just to use the framework would make it severely inconvenient.

If we do make a GDNative module, it'd be an optional alternative. At the moment, however, performance hasn't really been necessary.