Category: Uncategorized

Some of you are probably wondering where I went. I’m still alive, I think, but december was busy on the real world.
I did advance a little on Maped (just here on my local copy), fixing the tile import system, to be able to import images as maps (even multilayer ones), and preventing tile duplicates.
On Aftershave, I just did a lot of thinking again. As I said earlier I was getting nowhere, so as a new year resolution, I’m going to complete Aftershave as it was originally intender, two and a half years ago, as a small (four dungeon and almost no story) Zelda clone.

And also! I completely failed trying to M something. This is as far as I got (two working menu screens)

About the title: I’ll be gone for January doing an intership on a hydroelectric power plant far from home, and with no computer near me. I’ll resume work (this time for real) on Feb.

Seeya, guys.

Just a little idea sharing. For a little Verge-related experiment I’ve been doing (and losing due to crashes) this last couple of days, I decided I needed to implement a state machine validating system.
Well… Tada!! Somehow ready, in C# (I just need to add a delegate to do something when entering the state, but that’s a kinda special case.

And with C# 3.0 lambda expressions, this should be a to use. So, this should also work quite easily in Python, now that I think of it.

    //A nice state machine generic validator in C#
     public class State<T>
    {
        protected LinkedList<KeyValuePair<Predicate<T>, State<T>>> transitions { get; set; }
 
        public State()
        {
            this.transitions = new LinkedList<KeyValuePair<Predicate<T>, State<T>>>();
        }
 
        protected virtual State<T> GetTransition(T t)
        {
            foreach (KeyValuePair<Predicate<T>, State<T>> trans in transitions)
            {
                if (trans.Key(t))
                    return trans.Value;
            }
 
            return null;
 
        }
 
        public virtual void AddTransition(Predicate<T> condition, State<T> state)
        {
            transitions.AddLast(new KeyValuePair<Predicate<T>, State<T>>(condition, state));
        }
 
        public bool Process(IEnumerator<T> it)
        {
            State<T> current = this;
            while (it.MoveNext())
            {
                current = current.GetTransition(it.Current);
                if (current is FinalState<T>)
                    return true;                
            }
 
            return false;
        }
    }
 
    public sealed class FinalState<T> : State<T>
    {
        public FinalState()
        {
            this.transitions = null;
        }
 
        public override void AddTransition(Predicate<T> cond, State<T> s)
        {
            throw new NotSupportedException("A final state cannot have transitions");
        }
 
        protected override State<T> GetTransition(T t)
        {
            throw new NotSupportedException("A final state cannot have transitions");
        }
 
    }

No, I’m not running from Gruedorf, I just implemented a basic resource manager. For now it just’s loads files form specified folders, to have a packing system for the engine in the future, and ordered the scripting system a little lot. You can get the build, but probably there aren’t visible changes.

I also played around on making other entities using the scripting system, but I’m not too confident about that so nothing for now.

As the builds don’t change much, I decided that it’s better if you get them from the SVN.
Also, you can check the code if you want. Please be gentle on the bandwidth, it’s kinda low.

Builds: svn://belcrant.endofinternet.net/aftershave/aftershave/builds
Code: svn://belcrant.endofinternet.net/aftershave/aftershave/trunk

(user: anonymous / pass: anonymous)

I just now have recovered all the internets I had lost because of the electric storms happening last week in this tiny piece of land called Chile.

So, I’ll try to sort the things out this weekend, but for now, lameness :D

As I thought, my free time was around zero this week just did some cleanup on the code, commenting, etc.

I’ve been thinking what would be the best way of implementing  the scripts. There should be at least map scripting, as harcoding them would be hell and mostly impractical. The problem I’ve facen is how integrate it with the game, and how to define the scripting API. I’ll just have to keep thinking.