The Chaos Project (working title)

Posted by Powerful Kyurem on Dec. 28, 2013, 1:13 a.m.

So, for the past few days, I have been attempting to literally create chaos in Game Maker.

So what is chaos exactly?

Well, it is a program with one object that randomizes a string and then, if it is valid, executes it.

Sounds simple right? Why do it?

Well, it isn't simple, first of all. There are over 1,000,000 possible permutations, and over half of them are invalid!

So why do this? Well, because it is interesting. What would happen in a chaotic state. There is essentially an equal chance for anything to occur (assuming GM can do it). What would happen? It might make an awesome video game level, AI, weird visual effects, nothing, or (if you ran it in GM Pro that allows external file editing) a virus. The results are limitless.

Currently the 'debugger' uses me to check it. I simply click yes or no on whether it is valid, and it records my answer (granted it resets every time I run it).

I have recently considered having two types of random generated code to limit wasteful combinations:

1. Creating another object.

2. Setting another object's event code to a ligit GML String.

This would limit combinations that do nothing, and would probably increase the amount of chaos in the simulation.

Comments

Cesque 10 years, 10 months ago

Also, I found this. Not as cool as it sounds…

Toast 10 years, 10 months ago

Quote:
any examples of that in gaming? I'd love to see two AI have evolving behavior patterns in some evolutionary gladiatorial combat thing.
No idea, apart from games like chess as Cesque says.

It would be sort of interesting to use something like a genetic algorithm to generate a simple AI script (with simple commands like "move forward", "if see player then shoot", "if player shoots then sidestep", etc) and then train the AI by playing against it. It would take thousands, if not millions of iterations in order to get anywhere. So in reality you might as well just make the script yourself and use your own intuition to improve the AI on each iteration.

panzercretin 10 years, 10 months ago

Quote:
and then train the AI by playing against another AI

problem solved (or at least mitigated)

Then again, I'm talking less about making super-adaptive AI for a single-player game, and more about some spectacular zero-player gladiator arena with participants fighting each other in increasingly complex manners as they evolve to fight each other.

Toast 10 years, 10 months ago

It takes a lot longer since no one in the game knows what they're doing. They're also inherently exploitative because they don't give a fuck about playing fairly. But since you don't have to play… fair point.

Powerful Kyurem 10 years, 10 months ago

Well, I would make a debugger; however, I haven't quite figured that out yet. As for infinite permeantations… There are not. There are exactly 256^51 - 1 right now.

Toast 10 years, 10 months ago

Guys it's not infinite it's just more than a googol

Astryl 10 years, 10 months ago

Quote:
There is essentially an equal chance for anything to occur (assuming GM can do it).
Quote:
Well, it is a program with one object that randomizes a string and then, if it is valid, executes it.
Randomness is not necessarily random, as there is a high degree of deterministic behavior involved in the so called 'random' function.

Quote:
Well, it isn't simple, first of all. There are over 1,000,000 possible permeantations, and over half of them are invalid!
Quote:
There are exactly 256^51 - 1 right now.
256^51-1 is exactly 661055968790248598951915308032771039828404682964281219284648795274405791236311345825189210439715284847591212025023358304255. And in terms of permutations, that may as well be infinite. Assuming you didn't just smoke your numbers (And equation for determining possible combinations) out of nowhere.

Some problems that result in trying to create a random code generator include generating valid program structure and syntax. The chances of developing a program that would do anything at all, even in GML, is very low.

You'd be better off compiling a database of existing interesting code and using various algorithms to chain pieces of the code together. Markov chains are the first obvious choice, but you could also try using a few interesting algorithms with the data; base selection of code on fractals, for instance.

EDIT: Also damn you both Panzer and Cesque… I'm supposed to be taking a break too >:{

Toast 10 years, 10 months ago

I've been trying to get this monkey to type the entire works of Shakespeare for ages.

Cesque 10 years, 10 months ago

Quote:
Then again, I'm talking less about making super-adaptive AI for a single-player game, and more about some spectacular zero-player gladiator arena with participants fighting each other in increasingly complex manners as they evolve to fight each other.

I can kind of envision a machine-learning AI for a game like Toribash (a turn-based fighting game), training on a database of replays (updated with its own fights) to determine the optimal move for any situation…

If e-sports stay popular, someone somewhere may eventually try to create a Deep Blue equivalent for StarCraft or League of Legends one day. Perhaps it would even learn to strategically call the opponent a noob faggot if it determines this increases the chances of winning.

Edit: Well fuck me, look what I found.

Edit 2: Also, all papers published in proceedings of this conference may be relevant ("Table of contents" for every year's conference proceedings has direct links).

Edit 3: Aaand there's a Bayesian AI applied to StarCraft, too. Heh.

Powerful Kyurem 10 years, 10 months ago

Mega: 44 digits isn't that bad. However, this isn't an experiment to make something interesting, its to see what would happen with chaos. I can your point though. That is a lot of combinations; however, if I make multiple objects executing random code, then the chance of actual GML will go up. Also, I can determine that making a code checker is possible, since the GM Debugger flags incorrect code. If it didn't, Chaos would have easily fried my pc. Then again, almost /any/ incorrect GML could fry your pc if there was no bugger!

EDIT: Oh, there are more digits. I didn't know this thing scrolls sideways. That is weird.