However, it is a software project, and there are of course many technical aspects, so I will add posts labeled "technical" every now and then when I feel there is something to be said. Warning: non-technical users may get lost in the technical posts!
So to start off, a little about the tools and development environment. I am currently using mono 1.2.3 on an Ubuntu Feisty (beta) laptop, with monodevelop 0.12 as the IDE. By the way, I think the teams involved in these projects (and related projects like Stetic, the UI designer embedded into monodevelop) are doing an awesome job. I can't wait for the debugger, however!
The application itself is a Gnome# application, so using Gtk# and Stetic for the UI. It's basically a one-window job at the moment. The graphic section uses a Gnome Canvas. I pondered (and am still pondering) the use of a GtkGLArea and rendering in 3D, but I might leave it until later. For now, simple is good.
I've decided to keep the application structure fairly simple and literal. I have talked to the kids about what 'class' and 'object' mean, and I want to back it up by being able to show them pieces of the code at times, and in particular pieces of the model classes (like 'Creature'). With too much abstraction and cleverness, they will not understand any of it. So I'm keeping it quite literal.
Time in the world is measured in real seconds. So the environment has a time, in seconds. And creature age is also measured in seconds. There are two timers. One clicks every second, and is responsible for non-visual updates (like digestion). The other is every tenth of a second, which is responsible for visual updates.
So far I have some model classes, as follows:
- 'Thing' is a base class for all things in the world. It implements behaviour such as placement and movement in the world.
- 'Creature' is derived from 'Thing', and implements the key properties of a creature in the world, such as energy, health, age, emotion etc. It's behaviour so far includes consuming food, "digestion" (food converted to energy over time) and death. Much of the work of the system is going to go into the behaviours of the creature.
- 'Food' is a simple class at this stage. A food object is given to a creature to consume. Each food object has amounts to contribute towards energy, health and happiness of the creature consuming it. The contributions can be negative. For example, a bowl of rice will contain alot of energy, but probably not much happiness. A lolly may have no energy, negative health but alot of happiness.
- 'ThingVisual' corresponds to 'Thing'. It doesn't implement much behaviour at present other than detecting if the underlying things' position has changed, and if so, changing the position of the CanvasGroup object that represents the thing on the canvas.
- 'CreatureVisual' corresponds to 'Creature'. It handles the visual behaviour of the creature, which at this point is displaying the appropriate image for the creature based on it's properties. The logic for selecting images is at present crude and hard-coded. It uses a CanvasPixbuf object to hold the image. The images are compiled as resources into the application.
The next two areas that need attention are:
- Selecting creatures and giving them instructions
- Movement of creatures, which includes handling the presence of other things (or creatures).
1 comment:
You are a very clever person!
Post a Comment