Machine learning development in Unity?

Hi,

I’m fairly new to Unity and i wanted to ask - what is the best way to go about developing machine learning features? (as part of an interactive mobile app, not a game)

Should i focus on C#? Are there any libraries that could help me?

What about C++? Is it possible to write those features in C++ and then somehow put them in Unity?

Thanks!

You certainly could write your ML code in C++ and build it as a Unity plug-in, but this is almost certainly the way of pain. Just do it in C#, which is in many ways a better language anyway.

The only library you might want (depending on what sort of ML you’re doing) is some sort of basic linear algebra library, perhaps like this one.

If you need any help, let me know — I’ve been interested in ML for years and love any opportunity to apply it.

Do I need high end PC to use ML plugins in unity? I only have a MacBook pro

No. I’ve done plenty of ML stuff on my 2012 MacBook Pro.

I read some instructions it stated I need something called CUDA by Nvidia, I assumed I’ll be needing a bunch of gtx 1080s

Instructions for what?

You must have been looking at some particular ML library or package. That could indeed have specific hardware requirements. That doesn’t mean that ML in general does. Check out this tech paper I wrote a few years back, comparing several ML algorithms to human performance in a sort of puzzle environment. All that was done in REALbasic on a Mac.

I tried to read your work but it’s too high level stuff for me, what would you suggest where should I begin learning how to use AI in unity (Not Navmesh agents). Should I start with tensor flow?

See here; https://blogs.unity3d.com/2017/09/19/introducing-unity-machine-learning-agents/

1 Like

Actually I just found that I can do it without a GPU, but it requires knowledge in using Anaconda jupyter Notebook app, so I’ll have to give up on ML agents for now

Yeah, Unity’s ML Agents are interesting, though if you can’t follow my paper I’m not sure you’ll have much luck with their toolkit either.

Check out the books AI Game Programming Wisdom (volumes 1 and 2), as well as Artificial Intelligence for Games. I also really like Artificial Intelligence: A Modern Approach (though that one is not game-specific).

ML isn’t user friendly right now. It’s basically a case of it being serious WIP across the board, from all walks.

1 Like

The books you mentioned, are those beginner friendly?

I guess I’ll start reading some books.

Yes, all those are quite approachable I think.

Thanks, I’ll check them out