Making AI write game code

Hey guys. Unity recently put in .net 4.6 which has things like creating methods on the fly and adding them to objects. There’s also things like dynamic objects which allow for a lot more runtime manipulation.

Do you believe that their will be a practical way to create ai that can write code based on test cases? If so how do you think you would pseudocode something like that?

Edit:
Probably should’ve included this:

They talk about how they were able to program an ai that learned how to write code.

No. For the nearest future those ideas are a pipe dream. From the article you linked:

2 Likes

Should you need to surely we have written and optimised every algorithm for know game genres by now, over and over again.

On the other hand if you could farm all the games written and extract their code, analyse it for patterns and classify it then you have the basic training data needed for a game development AI.

Nearly All AI does is look for patterns it can recognise. The question is how would you input your problem domain or what would you need to ask for to get it to write Doom, Tetris, Space Invaders, Portal or WipeOut.

https://metamakersinstitute.com/

I already have an AI that writes my code for me. I give it high level instructions, and it goes ahead and writes a bunch of low level code for me. Its called a compiler. The linked article simply describes the next logical step to a compiler that can work at a higher level of abstraction.

AI is frequently used to mean ‘an algorithm we haven’t completely figured out yet’.

5 Likes

Unity will want to use AI to make game code. Arowx has the details.

13 Likes

Get source code from, oh I don’t know, 50 or so games. separate it into snippets, run it through a learning algorythm and repeat geneation until you get something that Compiles. Don’t forget to use neural networks and evolution learning for those sweet youtube views.

1 Like

@FMark92 that would probably work, might take couple million years to get anything meaningful tho…

Well i’ve been thinking about it. If you use same class stucture over all the games supplied to the leaning array and give it a few concrete samples to see how to connect them you would end up with something compileable pretty soon. But the amount of work needed to generalize enough similar games would defeat the purpose of the learning. Actually having this much control over what goes into it would prodice predictable results. And grading would still be a problem. The whole genetics thing would try it’s hardest to add/ remove components in the mutation stage but yes the chance of something playable coming out at the end are just too low to try.

Let’s just make games instead. … I say as I refresh the “new posts” tab and “general discussion” tab.

1 Like

For sure. It’s not the syntax that is hard part for NN to learn, but the semantics. I think an AI making games is possible, but until AGI, it’s gonna be some small pieces that AI creates, and human needs to supervise and make a choice what kind of combination would work as a game. So yeah, let’s just browse new posts :slight_smile:

2 Likes

Maybe not if you can layer AI’s that work at different levels, e.g. an Architectural AI, a Design AI, a Code Monkey AI, a QA AI?

Each would try and solve the problem with the patterns it knows then hand down to the next AI to fill in the details.

The thing is though to define a game well you would probably end up needing a syntax or notation that is bordering on a programming language or another layer to parse English into a design document?

e.g. Space Invaders

  • Player can move left and right along the bottom of the screen and fire one shot at a time.
  • Invaders stack up in a grid and move left to right descending when they hit the edge of the screen.
  • Invaders can randomly drop bombs.
  • Players shots destroy invaders and increase score.
  • Bombs destroy player and lose life, player has 3 lives.
  • 3 Shield blocks above the player are partially destroyed by bombs and shots.
  • If the player runs out of lives it’s game over.
  • If the player destroys all invaders another faster wave is generated starting at the top left.

Any game designer would be able to make a game similar to space invaders from this but how many vague or poorly defined elements can you find?

Size and resolution of screen, size of invaders, players, shots, bombs, sound effects, speed of elements, size of shields…

A good game design document should cover all of these, however could an AI system detect flaws and discrepancies that need clarification and how well will it deal with change and feature creep or working in a team?

1 Like

Can someone point Mr. Sterling to this thread as code flips are now officially a thing.

1 Like

People have been code flipping for as long as coding tutorials have been a thing :v

It is normally called code reuse, “not reinventing the wheel”, etc.

All those tasks are on AGI level. Basically, if you don’t have a workign prototype, there isn’t much to discuss - the tech is not here yet.

Yep, I like to think that about assets as well.

2 Likes

True. “Asset libraries” can be great.

Your post reminded me of one of the videos explaining how one scene in avengers (or something) was made. Those guys had object library with thousands of objects in it. Buses, cars, street signs, etc, all ready for plugging into their 3d software. Amazing stuff.

1 Like

Yep but that’s apparently illegal (illogically so). Apparently that’s just a flip and your title is worthless for it despite the fact all hollywood do it and nobody says a word.

Got to change IMO.

…Who said that? Jim?

I mean, disliking asset reuse is one thing, but if someone misinforms people on purpose and claims that something is illegal (while it is), that probably could be used as ground for a lawsuit.

I haven’t been able to check back for the past couple days. You all bring up really good points.

I would definitely have to agree to an extent. The learning model did not use any data to start. The AI simply was given the tools to write code and it learned through trial and error. Also, the code doesn’t necessarily have to be complex code. Just imagine, you click the ok google, or hey siri feature on your computer and go “write a script that makes this light turn off when I get to close to it.”

I mean at that point your just having the AI develop the whole game for you, but what if you narrowed down the ai’s intentions. For example, “write this shader for me and make it look like this hyper inefficient shader that looks beautiful, but make sure its efficient.”
Utilizing some visual shader scripters, which define what inputs are valid and aren’t valid, the AI would not have to test nearly as many cases.

I would consider this barely writing game code, but it does count.

Would an artificially intelligent script kiddie be more intelligent than an actual script kiddie? Now, what if that script kiddie was working on an AI script kiddie?

Turtles… turtles all the way down.

1 Like