Wednesday, 17 November 2010

Developer Journal 9

I cleaned up a lot of code yesterday.

I'm moving towards a model where I create an entity such as food and agents and then add them to components in the system such as graphics, physics, audio and spatial data structures. The original model had code such as graphics and physics within entities.

I fixed a bug that occurred when I was removing food. I had a loop that goes through a list of pointers to food and adds any food that needs removing to a second list. Then I had a loop that removed food from the second list. However, I was removing food using a pointer that I initialized in the first loop.

Today I'm planning to move code from a Qt class into my graphics component, fix up the way entity creation works, check over my list of things I wanted to do and proceed with integrating the Ogre graphics engine.

I've been thinking about how to make the work more interesting and the thing that I really want to see is better graphics and limbs on my agents instead of blocks.

I left the simulation running overnight and the population is still going strong. That is a huge relief because I was worried I had broken something subtle.

The other thing I want to see is the population persisting even with smaller groups so I can see things happen in real time. The system runs at near real time with 128 agents and begins to slow down after that. The problem is that the population needs that many to get off the ground. I may need to implement an upper limit or other ways to slow down reproduction once agents start adapting to the environment.

I've been wanting to release builds regularly to what end I'm not sure but I wanted to get the Ogre graphics engine in place and also to sort out any licensing issues. My last deadline for releasing a build was 1/11/10 so I'm a little late.


  1. Regarding limbs instead of blocks, I think you are absolutely on the right path.

    What are your thoughts on using something like Euphoria by NaturalMotion?

  2. Hi Anonymous,

    Using Euphoria by NaturalMotion would be great. They already have limbs with skeletons and muscle like structures. It would mean a lot less work on my part because I could then focus on attaching a Hebbian neural network to process sensor inputs and control the limbs.

  3. One of the things I'm dreading of working with is joints with constraints.

  4. The difference with my work and Euphoria is that they use a fitness function to develop their neural network.

    In my work, my agents develop their neural networks based on the idea that connections that are more active become stronger and vice versa. The agents that stick around are those that have been able to adapt to an environment, find food, mate, etc.

  5. Yah, of course, their AI would need to be cut out. I was just thinking that the musculoskeletal animation/physics system could be co-opted and hooked up to the hebbian neural network. It seems like that would be a much more accurate way to base motion on neural outputs.

  6. That would be ideal. Their simulation system, combined with vision, sound and tactile sensors in an environment that is open to exploration...