[MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

Post Reply
sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

[MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

Sofar's Monster/Entity AI

See: https://github.com/sofar/entity_ai

Important Notice: This project is a work in progress and has an unusual license. Before contributing please read https://github.com/sofar/entity_ai/blob ... /readme.md.

This code may not work at all. The API is not stable.

TL:DR: the mod is AGPL-3.0/CC-BY-ND-4.0, but the CLA permits me(sofar) to submit all contributions to minetest_game and relicense it more permissively and compatible with mtg. If you contribute to this project you agree to these terms.

Youtube video about this code: https://www.youtube.com/watch?v=7_nUQRW ... JP&index=4

Image
Last edited by sofar on Mon Sep 26, 2016 17:33, edited 2 times in total.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

So what is in this code?

- A pluggable API with support for all base stuff that monsters need to do (like walk, find specific nodes, run away from aggressor or attack).
- Monsters are entirely created by tables, not code. Monsters are defined as tables that specify the behavior and how to react to changes.
- Path code can be improved on benefiting all monsters
- State transitions are inherent part of each monster, monsters can behave entirely different based on a state transition. For instance, you could change textures of the monster, or become aggressive
- Two modeled monsters, with two full state tables.
- Sheep is mostly complete
- Stone Giant needs more states finished and a few bits of AI code written to be complete

Yes, it's Lua code. I've determined that for single player content Lua is perfectly fine and minetest can handle the load well. I don't intend to make this monster API useful or even performant for multiplayer (although I think it'll do just fine). If this doesn't work well in multiplayer, I don't care.

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by Ferk » Post

Awesome! I like how the AI tables look like declarative programming. Which is quite appropriate for AI.

Though it might make sense to separate the animation/sound definitions from the AI table so it could be possible to reuse the same AI for more than one mob (eg. chickens and sheeps may have similar behavior but different sounds/animations, for people who might find complex to change the AI but still want to make a mob).
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }


sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

Ferk wrote:Though it might make sense to separate the animation/sound definitions from the AI table so it could be possible to reuse the same AI for more than one mob
The AI is entirely outside of the monster definition table, so it's all reusable.

The setup is done in such a way that AI code parts are not part of the monster table, the monster table just specifies the API methods available (think of it as a library of AI code bits).

I've called these code bits "drivers", and they currently live in init.lua. Both monsters in the code currently use many of the same drivers.

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by Ferk » Post

sofar wrote:The setup is done in such a way that AI code parts are not part of the monster table, the monster table just specifies the API methods available (think of it as a library of AI code bits).
That's nice. But as the driver ecosystem grows maybe the state definition with the parameters for the drivers could become more complex. Maybe the states could be defined in a sub-table?

So we can do something like:

Code: Select all

local rabbit_script = {
    driver = "roam",
    properties = {  ..... rabbit specific properties ... },
    animations = { .... rabbit specific animations ... },
    sounds = {  .... rabbit specific sounds ... },
    states = sheep_script.states
}
Then the parameters for each of the "driver-driven" states can be shared, and perhaps use the properties for slight variations.

This is just brainstorming, though. I find the overall design very interesting.

It could be fun to play with it and see how the entities interact... like having wolfs that hunt sheeps and see how the sheeps flee and react.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

Ferk wrote:This is just brainstorming, though.
The layout of the tables itself is up for discussion - I think the layout shows you want my intentions are - providing state drivers with the specific state information needed for that driver.

My approach was to come from the `state` angle and then table off of that. Other approaches may be better, but it's entirely arbitrary for the code - it just serves readability.

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by Ferk » Post

@sofar, could you clarify this part of the license?:
1) you can re-distribute the artwork, but only if you: a) properly attribute b) do not modify the code
"do not modify the code" as in the code of the mod?

Does that mean it's not possible to make pull requests in github? as this would involve editing the code and having the assets in the forked repo. Also this would mean the artwork is actually under a different license than CC-BY-ND-4.0, since I believe this one would not have that limitation (even though it's also sadly restricted in that it doesn't allow modifications of the artwork...).
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

Ferk wrote:
1) you can re-distribute the artwork, but only if you: a) properly attribute b) do not modify the code
Does that mean it's not possible to make pull requests in github?
You can modify the code, permitted you use it for your own purposes, or make it available to users who play on your server, and make it available to anyone. If you only modify the code, and you have not modified the artwork, the -ND clause does in the artwork does not activate.

If you modify the artwork, you can not redistribute it. Of course, you can submit a PR change at all times back to my github repo, that may be technically "distributing" but in the spirit of the project is exactly what we want - you're not going to get into trouble for that.

So basically, forking for the purpose of contributing the project is expressly permitted. The "personal use" clauses of the licenses allow that.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

The readme originally stated:

Code: Select all

1) you can re-distribute the artwork, but only if you: a) properly attribute b) do not modify the code
But that's supposed to read:

Code: Select all

1) you can re-distribute the artwork, but only if you: a) properly attribute b) do not modify the artwork
Hopefully that clarifies everyone's understanding now. I've fixed it up in the repo.

zorman2000
Member
Posts: 84
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by zorman2000 » Post

Is development on this stalled? It would be a pity, since it looks promising!

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by azekill_DIABLO » Post

it looks terribly awesome!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

zorman2000 wrote:Is development on this stalled? It would be a pity, since it looks promising!
I've been spending time on the upcoming minetest release, and getting a bunch of other features in minetest_game that needed help, so yes, this has taken a bit of a pause on my schedule. No worries though, I'll get back to it soon.

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by Wuzzy » Post

sofar wrote:CC-BY-ND-4.0
:-(
Last edited by Wuzzy on Sat Oct 29, 2016 19:22, edited 1 time in total.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

Wuzzy wrote:
CC-BY-ND-4.0
:-(
Please read the full explanation why. Once this mod takes off, the -ND stuff goes away.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by twoelk » Post

Contributor License Agreement wrote: (1) you expressly guarantee that you are the sole author of all
parts of the contribution.
so I can not adjust a random mob from another mod to work with this?

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

twoelk wrote:so I can not adjust a random mob from another mod to work with this?
Only if you are the sole author of that mob, or the assets. If someone would accidentally put in a model or code that has an incompatible license, it would make the project unmergable into minetest_game, which is the end goal.

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by Stix » Post

Ive noticed the last commit to github was 5 months ago, does this mean this project is dead?
Hey, what can i say? I'm the bad guy.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by sofar » Post

Stix wrote:Ive noticed the last commit to github was 5 months ago, does this mean this project is dead?
No. This is still high on my priority list.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [MOD] entity_ai - monster AI Framework [entity_ai] [WIP]

by azekill_DIABLO » Post

Cool, it looks nice.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 26 guests