AI Engine

Update: https://github.com/QuietOne/JMEAI
Update2: Dedicated board and codenamed “MonkeyBrains”

Hi,

I’m Zoran from University of Belgrade and we’re working on various open source AI related projects in our lab. Im also the founder of Neuroph project http://neuroph.sourceforge.net
We have this idea to greate AI Engine for JMonkeyEngine. We want to use some agent framework to wrap human and ai controlled players and create some plugin-based AI algorithms . So we woud like to hear some of your thoughts about this, and get some ideas. For start do you nees something based on neural networks (I remmeber I saw some thread about this a while ago), and what specific AI algorithms you need or find usefull. Thanks!

Cheers
Zoran Sevarac

7 Likes

Hello!

I have just found the same thread: http://hub.jmonkeyengine.org/forum/topic/ai-library/

Can you collaborate together?

Actually, I would like to get neural networks, pathfinding, some logics for the engine. We already have a simple AI lib.
Here it is: We have AI lib here: https://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2Fjme3-artificial-intelligence%2FAI
If you checkout the project you will get some tests-examples there.

It would be cool if you improve the existing AI.

@nehon @normen @Mamoko-Fan can you gude you as they are our leaders.

I’ve kind of found neural networks not that useful in games on a practical level. At least for many of games out there. The overhead to train them is just too much and the results aren’t any more impressive than using some simple state machines, GOAP/STRIPS, or Adaptive Tactic Selection, to name a few. All which can run in real time with great results.
That being said, I have not implemented a neural network system nad I could be way off. But from my reading and talking with other indie devs, I really don’t know any that use neural networks in practice. It could be the nature of their games however.

Neuroph looks pretty cool, I will definitely check it out. Maybe it will change my mind =)

The current AI system in jme is very limited and can do with some serious expansion. So anything in there will help.

@Sploreg said: I've kind of found neural networks not that useful in games on a practical level. At least for many of games out there.

As far as I know many AAA games use neural networks. It would be cool to have such a feature anyway.

There are several algorithms for situations where you don’t have a good algorithm but want the system to find some good solution anyway.
One is neural networks (mentioned above).
Another is genetic optimization. Won’t work well if the search space has few dimensions (because it’s easier to get stuck in a local optimum).
Yet another is simulated annealing.

I’m under the impression that all of these approaches work only for specific use cases where there can be wildly successful.
It would be interesting to know what consistutes a use case for one of these approaches.

@mifth said: As far as I know many AAA games use neural networks. It would be cool to have such a feature anyway.

Which ones? I’d agree with Sploreg here, there has been a few advances in the AI direction in some games but the general consensus is that it doesn’t add any benefit for the actual gameplay. In effect the “intelligence” doesn’t express itself in a discernible manner for the player. Simple GOAP systems cause as diverse NPC actions as neural networks or similar more advanced techniques.

One of the uses I could see would be in animation similar to “Euphoria” (GTA4) where the NPC tries to react “naturally” to physics influences. But as was said, the learning overhead probably amounts to as much work as writing a FSM or similar algorithm to create the same reaction. Note that GTA V has removed this “AI” for movement in favor of simpler algorithms, too.

@normen said: Which ones? I'd agree with Sploreg here, there has been a few advances in the AI direction in some games but the general consensus is that it doesn't add any benefit for the actual gameplay. In effect the "intelligence" doesn't express itself in a discernible manner for the player. Simple GOAP systems cause as diverse NPC actions as neural networks or similar more advanced techniques.

As far as i know some multiplayer shooters used NN. Like Unreal Turnament…

@mifth said: As far as i know some multiplayer shooters used NN. Like Unreal Turnament...

UT uses GOAP afaik, maybe they used some NN for generating the paths for the pathfinding, do you have any sources to back up these claims? Not that I say its impossible but I’d like some more specific info on this. I didn’t see any NN tools in UDK really.

Thank you all for you responses, and I’m very glad to see there is an interest in improving AI in JME.
We’ll take a look whats in there and think about what we could contribute, you gave us some clues.
The guy in other thread is actually my student so yes we’ll definitle collaborate :slight_smile:
Neural networks is just one of the things we could do, and since we allready have them, we’ll just think of some interesting use case in gaming. With time, I hope we’ll do other things as well, as we attract some more students and other folks interested in AI. We allready did some neural targeting with robocode, and we used neural networks to learn about enemy behaviour, aiming and moving and we actually got good results.

One of ideas I got after reading your posts is that Adaptive tactics selection can be done using NN, and that could be done easily. If someone dont want to use neural networks for that - they dont have to. We could design nice API for Adaptive tactics selection and for start we’ll provide implementation based on neural networks, however many other can be provided and people will be free to use what they want.
We’ll think about the best way to plug this into existing AI lib, and it would be great to test this on some existing game.

I like the concept of Behaviour interface in existing lib, it can be extended in interesting ways.

Also I have some questions:
Which class in JME3 is used to represent player in a game?
Which class i used to represent computer controlled characters?
And is there some base class to represent objects in environment?

1 Like

The answer to your questions are:

  1. There are no predefined “players”
  2. Every game type requires a different type of character
  3. No, this is basically a scenegraph for visual representations of objects

I am sure this is not what you wanted to hear :wink: Given that the use cases of the engine vary a lot I guess the best way to handle this is by providing a largely open system. We could care for easy integration by providing the library as a jME SDK plugin including examples and documentation.

