It has been far too long since I’ve blogged. I suppose it’s largely because the vast majority of my work time these days is spent actually working, and what little remains is basically just keeping up with the news. I don’t normally blog from home, since Missy and the kids are extremely distracting. Sometimes I think about it, but there’s just always something to be done, something that I could be doing, or I’m just hanging out and fucking about on EVE or whatever. I do wish that I weren’t so fucking lazy about blogging, and I’d like to post more, but it just feels so… blah sometimes. The only people that read this site, so far as I’m aware, are Ryan and Missy. I know that Ryan keeps up on the news, and I spend virtually all of my free time with Missy, so both are kept pretty well apprised of how I feel about a given thing on a given day. Bah. Writing that just made me think of how much easier it’d be to write $thing and $day, but that’s Ryan’s thing. I’m not stealing it, and I don’t write Perl besides. It feels off.
Anyhow, the damned Warhammer project has fallen well behind schedule. This pisses me off, to be honest, because I started the thing back in June when Ryan came to visit and planned to complete it during downtime at work. I’ve not had much of that recently. I think I’ll have more time now that the great post-summer code rush is just about finished, but it’s extremely hard to say. The company is busily in the process of reinventing the wheel. Well, I shouldn’t say that. They’re using several wheels as a prototype and trying to make some sort of all-inclusive superwheel that will replace them all. But the old ones are still there, and likely will be for awhile. It’s grand, and a perfect example of overreach. I don’t particularly care for the old systems, and I don’t want to give the impression that I do. They’re total shit, originally written in Classic ASP and now entirely made up of a collection of hacks and bandaids. They need to be rewritten. I just don’t think that trying to do it all at once is a good idea. It does avoid interoperability issues with the old systems. The new system is plagued with those same sorts of issues, is nearly six months behind schedule, already cost a fortune for new quad core servers, and just plain fucking sucks. There are three independently operating small development teams working on different segments of the new POS system. There is no oversight. There is no collaboration. Occasionally our resident project architect will completely rewrite a component to make it compliant with the other components, but whatever changes are made invariably end up being hacked within three weeks or so to include the same fucking problems that were present before the rewrite. In short, it’s retarded.
Add that to the current economic holocaust and an ongoing Presidential campaign and… well, I’m very much occupied for the most part. It does help that those two things dovetail nicely in the form of the McCain campaign, since his campaign manager is a sleazy piece of shit who was taking $15,000 a month from Freddie Mac as recently as last month. McCain, of course, denied that his manager was doing anything. Of course, it turns out that he actually was doing nothing. Supposedly. I don’t know that any business at all has the bad sense to pay someone that kind of money every month for doing nothing, no matter how well connected they may be with the Republican Party, but I’ve been shocked by this sort of thing before. It’s just… argh. McCain knows nothing about nothing. Wait, wasn’t that a term used for a xenophobic political party in this country about 150 years ago? Oh, that’s right. Except that those guys actually had a platform that didn’t involve holding a séance with the ghost of Ronald Reagan. Since, you know, that guy knew what the fuck he was talking about economically. I’m not even going to discuss Sarah Palin here. She’s an absolute joke. Rich white trash, if such a thing is possible. The supposed “Hillary Republicans” love her to death, basically because she has a vagina, but I can’t understand those people. I can only imagine that most of them are holdovers from the great social movements of the 60’s who never quite caught on to the fact that a powerful woman can nonetheless be an enemy to feminists. Margaret Thatcher should have been the first sign. But the belief borders on the religious, and there’s really no arguing with the people that believe these things. I’ll be happy to see her lose and, hopefully, get impeached in Alaska for any one of her (seeming) dozens of scandals and missteps.
On the upside, the kids are doing very well. Anya has adjusted completely to being in kindergarten now. She behaves well at school, goes to bed at a reasonable time, wakes up at 8:00 AM even on the weekends, and seems very happy in general that things have changed. I never did think that I’d see Anya happy to wake up early-ish in the morning or to go to bed early-ish in the evening, but the fact remains that she is. I suppose it’s a good thing. Alex is… well, Alex. He spends a lot of his time sleeping while Anya’s at school, since it seems as though he gets really bored without someone to boss him around. He should pose no trouble at all once he starts kindergarten. He basically does whatever he’s told to do anyway (exception: cleaning messes that he’s made), and is capable of entertaining himself quietly for long periods of time. I suppose when I say that I should qualify the statement and say “is capable of watching TV quietly for long periods of time”. He absolutely loves the television. He doesn’t want to play with me or Missy while he’s watching it. Hell, he didn’t even want to spend time with Karen while she was recently in town on some days because he was watching TV. Inasmuch as I hate the television and probably spend two hours a week watching the thing, the kids’ love for TV makes up for what I don’t watch. It’s ridiculous. But at least they’re not watching PBS Kids’ “Sprout” anymore. That channel is fucking abysmal. You’d think that PBS would show Sesame Street, Mr Rogers’ Neighbourhood, and the like, but they just don’t. The shows are fucking stupid and are the opposite of educational. Good riddance to that network in my house.
Ah… and the Warhammer project again. Ryan has said that he’s going to write an XSLT for it, which I had been meaning to do, in order to convert ArmyBuilder’s funky tree and node quasi-XML into actual SOAP-standard serializable XML. I do agree with him that SOAP is basically a hack that hijacks HTTP for something other than its indended purpose, but it’s plainly the easiest method for running a distributed application without making a fuckton of remote database transactions. I don’t particularly care for those. Additionally, SOAP really helps debugging by allowing me to look at exactly what the application is sending to the server, and what the server response is, without running an SQL profiler or the like. Those tools are fine, but they’re real-time. Since I’m not planning on having an audit table for this Warhammer application (how fucking stupid would that be), XML files will provide me with a record of what’s gone on during a given turn or whatnot. This should be exceptionally useful for “recording” battles for later review and shit like that. Should I ever make the decision to build that kind of functionality into the application, that is.I really need to get working on the thing again. I kind of stalled last time I worked on it trying to figure out in an abstract fashion which models were in base-to-base with each other but, the more I think about it, the more I think that I should just calculate it from the GUI while the app is running. I don’t actually care for that solution, just in case the differing clients running on players’ PCs don’t agree about how the battlefield looks and I’d rather calculate it on the server, but I just don’t see a way to make the method work without making the thing 1,000 lines long. I’m not making a class-length method. Not for this. It will be somewhat necessary to make extremely long methods for data transactions, since there will probably be 20-odd parameters being passed in the course of normal operation, so I suppose I should clarify. I am not making a method that calculates this sort of thing 1,000 lines long. It doesn’t make any sense and I don’t think I’d ever be able to optimize the method. Also, it would be far too easy to make an infinite loop, or forget to set a return variable properly, in such a scenario. Too many variables in play. I don’t want to mess with it. Here’s my last completed file.
Also, Chrome does not play nicely with Wordpress. And Ryan, what code markup tool are you using?
using System;
using System.Collections.Generic;
using System.Text;
namespace WarhammerSimulator
{
class AttackTable
{
BaseUnit unit = new BaseUnit();
public bool RollAttack(int AttackerWS, int DefenderWS)
{
int NeededToHit;
if (AttackerWS > DefenderWS)
{
NeededToHit = 3;
}
else
{
if (AttackerWS == 2 * DefenderWS + 1)
{
NeededToHit = 5;
}
else
{
NeededToHit = 4;
}
}
Random rand = new Random();
int roll;
roll = rand.Next(1, 6);
if (roll >= NeededToHit)
{
return true;
}
else
{
return false;
}
} //public bool RollAttack
public bool RollWound(int _strength, int _toughness)
{
int NeededToWound = 4;
int Difference;
int roll;
Difference = _strength - _toughness;
if (_toughness >= _strength + 4)
{
return false;
}
if (Difference > 2)
{
Difference = 2;
}
NeededToWound = NeededToWound - Difference;
Random rand = new Random();
roll = rand.Next(1, 6);
if (roll >= NeededToWound)
{
return true;
}
else
{
return false;
}
}
public bool Shoot(int BallisticSkill, bool hasMoved, bool softCover, bool hardCover, bool singleTarget, bool largeTarget, bool Skirmishing, RangedWeapon Weapon, decimal Range)
{
bool Result;
int NeededToHit = 0;
int roll;
if (hasMoved)
{
NeededToHit++;
}
if (softCover)
{
NeededToHit++;
}
if (hardCover)
{
NeededToHit = NeededToHit + 2;
}
if (singleTarget)
{
NeededToHit++;
}
if (largeTarget)
{
NeededToHit++;
}
if (Skirmishing)
{
NeededToHit++;
}
if (Range > Weapon.Range / 2)
{
NeededToHit++;
}
if (NeededToHit < 2)
{
NeededToHit = 2;
}
Random rand = new Random();
roll = rand.Next(1, 6);
if (NeededToHit <= 6)
{
if (roll >= NeededToHit)
{
return true;
}
else
{
return false;
}
} //if (NeededToHit <= 6)
else
{
if (roll != 6 || NeededToHit > 9)
{
return false;
} //if (roll != 6 || NeededToHit > 9)
else
{
switch (NeededToHit)
{
case 7:
NeededToHit = 4;
Result = RollHit(NeededToHit);
return Result;
case 8:
NeededToHit = 5;
Result = RollHit(NeededToHit);
return Result;
case 9:
NeededToHit = 6;
Result = RollHit(NeededToHit);
return Result;
default:
return false;
} //switch (NeededToHit)
} //else
} //else
} //public bool Shoot(int BallisticSkill, bool hasMoved, bool softCover, bool hardCover, bool singleTarget, bool Skirmishing, RangedWeapon Weapon, decimal Range)
public bool RollHit(int NeededToHit)
{
Random rand = new Random();
int roll;roll = rand.Next(1, 6);
if (roll >= NeededToHit)
{
return true;
}
else
{
return false;
}
} //public bool RollHit(int NeededToHit)
public bool RollMeleeArmorSave(int ArmorSave, MeleeWeapon Weapon, int AttackingStrength)
{
int roll = 0;
Random rand = new Random();
roll = rand.Next(1, 6);
AttackingStrength = AttackingStrength - 3;
ArmorSave = ArmorSave + AttackingStrength;
if (Weapon.HandWeaponAndShield)
{
ArmorSave--;
}
if (roll >= ArmorSave)
{
return true;
}
else
{
return false;
}
} //public bool RollMeleeArmorSave(int ArmorSave, MeleeWeapon Weapon, int AttackingStrength)
public bool RollRangedArmorSave(int ArmorSave, RangedWeapon Weapon, int AttackingStrength)
{
int roll = 0;
Random rand = new Random();
roll = rand.Next(1, 6);
AttackingStrength = AttackingStrength - 3;ArmorSave = ArmorSave + AttackingStrength;
if (Weapon.ArmorPiercing)
{
ArmorSave++;
}
if (roll >= ArmorSave)
{
return true;
}
else
{
return false;
}
} //public bool RollRangeArmorSave(int ArmorSave, RangedWeapon Weapon, int AttackingStrength)
public bool RollWardSave(int WardSave)
{
int roll = 0;
Random rand = new Random();
roll = rand.Next(1, 6);
if (roll >= WardSave)
{
return true;
}
else
{
return false;
}
} //public bool RollWardSave(int WardSave)
}
}