• About
  • Gallery of Images
  • Archives
  • Categories
  •   Evolutionary Algorithms and Unity3d – part 1

    31/07/12 - 19:59

    Recently, one far too hot night in the rather brief English summer I played with the idea of implementing an evolutionary algorithm within Unity3d. Why? I hear you cry. Because I wanted to, I calmly reply. So dusting off the Unity documentation for get Texture2D.GetPixels() and Texture2D.SetPixels() I got to work.

    My first stumbling block was that nothing worked. Let this be a lesson to all, read the documentation fully :) When importing textures to Unity ( one that you want to fiddle with by using Get/SetPixels ) – you must have Read/Write texture set to true. I’m including a picture, just to remind myself to read documentation when you get stuck on a silly bug :)


    Once I had that ticked, everything started to fall into place nicely. But, for those who have no idea what an evolutionary algorithm is, let me explain. Let’s say you have a problem. And you want a solution. You create a random selection of solutions, breed the best solutions together and then try, try again. Hmmm, it probably needs a bit more explaining than that.

    I think a more detailed example is needed, so let’s make a new blog post explaining what an evolutionary algorithm is … ( only because I think it has the most interesting opening sentance of any blog post I’ve written! )



    Your Reply