Code that creates new code everytime it is run

Discussion in 'Game Development (Technical)' started by Davaris, Mar 24, 2011.

  1. Davaris

    Original Member

    Joined:
    Sep 29, 2004
    Messages:
    767
    Likes Received:
    0
    For the past few days I have been writing code that generates other code and so I was wondering, if they have tried this AI, what is it called, or what is its closest equivalent?

    I am thinking in terms of a program that can change any part of itself and be recompiled each generation and even the part that determines what is a good result, can be changed.
     
    #1 Davaris, Mar 24, 2011
    Last edited: Mar 24, 2011
  2. HairyTroll

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    582
    Likes Received:
    0
  3. Michael Flad

    Indie Author

    Joined:
    Aug 4, 2004
    Messages:
    190
    Likes Received:
    0
    It's called self modifying code.
     
  4. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
    Yep, self modifying code; did quite a bit of that, back in the olden days. Really just to get things running faster on slower CPUs.

    Seems to be a different application than what you have in mind though, which sounds to me, something like evolution. Making little random tiny changes, and seeing how each adaptation performs, if good, keep it, rinse and repeat.
     
  5. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    I can out hax0r that. On an old arcade board I used to program, we were decompressing code right in front of where the current PC is (well, was) in an interupt on the fly.

    Verterans like us usually look back on those days with some amount of positive nostalgia. Me, I'm glad they're gone and good riddance. :)
     
  6. Davaris

    Original Member

    Joined:
    Sep 29, 2004
    Messages:
    767
    Likes Received:
    0
    Thanks everyone.
     
  7. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,390
    Likes Received:
    12
    When programming the Apple II in double hi-res I had an unrolled loop of code that would put a byte into each scanline indexed into the sprite and screen with the x & y registers. I would modify my code to jump to where a sprite would begin on the screen, write in an RTS where the loop needed to end and with that I don't think it was possible to write a faster blitter on that 1 Mhz machine.

    Paul, I'm still nostalgic for those days but I will grant that it's pretty magical to be able to play a game while in my rocking chair, in my living room in the browser when that game is streaming off my website.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer