It's been a while since I last updated... things are hopefully progressing well. Unfortunately I've got to get on a train in a few hours to return to my old stomping grounds and goi to a friend's wedding. So I'll be taking a painfully slow ancient laptop to keep me amused on the train and hopefully get some more work done.
The current status of the main menu - it loads a tiny little map and puts a handful of zombies and humans in to do something interesting.
I've got placeholders for all the animations now, but hopefully I'll be able to knock them together over the next couple of days.
One way of making this more of a 'game' is to have 'missions' - basically a map with objectives. This also allows for a kind of tutorial for introducing gameplay concepts - locating humans, bashing down doors, communication between zombies via a series of moans... and so on. Probably with some method of scoring, to provide incentive to further tweak your programming.
Also added a debug mode that shows the world in a top-down view, and a preview pane on the left to allow a more detailed view into the inner workings of your zombie. Still needs a lot of work, though. Even the fonts are randomly still half-placeholders!
Can you talk about how we'll program zombies? Using C#, or some simple embedded script-like language?
Because it is the simplest option, zombies will be prgrammed in C#. You basically extend a class in a provided framework, and override a few event methods. You then construct 'action' objects and add them to a queue, and use a 'senses' collection to sense the world around you.
Here is an example of one of the most basic zombies I've got at the moment - it moves around randomly until it spots a human, in which case it moves towards it and attacks.
There are still a few more things that need polishing (and I'll have to write some real documentation, too)
using System;
using System.Collections.Generic;
using System.Text;
using TEA.Morbid.Framework;
using TEA.Morbid.Framework.Actions;
using TEA.Morbid.Framework.Senses;
namespace TEA.Morbid.Examples {
/// <summary>
/// You common-or-garden zombie. Shambles around, eats brains. None too bright
/// </summary>
[Author( "Matthew Longworth" )]
[TeamName( "BrainDead" )]
public class BasicZombie : Zombie {
int makeRandomTurn = 0;
public override void Idle() {
// Can we see any humans? Find the closest one and chase it, if possible!
List<Sense> edibleHumans = Senses.FindAll( FindTastyHumans );
// If we see a human...
if( edibleHumans.Count > 0 ) {
// Find the closest one and chase him
edibleHumans.Sort( SortClosest );
// If he is really close, ATTACK
if( Position.DistanceTo( edibleHumans[0] ) < 4.5 ) {
ActionCollection.Add( new Attack() );
} else {
ActionCollection.Add( new Move( Position.HeadingTo( edibleHumans[0] ), 10 ) );
}
} else {
// Randomly turn every now and again
if( makeRandomTurn > 20 ) {
ActionCollection.Add( new Move( Heading.Random, 50 ) );
makeRandomTurn = 0;
} else {
ActionCollection.Add( new Move( 50 ) );
makeRandomTurn++;
}
}
}
// Generic list search predicate - find only humans
public bool FindTastyHumans( Sense bert ) {
return bert.SensedThing == SensedThingType.Human;
}
// Generic list sort predicate - find the closest
public int SortClosest( Sense thisSensedObject, Sense otherSensedObject ) {
return Position.DistanceTo( thisSensedObject ).CompareTo( Position.DistanceTo( otherSensedObject ) );
}
}
}
Well, it's time to get ready to leave now. Hopefully I'll be able to get _some_ work done over the weekend. At least the deadline is midnight PST, which gives me even more time on Monday to get everything together.
So much more to to!