[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
>making a neural network for a game AI >need a static number
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 13
Thread images: 1
File: 1351171338888.jpg (63 KB, 567x720) Image search: [Google]
1351171338888.jpg
63 KB, 567x720
>making a neural network for a game AI
>need a static number of inputs to train on
>the amount of things on the map vary
>so the amount of inputs the the NN should vary

What do?
>>
>>54382511
Learn machine learning.
>>
>>54382536
That's what I'm doing
>>
nigger that's not how it works
>>
>>54382707
Why not? If there is you and one enemy then the inputs might be your xy and its xy. So that is 4 inputs. Then the output is some decision, like move up, left, right, down.

But for each new enemy there will be two extra inputs. So how do I train a NN to deal with this?
>>
>>54382511
Teach it to install Gentoo.
>>
>>54382511
I've never used neural nets for any serious game programming, but I've made some simple 2D top down shooter style games with them.

My neural nets had a fixed X number of inputs, so first I just fed them the X closest objects. This had some issues with them not going after enemies if there was a bunch of stuff around the bot, so I modified it so that it got the X closest objects in field of view cone (based on the direction the "gun" was pointing) plus a small circle around the bot (so you can't sneak up on the bots).

Seemed to work fairly well but then again the games were really simple. This might not work well if you had say "sniper" bots that should engage targets that are farther away. Also the bots probably wouldn't do well against snipers because they would never be able see them. Maybe you would first feed them N targets that recently fired on them, and then pad the rest with X-N closest object.
>>
>>54382841
Cool!

How did you train them?
>>
choose an area that the bot sees.
a circle or cone or whatever.

break it into a number of regions.
the inputs would be stats about each region.
>>
>>54382765
Typically if you change the inputs, you have a different net, which requires new training so you usually can't change it on the fly.

>>54382868
Simple genetic algorithm + playing against them. I tried having them fight each other to train, and they got pretty good at that, but as soon as a human started playing, they didn't really know what to do. For the genetic score, I did something like +1 for a hit, -10 for being hit, and -0.1 for a missed shot. I had to add the last bit, because they tended to develop a habit of spray and pray, which I guess is kinda smart, but not very much fun to play against.

I would save the top nets to a JSON file and load it on start I didn't have to train from the start each time.
>>
>>54382994
>stats about each region

Wat? Example?
>>
better go with 500 inputs OP, just to be safe
>>
>>54383283
What if there aren't 500 things that need to be considered? Won't work
Thread replies: 13
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.