Lately we are looking into the concept of Entity Systems and we might introduce more complete game templates (FPS, Strategy etc.) using this paradigm. I suggest you look into this example project by one of our developers which uses a preliminary version of what will probably become the core jME Entity System library:
http://hub.jmonkeyengine.org/forum/topic/monkey-trap/#post-247511

Another idea, given the fact that you seem to have NetBeans experience and that much of the work with NN happens on the developer side is adding (maybe existing) plugins to our jME SDK that ease the creation/training of NNs.

As you indicate you will probably have to find the ideal use case for gaming yourself given that you have the most experience with NNs :slight_smile: If you have problems implementing any specific idea I’ll be happy to help, just nudge me.

@sevarac said: Also I have some questions: Which class in JME3 is used to represent player in a game? Which class i used to represent computer controlled characters? And is there some base class to represent objects in environment?

No specific class for players, NPCs, or environment objects. Approaches I have seen used or discussed:

  • Everything is a scenegraph object: player, NPCs, terrain.
  • Terrain is in the scenegraph, but game logic is moved to “Controller” objects that are attached to scenegraph objects. That seems to be the majority approach for single-player games.
  • Client-Server game. The server leverages the scenegraph code for its world model, all the graphics stuff associated with the scene graph remains dormant (server sends out updates to clients which build a parallel scenegraph and display it).
  • Client-Server game but the world model is segmented into multiple scenegraphs (with all the associated problems whenever a computation needs to consider scenegraph boundaries).
  • Client-Server game but the world model is done with some other data structure than the JME scenegraph.

The more scenarios an AI library covers, the more useful it will be.
I don’t know whether the AI stuff you have in mind requires geometry calculations. If yes, you probably want to use a scenegraph for that. You could require the caller to provide one (that makes it easy to interface with games that already have one), or you could create and use your own (cutting down on potential interference between AI code and external game code).

Are you going to target older Android platforms? I don’t expect you to, but if you do anyway, specific performance advice applies.

I think the main benefit would just be: cool and interesting to tinker with. And not saying that in a bad way at all.

@normen said: UT uses GOAP afaik, maybe they used some NN for generating the paths for the pathfinding, do you have any sources to back up these claims? Not that I say its impossible but I'd like some more specific info on this. I didn't see any NN tools in UDK really.

For example, CrystalSpace Engine has many different AI systems:
“artificial intelligence (behavior trees, path finding, neural networks and genetic algorithms)”
I did not try them, but as far as i know They were implemented with GSoC11-12.
http://www.crystalspace3d.org/main/Main_Page

I think it would be cool o have many AI systems :slight_smile:

@normen said: ... I am sure this is not what you wanted to hear ;) Given that the use cases of the engine vary a lot I guess the best way to handle this is by providing a largely open system. We could care for easy integration by providing the library as a jME SDK plugin including examples and documentation.

Lately we are looking into the concept of Entity Systems and we might introduce more complete game templates (FPS, Strategy etc.) using this paradigm. I suggest you look into this example project by one of our developers which uses a preliminary version of what will probably become the core jME Entity System library:
http://hub.jmonkeyengine.org/forum/topic/monkey-trap/#post-247511


Another idea, given the fact that you seem to have NetBeans experience and that much of the work with NN happens on the developer side is adding (maybe existing) plugins to our jME SDK that ease the creation/training of NNs.

I think they can skip EntitySystem and Netbeans-SDK-plugin fo a while. As this is not so important for starting AI development and it can take much time. Also, many people do not use ES at all. The lib should work even without ES.

But this is just IMHO.

As long as they don’t bind it directly to the scene graph but to interfaces/proxys , any ES should be able to use it anyway. And just provide the necessary data for the interfaces from it’s own logic.

1 Like
@mifth said: I think they can skip EntitySystem and Netbeans-SDK-plugin fo a while. As this is not so important for starting AI development and it can take much time. Also, many people do not use ES at all. The lib should work even without ES.

But this is just IMHO.

As I said, an open system that can be used with any game. And I said that tools for learning should be in the SDK, you realize theres a whole NetBeans based IDE for the NNs already? Otherwise what you want is already there, this library is alredy existing, just use it.

And you could not really find any AAA game using a NN hm?

As I said, an open system that can be used with any game. And I said that tools for *learning* should be in the SDK, you realize theres a whole NetBeans based IDE for the NNs already? Otherwise what you want is already there, this library is alredy existing, just use it.

Exactly, we allready have everything, just put whole stuff together. We’ll do this one for sure.

- Terrain is in the scenegraph, but game logic is moved to “Controller” objects that are attached to scenegraph objects. That seems to be the majority approach for single-player games.

Actually thats what I had on mind too.

We could care for easy integration by providing the library as a jME SDK plugin including examples and documentation.

Definitly jME SDK plugin for something like “game domain model” which is based on some existing Entity System. We dont want to bind AI to anything related to graph scene, rather some general game domain objects. These can be further specialised for different types of games.

We’ll do something and show you in early development phase to get some feedback.

2 Likes
@normen said: As I said, an open system that can be used with any game. And I said that tools for *learning* should be in the SDK, you realize theres a whole NetBeans based IDE for the NNs already? Otherwise what you want is already there, this library is alredy existing, just use it.

And you could not really find any AAA game using a NN hm?

Ok.

I did not search them. Anyway, it’s always good to have many choices. :slight_smile:

@sevarac you can also check these JME projects. Possibly it can help you in some way:
https://code.google.com/p/motiveai/
https://code.google.com/p/easyfinding/

This is more like an experiment. But its AI too. :slight_smile: