Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » Mutating Programs

This thread is locked; no one can reply to it. rss feed Print
Mutating Programs
X-G
Member #856
December 2000
avatar

Operating system? That's nothing. ;)

You're going to have to implement the entire processor. :)

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

gnolam
Member #2,030
March 2002
avatar

X-G: and do all the logic circuits with FPGAs ;)

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Kanzure
Member #3,669
July 2003
avatar

Yes, they were thinking of also there own byte code language....AHHHHH runs into a brick wall

X-G
Member #856
December 2000
avatar

Kanzure: You realize, of course, that that is what a VM is? :P

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Billybob
Member #3,136
January 2003

Ahhh, a fresh morning with a fresh cup of Progranisms.

spellcaster, yes, I do realize the risk, but we all have to take risks some time, eh? So far the computer has suffered nothing but some minor harddrive glitches. Now adays the computer is being used as just a plain computer, not a lab computer, and I didn't have to reinstall windows are anything. Now, just cause it hasn't happened yet, doesn't mean it wont happen, I know that. Last night Kanzure, or maybe someone else, was running them and I freaked out and made sure he knew that they we dangerous.

Anywho, I'm not doing anymore pure computer tests, like is being mentioned, we are thinking about making a VM for the thing to play on :)

grabs gun Ok Computer, do you feel lucky?

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

When I read his post I though, ok, I'll shut up and won't flame him. In fact I thought Korval or 23 would do that for me.

I'm purposely staying out of this :) The parallels are too close to Darwinian Evolutionary Theory (hell, X-G already mentioned it) and putting me near that is a flamewar waiting to happen ;) Needless to say, this isn't going to work unless you lay down strict rules about how it can "mutate" and (as you say) run it in a VM, etc. Of course, in the process you support ID, not ToE ;) ... anyway, yeah. I'm not following well enough to know exactly what you guys are doing, but maybe you'll ultimately end up with some interesting results. In the meanwhile, I won't care, but hey, knock yourselves out :) It would be interesting if someone could make a simple little game with AI that learns to outsmart you as you play ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Billybob
Member #3,136
January 2003

Ok yea, nobody dare say anything about evolution are this thread will really sky rocket. Anywho, I don't like rules in games, never have. I've always been a Free-Will designer for some odd reason, maybe cause it makes betters games, games where you aren't restricted. But, as such, I never coded rules into the Progranisms, because in real life, there really aren't that many rules that HAVE to be followed, there's rules that should be followed, but you don't HAVE to.

Yea, a quick game like that would be cool >8) We need a game where the player is killing hundreds upon hundreds of enemies, hehe.

CGamesPlay
Member #2,559
July 2002
avatar

Well, for some VM nodes, how about these:

  • If: If on node returns true, another is executed, otherwise a third.

  • Compound: one statement gets executed, then the other. The most common type of node.

  • Move: Moves the whole script in the global script's memory space. Things can overlap, causing the script to merge.

  • Mutate: Randomly reconstruct part of the program using a random tree.

  • Transpose: Randomly switches two tree branches.

  • Putpixel: Places a pixel of a determined color on the screen at a position representing the script.

Anything else that might simulate what biological organisms running inside a VM should be able to do to themselveS? Remeber, we are NOT talking classical life, so yes, organisms should be able to randomly mutate themselves.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Billybob
Member #3,136
January 2003

shrugs

X-G
Member #856
December 2000
avatar

I would just implement basic simple opcodes within a certain memory space.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Carrus85
Member #2,633
August 2002
avatar

Ok, CGames, here are some clafifications:

1) The reason the file closes on error, is I'm simulating a 'replication error'. Essentially, if there is a file name collision, just don't write anything...

2) I was just wondering why my code generates seg faults, that is all...

Could anyone help me, please?

And about the VM... We most definately need a VM! It is way to risky to just plug all of this sutff into your machine... You could very easily wipe your hard disk, flood your network with packets, heck... You could do all sorts of wierd junk...

CGamesPlay
Member #2,559
July 2002
avatar

X-G: Simple opcde might not be optimal... It depends on wether you want to picture the programs as living strings of bytes, or as working programs that evolve.

Your choice, but I think I'd need some help deciding what opcodes to use in the former case.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Billybob
Member #3,136
January 2003

We'll do both? Experiment, see which methods come out best.

axilmar
Member #1,204
April 2001

Oh, that's why as of previous week my computer keeps crashing (svchost shutdown, RPC shutdown!!! why? it did not do this before).

Why are you doing this with executables? do it like the game of life, inside a program, simulating.

redMarvin
Member #3,714
July 2003
avatar

I started reading this thread, thought "cool"
and continued to read.

Now I have an Idea for a very simple
VM/evolution simulation though
I'm not as good a programmer as I want to be:

first: the "play area" is an allegro bitmap
in memory.
There's an "instruction pointer" (x,y) who
points to the pixel wich is the "statement"
or whatever wich is to be executed
and the pixel color is some op code value

255=cmp (compare pixels)
105=and (and pixels)
104=mov (set pixel colour)
054=jmp ("execute" another pixel)

...I hope you get the Idea...

Now the pixel right of the current op code pixel
is the first parameter next pixel=next parameter
then the program only has to read as many
parameters it needs...

Now I know that this will be only one program
and not some sort of breeding between programs
but I think I will give it a try...

Then of course theprogram will display the bitmap
on screen...

<code>cout<<"red_Marvin";</code>

Billybob
Member #3,136
January 2003

I bit confusing but I think I get ya....like basically your saying use bitmaps to store byte-code data, so you can visualize a program's code? heh, that would be cool to watch the Progranisms mutate and see the differences easily.

LSd016
Member #3,561
May 2003

Is there a way to prevent the "program crashed" dialog from showing up?

____________________________________________
[update soon]

Billybob
Member #3,136
January 2003

Under what? With the progranisms? With progranisms, no, under any other non-mutating program, yea, sort. Inclose all the code in exception handlers.

EDIT:
!WOOT! I found it. I found my Shadow I emulator and the documents I wrote. Now I got to grab a hex editor and start making sure the thing stuff works.

damage
Member #3,438
April 2003

Hmm, unlike spellcaster I don't think this is dangerous but I do think that it's highly unlikely to work. So far there's been no real evidence.

But enough kvetching, here are some suggestions.

1. Don't use a VM. Speed is essential. Instead, create a program that will "fix" a given binary by disassembling it, checking that the opcodes are correct, then reassembling. Bad opcodes can be replaced by nops (0x90). Also, you can remove high-valued immediate operands as they are probably useful in these small proganisms.

With this you could also disable potentially dangerous things like interrupt calls. I've done a similar thing in the past (lost the code now, sorry), and it was surprisingly easy if you work from the opcode tables in the IASDM manuals.

2. During evolution, don't copy progranisms to the hard drive. Keep everything in memory for speed. You can make occasional backups of course.

3. Reduce the size of the progranisms as much as possible and write obvious code yourself for the progranisms to use. Don't leave obvious things for the progranisms to evolve; every new thing that they have to evolve will slow things down by a factor - evolution is trial and error.

4. Try to make a simulation, game or some kind of display so we can actually see evolution happening. For example, some guy evolved some CoreWar warriors once as part of a thesis on evolutionary algorithms. The evolved warriors were close to simple human designs, which was impressive.

5. Create a virus which runs the evolution program as a distributed app. That way you can harness the powers of thousands of computers for evolution. ;D

____
Don't have anything private. Don't do anything silly like having a hidden name and address field with get_name and set_address and get_name and set_name functions. - Bjarne Stroustrop, creator of C++

Carrus85
Member #2,633
August 2002
avatar

Or better yet, create a virus that evolves after every replication, so it is a pain in the rear to protect your system from it.... I'm dumb!!

Billybob
Member #3,136
January 2003

That's be funny.

"CNN has confirmed a new type of computer virus known as Progranism. This new type of virus is expected to be unstopable as its ability to mutate prevents virus scanner detect."

:) Anywho, naw.

EDIT:
oops, forgot to ask stuff:
damage, how would you keep the Progranisms in memory? What was that word, Terminate and stay Resident..or somethin like that, is that what you mean? Cause if so, I've never done something like that and you'll have to teach me :) As for disabling stuff: The only problem is that you'd also disable file writing, no? And you'd disable everything USEFUL the Progranism would want, you disable all that, all the progranism can do is preform calculations that we WONT see, I'm dumb!, which defeats the entire purpose.

Also, if I run the Progranisms under a non-admin account under WinXP, isn't that protected? I don't think WinXp would let it do anything if it's under a non-admin account.

piccolo
Member #3,163
January 2003
avatar

try putting it in to a stack the stack register is always in memory just pop the code that is needed

wow
-------------------------------
i am who you are not am i

Billybob
Member #3,136
January 2003

You can't run the stack and the stack is too small?? heh. BTW, I've got a very nice Assembler working that I'm using to generate test code for my Shadow I emulator. So far so good...

Evert
Member #794
November 2000
avatar

Quote:

Hmm, unlike spellcaster I don't think this is dangerous

Think again. It may not be too bad in a secure operating system, such as WXP or Linux (though it's always possible that a program accidentally exploits a security hole and gains root acces), but it's still a dangerous, if not foolish idea in general.

About ten years ago, I decided it'd be cool to learn how to call interrupt services, so I wrote a BAsIC program that called a number of them in sequence to see what they did (I'm not kidding! I really was that stupid). Fortunately, I managed to knock out the DOS kernel before I formatted my harddrive. It was funny in a pathetic sort of way because Windows continued to run, but couldn't get disk access anymore. The computer was fine when I rebooted, but it did scare the freezing hell out of me.

Quote:

"CNN has confirmed a new type of computer virus known as Progranism. This new type of virus is expected to be unstopable as its ability to mutate prevents virus scanner detect."

In which case they're out of date. Self-modifying viruses used to exist back when a virus was more than a VB script running in Outlook. I don't think they were very effective though...

redMarvin
Member #3,714
July 2003
avatar

<quote>I bit confusing but I think I get ya....like basically your saying use bitmaps to store byte-code data, so you can visualize a program's code? heh, that would be cool to watch the Progranisms mutate and see the differences easily.<quote>

yeah that sounds like what I meant...
...but the hour was to late for my brain and
english is not my mother tounge:)...

Well, I made an attempt today but it didn't seem
to work as I wanted, something with the srand(time(NULL))
and rand()%max
Well I might try again.
What system do you recommend to test a "!VM"
progranism on? and how can I be sure it won't
mess up my BIOS?

<code>cout<<"red_Marvin";</code>



Go to: