Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411413 Posts in 69360 Topics- by 58415 Members - Latest Member: sophi_26

April 16, 2024, 12:36:22 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityJams & EventsCompetitionsOld CompetitionsVGNGMorbid Programming of the Dead [WITHDRAWN]
Pages: 1 [2]
Print
Author Topic: Morbid Programming of the Dead [WITHDRAWN]  (Read 9855 times)
Izzimach
Level 0
***


Immersed in Phlogiston


View Profile WWW
« Reply #20 on: March 15, 2008, 08:59:20 PM »


Who let in the Zombies?  I've told you a thousand times...

Can you talk about how we'll program zombies?  Using C#, or some simple embedded script-like language?
Logged

deadeye
First Manbaby Home
Level 10
*



View Profile
« Reply #21 on: March 15, 2008, 10:00:39 PM »

Can you talk about how we'll program zombies?  Using C#, or some simple embedded script-like language?

Duh, everyone knows zombies only understand BASIC.
Logged

tweet tweet @j_younger
Matthew Longworth
Level 0
**

This will require EFFORT


View Profile
« Reply #22 on: March 21, 2008, 02:45:21 AM »

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)

Code:
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!
Logged
Mr. Yes
Level 5
*****



View Profile WWW
« Reply #23 on: March 21, 2008, 04:03:05 AM »

Kiss

I think I'll learn C# just for this.
Logged

Golds
Loves Juno
Level 10
*


Juno sucks


View Profile WWW
« Reply #24 on: March 21, 2008, 04:27:55 AM »

I totally love this concept, and it looks like it could be fun too.  Looking forward to trying this out... although not looking forward to figuring out C#  Shocked
Logged

@doomlaser, mark johns
Matthew Longworth
Level 0
**

This will require EFFORT


View Profile
« Reply #25 on: March 24, 2008, 05:36:06 AM »

Unfortunately I won't have time to finish this before the deadline.  I'm pretty sure I could rush something together, but it will almost certainly be boring and full of bugs.

Perhaps my initial design was a bit too... ambitious.

This competition has been completely awesome, and I'm glad I have it a shot.  All the other games here look amazing and I'm really looking forwards to playing them. 

I'm not abandoning it, though - the work I've done will certainly not go to waste.  Even if I'm going to miss the deadline, I'm going to finish this dammit!  No more half-finished projects for me.
Logged
C418
Level 3
***


View Profile WWW
« Reply #26 on: March 24, 2008, 06:54:15 AM »

I wish we could skip the deadline for a... week or so.
Logged

Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic