More Ion cannon tweaking!

So I also spend a good portion of tonight messing with WordPress, but I did make a few tweaks to the ion cannon. It doesn’t spam out as much combat text, the damage is tweaked to be slightly higher than the spray gun.

I want to work a little on the story engine next and then a few modes for navigating through levels. Until then, I sleep!

WPF notify helper – C# 5.0

So after looking at the documentation on what’s new in C# 5.0, I read about the feature that you can get a function’s caller information that looks like the following.

public void DoProcessing()
    TraceMessage("Something happened.");
public void TraceMessage(string message,
        [CallerMemberName] string memberName = "",
        [CallerFilePath] string sourceFilePath = "",
        [CallerLineNumber] int sourceLineNumber = 0)
    Trace.WriteLine("message: " + message);
    Trace.WriteLine("member name: " + memberName);
    Trace.WriteLine("source file path: " + sourceFilePath);
    Trace.WriteLine("source line number: " + sourceLineNumber);

This snippet is stolen straight from msdn.

I also saw another example of where this would be used for WPF classes that implement INotifyPropertyChanged. The example looked liked the following

protected void RaisePropertyChanged([CallerMemberName] string memberName = "")

This actually reminded me of what I did in some of my WCF services to get the calling method name displayed when invoked, so that I could print out who called it(using WindowsIdentity) and what method they called. However, I accomplished it using the StackTrace class and StackFrame. So I quickly came with a way to get similar functionality until 5.0 is ready for my eager hands.

The result looks like the following

protected void RaisePropertyChanged()
    var frame = new StackTrace().GetFrame(1);
    string name = frame.GetMethod().Name.Substring(4);

So when you create your Bindable properties you could simplify code that would look like

public const straing ProgressValuePropertyName = "ProgressValue";
private double _progressValue;
public double ProgressValue
    get { return _progressValue; }
    set { _progressValue = value; RaisePropertyChanged(ProgressValuePropertyName); }


private double _progressValue;
public double ProgressValue
    get { return _progressValue; }
    set { _progressValue = value; RaisePropertyChanged(); }

So while this is a small step forward, it’s still nowhere nearly as clean as using PostSharp and AOP to look like

public double ProgressValue { get; set; }

Thinking about my brain dump right now, I’m going to play with the Roslyn services to see if that is going to generally offer the same capabilities as PostSharp.

Game scripting engine

So I’m starting to get back into the groove of coding my game and I’m at somewhat of a roadblock on how much I should make scriptable.

So for a brain dump, I’ll state what am I looking for right now?

Dialog sequencing
Entity administration(adding/removing/altering)
Triggering other sequences
I’m wanting at least these features so at any given level I can do the following.

Tell a story as the level begins
Add stuff to kill
Do something if you die
Do something when the boss dies
Perhaps this is too much and should be hard coded in the game for a unique kind of boss mob. Not sure, but I feel that’s restrictive. I’ll start with the goal of these things now using some sort of xml scripting syntax.

I thought about using Lua or JS, but I just can’t imagine that it would be easier using that than some fixed rule system. So homegrown ScriptML it is.

Suggestions welcome!

Enterprise Library Logger

After a monumental hiatus, I will provide this nerdy snippet and an update on my life.

Sadly, after writing a bit of code for my logging toolkit, I’m going to modify it from using Enterprise Library to Log4Net. Apparently there was some change in Enterprise Library 4.0 that does not make it directly backwards compatible with 3.1 and I can’t find the documentation for what makes it different.

All of a sudden my formatters no longer work and neither does the mailer. As a good friend of mine said. “It’s a freaking logger!” Why is it not backwards compatible? What kind of crazy magically awesome changes could they have made to make me want to update a vital library used in all my applications?
Thus, if I have to make a change, I’m moving to Log4Net. For anyone curious, I’ll be happy to keep a copy of my current logger with the Enterprise library implementation so that they can see the tragedy that it is. Change a reference library from the 3.1 EntLib Dlls to the 4.0 and formatting goes down the pooper.
As for my life in general. I’m engaged!!! So, the engagement didn’t go exactly how I planned it. There were several chaotic factors to disrupt my master plan and the proposal being on a certain date and actually being a surprise were high on my priority list. Regardless, I’m a little sad that it wasn’t some super magically awesome proposal at a swanky restaurant and all the things that I had in my mind came to fruition… Luckily, however, she said yes and I have our entire lives together to do sneaky little special things for her.
I now leave you with this awesomeness!

I Cried!!!


Ok seriously, I found this on youtube while searching for the evolution of dance. This has no programming food for the brain, but I cried from laughter while watching this video. OMG, I remember forcing myself to cry before too, and it is hilarious watching this guy do it. Drooling in the middle part of the video is icing on the cake.


Insanity can occur

And it did… sorry schnookums!!!

On a side note, I’m going to change my web hosting provider for Ninjacrab, it will still be but with a MUCH cheaper host for what I use Ninjacrab for. If I ever decide to go hardcore Microsoft web development, I’ll consider another host. Regardless, $118.80 for 3.5 years compared to $78 for 6 months is kind of a no brainer.

Get all old crap off of brinkster.
Put all old crap on WebHostingPad
Do Something nice for my Snuggly Bear

Data Access Layer

Welp, I’ve created what I consider to be a pretty framework for a data access layer and I’m pretty excited to put in all the bells and whistles on it.

Haha, on a miscellaneous note. I figured out that some DMG have easier installers and some are as obvious as the following.

Picture 1

A tad bit more user friendly, but there is still a bunch more to explore. More downsides, some applications require an external mouse with two buttons!!! Apparently Monodevelop doesn’t consider+ click a right click.

On a sad note… I learned more about this Mac… and found something that I can’t seem to erase. Why on earth did I look at it?