ajh1138

Archive for the ‘Uncategorized’ Category

Cocoa/Objective C development tips for .Net Folks: Part I

In Programming, Uncategorized on October 1, 2009 at 3:41 am

No, this isn’t about using .Net to make iPhone apps!  It’s just a set of observations that might make it easier for people like me who currently use .Net (specifically, ASP.Net) at work, but want to start fiddling around with some Objective C, Cocoa, etc.

Keep in mind that this is from the perspective of someone who got into web development without traveling down the formal education route (when some of my buddies were learning C, COBOL and PASCAL in CompSci 101, I was sucking sand through a gasmask, patrolling some godforsaken ammo dump or airfield in the middle of nowhere).  I have no pure C language knowledge or insight, so all of this stuff is new to me.  I know many web developers in the same situation, so maybe this will help some people make the connections between Obj C and the types of languages they’re used to.

- “Actions” are event handlers.
- “Outlets” are properties that can be bound to your user interface widgets.  They are objects of the same type as the given widget. So if you have a RoundedButton on your UI, you’ll probably have a RoundedButton in your .h/.m code if you want it to actually do something.

From what I can tell, you don’t need to name the specific buttons in the UI part…you associate the button with its corresponding outlet via a drag-and-drop in the UI editor (“Interface Builder”).  I’m pretty sure you can do it manually/dynamically via code, too.  In the .Net world, you’d set the name of the button in the UI editor or in your HTML code, and Visual Studio would automatically make the corresponding code additions.  I haven’t seen that ability in XCode/Interface Builder, but I’m totally new to this so don’t take it to mean that it doesn’t happen.

You can think of the .xib file (known as a “nib” file by Cocoa vets to honor the former file extension) as needing a code-behind page.  The nib is your UI, and the .h and .m files need to be told “Hey, I have these do-dads on the UI.”  After all, if you dig through the code that ASP.Net automatically generates, you’ll find the same kind of definitions for each UI item in the code-behinds.  Same-same.  Don’t let the EXTREMELY WEIRD BRACKET-HEAVY SYNTAX scare you.

Speaking of which, here’s a brief bit of learnin’ about the syntax.  Let’s take apart this function…

-(IBAction) openThing: (id) sender
{
// code that does stuff
}

The hyphen is there on purpose.  (Don’t ask me why.)  (IBAction) is the return type, openThing is the name of the function.  (id) is the type of the argument and sender is the argument itself.  To call a function, use brackets like this:
[myObject doSomething:5];
myObject being the object, doSomething is the function being called, and 5 is the argument.

By the way, the “id” type in Obj C corresponds to Object in our world.  It could be anything.  You’ll need to cast it to whatever type actually sent the event if you want to use it.

If you ask me, the brackets clutter up things, and dot notation isn’t supported enough in Objective C.  They added it to 2.0, but I think it could be used more than it is.  You still need to use brackets for functions if I’m not mistaken.  Of course, you can’t just change the entire syntax of a language without peeving your developer base!

On a side note, I’ve found XCode to be a sweet IDE to work in.  At first I found it a little annoying to have to switch between two completely separate programs to do coding vs. UI work, but then I realized some benefits to it.  Unlike Visual Studio, you can open up just the stuff you want to work on.  VS gets more bloated and resource-hoggy with every iteration, and it would be nice if you could completely rip out the Design mode when you’re working on ASP stuff.  You know it’s lurking in memory somewhere, ready to reformat your clean, hand-written tags the moment that you accidentally summon it.

Another advantage to having two separate programs is that it reinforces the separation of concerns between code and UI.  This premise lies at the very heart of how iPhone programming works – it uses the Model-View-Controller pattern!  I have used this pattern extensively, and although I’m not a design patterns guy, I have to say that it makes for fairly clean distinctions between the various pieces in an app.  If you haven’t used it yet and you’re an ASP.Net developer, you’re in luck.  ASP.Net has an official MVC implementation!  Grab it, build some stuff with it.  Understand it. It’ll help you see how things work in the iPhone (“Cocoa Touch”) world.

The books I’m reading on the subject are Beginning iPhone 3 Development by Dave Mark and Jeff LaMarche, and Programming in Objective C 2.0 (2nd Ed.) by Stephen G. Kochan.  I’ve found both of them to be very, very good books.  I will say that getting about halfway through the Objective C book first will make your life a lot easier.  I’m currently switching back and forth between them.

I’ll be posting more stuff as I wrap my head around this.

Backup your iPhone data. Right now.

In Uncategorized on September 27, 2009 at 7:44 pm

Fortunately I didn’t have much on my iPhone.  What I did have was completely lost today.  It started with a  failed iPhone update (3.0 to 3.1).  My phone got bricked, and I frantically scoured the net for solutions to the problem.

It seems a lot of users on both Mac and Windows get this “1604″ error when trying to perform an update on their iPhone/iPod Touch.  Honestly, I expect Apple stuff to work a lot more smoothly.  My wife and I *always* have trouble whenever there’s an OS update to our phones.  That’s why I had waited so long before finally grabbing 3.1.

I uninstalled and reinstalled iTunes about 5 times I think, as was suggested by several sites on teh intartubes, and even Apple’s support site.  Eventually, I had to boot my PC into Mac mode to get it to work.  (Yes, it’s a freakin’ Hackintosh.  I have it just for situations like this, and for testing web sites.)

I had a mistaken assumption that when iTunes synchronizes the phone will use the data on the computer instead of clobbering the computer’s data with whatever’s on the iPhone.  It turns out that you can restore your iPhone from an earlier backup just by right-clicking on it in iTunes…but you need to have data to restore from.  Over the course of several re-installs, I found out where my backup data was (on XP it’s in c:\documents and settings\yourusername\application data\apple computer\MobileSync\Backup\{big long string of characters}) and I moved my most recent data onto my desktop for safekeeping.  So when iTunes started up again, it saw that there was no recent folder in there and created a new one.  Later on I was trying to figure out how to restore my old data, and I move my folder back into the Backups folder and restared iTunes.  Then I synced data with the phone…then I cried.  Well, I didn’t actually cry, but I was kicking myself for moving the actual folder in there instead of a copy.  It got clobbered with blankness.

SO…go backup your iPhone data right now before you do any updates, etc.  Go to the path I mentioned above and make a COPY of your backup folders and put them somewhere safe (backup your backups).  Learn how to restore your iPhone data from backup.  Then, write Apple a letter telling them to make updates a little smoother.

Hauler v.005, and the Glory of callLater()

In Uncategorized on August 17, 2009 at 4:42 am

Here’s the latest iteration of Hauler. I worked on it all frickin’ weekend.

New Stuff

  • Overhauled combat system.  Still needs lots of work, but it’s a lot more fun than it was.
  • Models for several ships (including two that you won’t see yet!)
  • Explosions!
  • Character avatars for the pirates.  Nothing for the player to choose yet, however.
  • One-letter-at-a-time text with nifty sound.

The combat screen now has two modes – an “action” mode where you see the ships, lasers, explosions, etc. and then “dialog” mode, where it shows the pirate’s avatar a bit larger and they say stuff.  I got the ships and some temporary explosions, but no lasers yet.  I’m looking at some open-source Flash building tools to do the animations for lasers and explosions.

I used Second Life to build the ship models and character avatars.  As I’ve said before, I can’t draw, but I can bodge up models in SL pretty quick.  I just took some snapshots of the models/avatars and applied a Mosaic filter to get them all pixely.  Turned out pretty nice if I do say so myself.

Ship Models

Faux Millenium Falcon

Faux Millenium Falcon

Inspired by various Star Trek ships

Inspired by various Star Trek ships

NOO-B Class starter shuttle

NOO-B Class starter shuttle

Juggernaut - huge and bristling with guns!

Juggernaut - huge and bristling with guns!

A large, sturdy cargo ship

A large, sturdy cargo ship

The large cargo ship and Juggernaut are not yet seen in the game.  One of my next steps is to add the ability for the player to purchase new ships.  I also need to develop a system that pits you against pirate ships of similar firepower/size.

Technical Notes

I was having a dickens of a time trying to debug a sequence wherein the player loses a battle.  At the end of the fight, the pirate talks some smack, then it shows the player (eventually I hope to have a dejected-looking expression on the avatars)  and explains the consequences of their defeat.  During that change from pirate dialog to player dialog, it kept locking up.

I have a new rule when developing in Flex, and it serves me well:  Whenever you spend more than 10 minutes trying to debug a weird problem in Flex, it’s probably a creation timing issue.  Turns out that’s exactly what it was.  I was wiping out the character component’s text box before printing new dialog, and since the component wasn’t finished building itself on the screen yet it freaked out.  I solved it by wrapping the function call with a callLater( ) and bam…works great.

In case you’re wondering, callLater(function_name, [array of arguments]) is a great little function that makes Flash wait until all of the declared components have been placed on the stage, then it calls the function you put in as an argument.  It’s like telling Flash “Hey, do what you need to do to get yourself ready.  When you’re done, do this thing.”

Flex Quirks I Learned About Today

In Uncategorized on August 15, 2009 at 11:20 pm

1) Class names in Flex “css” cannot have underscores.
2) backgroundSize is percentage-based, and is based on the size of the container, not the image. Handy! Inconsistent and weird, but handy.

May you be blessed by the deity of your choosing, Mr. Dah.

In Uncategorized on August 15, 2009 at 7:11 am

Tonight was going to be the big night for Hauler. I got a lot of visual content built and photographed in Second Life, and opened up Flex builder to finish up the game. Unfortunately, I ended up spending more than two and a half hours trying to overcome this error dialog:

“Flex Builder cannot locate the required version of Flash Player. You might need to install Flash Player 9 or reinstall Flex Builder.”

I noticed that this happened after I installed IE 8 (I still had IE 6 since I never use IE at home). So I guess Flex Builder lost the path to my debug version plugin when the old version of IE went away.

I tried uninstalling/reinstalling Flash a few times, and fiddled with the paths in Window–>Preferences–>Flex–>Profiler–>Player/Browser but this is NOT the place to do that!!! The correct place to fix this problem was in Window–>Preferences–>Web Browser. I found this tip in the Flex JIRA bug tracker posted by “bahiminin dah” about a year ago. Ya sure got me out of a hole, Mr. Dah. I just checked off Internet Explorer as the browser to open, and the problem went away. (I usually leave Firefox for browsing and IE solely for debugging my Flex junk.)

Here’s a little preview of the new content I’ll be tossing into Hauler this weekend:

FauxTrek_Attacking_128FauxFalcon_Attacking_128

Samurai

In Uncategorized on August 1, 2009 at 5:35 am

Hoo, boy.

Samurai by German pop band Dschinghis Khan.

It’s amazing what you can do with a potentially ethnically-offensive stereotypical “Japanese” black-keys-only riff  and a galloping octave synth bassline.

Battlefield Heroes: The Uninstall

In Uncategorized on July 29, 2009 at 3:12 am

Sadly, I had to face the facts and uninstall BF Heroes the other night. Call me old-fashioned, but I just can’t hang with the aimbot crowd.

I knew there had to be a reason why I was getting pwned so bad in virtually every FPS I tried! I’m not the most coordinated guy in the world, but it was pretty ridiculous how quick those guys were putting me out of commission. I’d heard about aimbots, but I thought programs like PunkBuster had stopped that kind of stuff back in the CounterStrike days. Guess I was wrong about that.

I have tons of other beefs with BFH, and I mentioned a few in my initial review. Just a couple:
- To get to the Options menu you have to exit the game. So if you want to tweak your mouse sensitivity or keybindings, etc., you’re in for quite a wait while it restarts the game and finds a server for you.
- No changing class mid-game. This is a pain.

So that’s fine…let ‘em aimbot all they want.  Pretty soon we’ll have aimbots in real life anyway.

Hauler .003

In Uncategorized on July 28, 2009 at 6:58 am

Another alpha release, this time with a functioning fuel consumption/purchasing system.  Fuel capacity is now shown, and can be increased by purchasing external fuel tanks.  I have also implemented turns, which are decremented (from 100) every time you jump to another location.  I do not yet, however, stop the game when the turns reach zero.

One major bug I have is that I’m recalculating prices for all of the items in the Trade and Shipyard views each time you switch to them.  I need to have those calculated only once per visit to a location.

Hauler .002

In Uncategorized on July 27, 2009 at 2:11 am

I’ve made another alpha release of Hauler, this one being .002. The Shipyard view is full of upgrades like cargo pods, etc. I’ve moved the view buttons and info panel up to the top, and I think that’s working out a lot better.

I haven’t quite finished implementing the upgrade system, so there are bugs such as the ability to remove cargo pods even if they drop your total cargo space below your inventory count!

Hauler002

Battlefield Heroes

In Uncategorized on July 23, 2009 at 5:47 am

I’ve been eagerly anticipating Battlefield Heroes for quite a while now – since late 2007 I think? Anyway, I’m a little disappointed but I’m still having fun playing the game.

First off, it’s another one of those ultra-twitchy first-person-shooters that requires you to shoot your opponents in the face twenty-seven times before you can actually kill them. I thought maybe, for once, a sniper rifle or heavy machine gun could maybe do some real damage in an FPS.

I have found that the most effective way to ensure kills is to run people over with a jeep or kubelwagen. It’s fun, and it seems to really annoy people. So they got that part of the game right, I suppose. You hit somebody with your car – they die.

But you see, the lack of powerful weapons is one of the ways they get you to come back for more in this new entry in the Battlefield franchise: you earn more Victory Points the more you play, and you can spend those points on upgrades so you can do more damage. I think it’s a neat game mechanic, and borrows nicely from the RPG genre, but when I play FPS games, it’s to get away from the RPG grind. (I just left WoW a while ago.)

I wish I could spend some of those Victory Points to upgrade my jeep. I’d put on some rollbars, some spikes on the front, maybe a horn that plays Dixie.

The game suffers from really terrible vehicle physics just like its predecessors. When you’re driving a jeep around, it has that same old Hot Wheels car on a stick feeling. Like the car has but one wheel and it’s located dead center of the vehicle. Don’t get me started about the airplanes. Atrocious to fly. Simply awful and they ruin what could have been a really fun aspect of the game.

Another thing I have trouble with is the generally unpolished feel of the game. I can understand an indy-game feel, but in some areas it’s sub-indy quality. Jumping physics, for instance, are just plain weird. Depending on the angle of the terrain you’re standing on, that’s the direction in which you jump. So while trying to hop up some rocks to get to a good sniping spot, you instead end up jumping backwards because of the slant of the rocks. It’s another bizarre tick that detracts from the fun. Another place where polish would help is when you’re driving over tall grass – it sticks up clear through the floorboards of jeeps. Things like that could use some lookin’ in to.

And finally, I have a beef with the way they portray the obviously Axis-inspired faction in the game. They make them way too cool, frankly. Everybody knows the Nazis had some pretty talented designers make their costumes uniforms, but this game glamorizes that aspect a bit too much. I think the factions should have been a lot more ambiguous as to their origin/political leanings.

I think that more than half of the players have the word “ninja” in their character names. It’s kind of like the Death Knight syndrome in WoW – all of them seem to have “Death” in their name.

I like the character development aspect of the game. I don’t like the fact that you can’t change class without leaving a battle. I’m very switchy in that respect and would like a little more flexibility.

I don’t really have an opinion about the micro-transaction aspect of the game. You can apparently spend real money to buy various goodies like clothes, etc. Fortunately you can’t buy items that affect gameplay (such as better weapons, armor, etc.)

Aside from my gripes, the game is quite fun once you get past the whole “sniping isn’t actually sniping” and “you just took an anti-tank round to the chest and are somehow still shooting at me” aspect of the game. It’s free, and it’ll probably give me plenty of giggles for the next couple of months.

Hauler v.001

In Uncategorized on July 20, 2009 at 6:53 am

This is the furthest I’ve gotten on any game project so far. I present: Hauler v.001!

I’m taking an pseudo-8-bit approach to the look and feel, but it should be easily skinnable to other styles.  I’m pretty happy with the way the artwork is going so far.  The locations (planets, stations) need some help, but the icons for trade goods are just what I had in mind.  Not bad graphics work for a code monkey.

hauler_001_map

hauler_001_trade

Building yet another game…Hauler!

In Uncategorized on July 9, 2009 at 6:00 am

I’ve been working on a Flex/Flash-based space commerce game for the past few weeks. I’m taking an extended hiatus from WoW, so I have quite a bit more time to dedicate to living an actual life, and building my own games is part of that.

I’m keeping this one pretty simple. The concept is a tribute to classic commerce games like Dope Wars, Solar Wars, etc. – travel from place to place, buying and selling commodities. Make money, upgrade your vehicle, haul more cargo. Rinse and repeat. Every now and then an incident occurs at one of the locations that affects the prices of one or more commodities. There will also be occasional turn-based combat using extremely simplified stats and dice-rolls.

I had Solar Wars on my Palm Pilot years ago, and literally wore down a few spots on the screen from playing it so much. I hope to make Hauler visually appealing and just as addictive.

Once I finish it, I plan to port it to several different platforms including Silverlight, iPhone, and Android. Maybe I’ll even make a Palm Pre version…who can say? It would even be nice on a dumbphone like the one I carry.

I don’t have anything playable to show yet (it’s uuuuuugggleeeeee right now), but at this point I’m further along on this game than I have been on any game since I was a kid banging away at my TI-99/4A or C-64.

Web Services – Give more data rather than less…in moderation.

In Uncategorized on July 6, 2009 at 10:35 pm

There are those that argue that XML is evil and bloated and blah, blah, blah. But if you’re building a web service, I find it’s always better to provide more information than less.

For example, you might be tempted to leave off stuff like dates/timestamps, etc. Don’t. Those little metadata tidbits come in handy. I always like saying “It’s already there.” whenever somebody asks me about that kind of stuff. (This is in sharp contrast to a certain web service I’m calling these days that returns a 1 or a 0. If there’s a failure, I have no indication as to the cause. If it’s successful, I don’t have any transaction number, etc. to refer to the call. Lame.)

Of course, if you’ve got performance issues or you need to save bandwidth, trim it back. Be reasonable.

ComboFix to the Rescue!

In Uncategorized on June 17, 2009 at 12:20 am

Where other anti-malware products failed, ComboFix triumphed.  I had a nasty, evil trojan on my computer (a DNSHijacker variant of some kind) that was redirecting me to toseeka.com (among other places) when I would click on links from Google searches.

I tried several virus and malware scanners and they either failed to detect any problems, or were powerless to do anything about it.   I tried running them in safe mode, waiting for new definitions and updates, etc…no help.

This thing I had was apparently able to hide out and rename/copy itself pretty cleverly.  ComboFix closes down all your programs (including your explorer shell!) and digs deep.  I’ve had misc. infections on my computer before, but none have ever been this tough to clear up.

I’m not sure how I got the trojan, but I have re-installed AdBlock on Firefox and I’m doing a Windows Update first thing after I whip this post out.  I took off AdBlock because I want to help support all the great sites I visit.  But until ad distribution systems become a bit safer, I’m back to blockin’.

I’m also shopping for a good all-around antivirus solution.  This computer needs a nuke ‘n pave.  The current install is about 18-20 months old, which is ancient for me.  I’m thinking about trying out Windows 7.

Flex 3 – Errors in the Problem Pane May Not Actually Be Where They Appear To Be

In Uncategorized on June 13, 2009 at 5:05 am

I just ran into a pretty weird problem during some Flex development that had me cursing and throwing things around the office…ok, not really, but it was still frustrating.

After getting the latest code from our source repository, I kept getting compile errors in Flex Builder but the line that had the error *didn’t even exist* in the file that was causing it to break.

Long story short: our designer had built various doodads in Flash to use as style components, then referred to those doodads in a stylesheet.  Any item in my Flex code that used those styles was breaking because Flex couldn’t find the object that the style was referring to.  But it gets even more interesting!

As you may be aware, when Flex Builder does a compile, it turns your nice, pretty declarative MXML tags into plain ‘ol nasty ActionScript before it does the actual compilation.  The *true* place in the code that was killing the compile was in fact in the generated ActionScript files.  And every place in those generated files where the Flash components were referenced was causing an error.

During the course of figuring this out, I checked the “save generated code” checkbox (it’s in the Project properties) which gave me a nice folder full of ActionScript files (generatedCode, i think it was called).  Guess what was in there?  The lines with errors.  Through those files I was able to figure out that the style stuff was causing the problem.

But if I got latest code, why wasn’t the CSS finding the nifty Flash doodads?  Great question.  It’s because I needed to add the SWF (or SWC, or whatever you use) as a library reference in my project.

Flash Builder Quirk #184912 – The Fake Compile

In Uncategorized on June 13, 2009 at 3:40 am

The other day I had to merge some code (we’re using SVN with Tortoise).  Sometimes that doesn’t work out too well.  This is especially true with Flex code, for some reason.  The merge left a few files conflicted and otherwise wonky, and after untangling that mess Flex Builder still wasn’t compiling the project.

Or should I say, Flex Builder wasn’t compiling it, but it appeared as though it was.  It turns out that there was a huge chunk of “<<<< mine” and “<<<< theirs” code sticking out of one of the files, but FB wasn’t reporting any compile errors.

Long story short: any time you suspect that FB isn’t really compiling the latest version of your code, try running the project straight out of the IDE (hit the big green Play button) instead of running it via your web page.  That should knock it in the head and let it show you the compile error.

The Save Pedal

In Uncategorized on June 13, 2009 at 3:17 am

My 10 y.o. just lost about an hour’s worth of animation work because he never saved his project.  I’ve told the boy over and over that Ctrl-S is his friend.  It’s unfortunate, but it’s only through this kind of loss that we ever learn to save, save, save.

Some day I’m going to make some kind of USB footpedal that does a “Save” command on my computer every time I step on it. Also, Copy and Paste command pedals would be good.  Heck, I should just get a set of Taurus bass pedals and wire ‘em up for various commands.  OK, that would be a horrible thing to do with vintage music gear, but you get the idea.

I found these pedals from Bilbo Innovations when I did a quick google on the topic “computer pedals,” but I think a Taurus-like rig would be far cooler.  Also, these Bilbo pedals plug in between your computer and keyboard…via a PS/2 port.  Yuk!

Rule 1138

In Uncategorized on May 19, 2009 at 3:49 pm

I’m proposing a new Internet Rule (a’la Rule 34, etc.)

Rule 1138: If it exists in Star Wars, there is Lego of it.

Case in point, this HUUUUUGE and awesome Lego Corellian Corvette (aka the “Blockade Runner”).


Pantech Slate, AT&T and Gmail

In Uncategorized on May 12, 2009 at 3:21 am

I finally replaced my hoopty 4 year old flip-phone.  I never carried the thing.  It was chunky and never held a charge very well.
Now I have a Pantech Slate (CS350), an inexpensive phone that is built better than I expected considering the price ($50, but free after rebate).  It has all the standard stuff like web browser, text messaging and an email app.  It’s no iPhone or Android, or even Blackberry, but it serves my needs.

When I started configuring the thing this evening I was a bit disappointed that the built-in email client didn’t have Gmail listed, nor could you enter your own IMAP or POP settings.

After a bit of poking around on the intarwebz, I found out that the good folks from Google have built a Gmail client that will work with most Java-enabled phones!  Works like a charm.

Just go here –> http://www.google.com/mobile/default/mail.html — and enter your phone number.  They’ll send you a link to the applet installer.  Done!

Shake Your Wii Remote to Charge It?

In Uncategorized on May 4, 2009 at 3:47 am

The thought just occurred to me that a clever company could make a Wiimote charger that uses motion to give a little juice to the batteries.  It might not be enough to be its sole power supply, but a shake every now and then could keep it from losing power over the course of a long gaming session.

Everybody Gets a Corvette: My Recession Solution

In Uncategorized on January 6, 2009 at 5:11 pm

To help out the American car manufacturers, who are apparently too huge to let fail, and to help out all the actual, real physical people who are living through this recession, I propose that the US government purchase a Chevrolet Corvette for every citizen in the country.

We could establish a Department of Vette Affairs to handle the distribution of the vehicles, and handle any substitutions that citizens may want. Instead of a Corvette, taxpayers should be able to choose any domestically-built vehicle from any of the Big 3 automakers. For instance, if you’re an idiot you could pick a Chrysler Sebring.

The money’s going to the automakers anyway, with no apparent benefit to taxpayers. With my Everybody Gets a Corvette plan, we ensure that the money is actually being spent throughout the supply chain the way it’s supposed to be. AND the American taxpayer gets a direct, tangible benefit!

Write to your congressperson. Better yet, buy yourself a senate seat and propose/support this legislation.

ADMIN, people, ADMIN!!!

In Uncategorized on December 31, 2008 at 5:09 pm

When you’re building a web application, no matter the size, you should always include an admin section where you can search for users, companies, or whatever entities the application supports. And you should be able to click on your search results and bounce around to the various related objects.

For instance, if you have Companies and each company has many Users, you should be able to search for companies and/or users…when you view a company, its users should be listed, and when you’re viewing a User, you should be able to see its company name and click on the company name in order to see the company’s details. Simple linking back-and-forth between entities!
I’m shocked, saddened and disappointed at how many web apps don’t have these simple features. The developers always end up running SQL queries to find/fix problems instead of using their own app. Make your life easier…build a robust admin area into your web app.

Preparing for the Mocknology

In Uncategorized on December 29, 2008 at 9:40 pm

No, I’m not talking about Mocking as in test-driven development stuff…I’m talking about the technology that is available cheaply *right this minute* that will enable your kids to record anything you say and then digitally remix it and upload it for scrutiny on the intarwebz. I think somebody could make a fortune offering jamming devices specifically marketed for parents.

Will a recession/depression help or hurt MMO games and worlds?

In Uncategorized on December 6, 2008 at 6:02 am

I’ve been wondering what effects the economic shitstorm downturn will have on massively-multiplayer online games and communities.  Will people be more inclined to reduce the amount of money they pay to participate?  Will we see a rise in free-to-play MMOs here in the US?  (Free-to-play is heeeeeuuuuge in Asia, apparently.)

What I don’t foresee happening is people spending more time and money on MMOs due to the economic crisis…not this time, anyway.  I don’t think our society has yet tipped over to a condition where online life is preferable to “real” life.  For one, the graphics just aren’t up to snuff.  :-)

Perhaps 20 to 25 years from now, when we’ve dug ourselves into yet another financial pit and we have realistic holographic projections instead of monitors, some folks will choose to spend the majority of their waking hours in a virtual world where they’re beautiful and wealthy.  Of course, their full-time job will probably be farming Warcraft gold for some megaconglomerate, but it might be preferable to real-world alternatives.

Blogging health info: Probably not a good idea.

In Uncategorized on December 6, 2008 at 5:42 am

I don’t know if they’re doing anything like this yet, but I imagine insurance companies are wise to the whole blogging thing and will start using advanced search algorithms to determine whether or not you or members of your family have pre-existing health conditions.

I’m a big advocate of anonymity when it comes to tha interwebz, anyway, but knowing what I do about how health insurance companies can be total fuckbags I must strongly recommend to the few people who will ever read my blog that you be more diligent when posting health info about yourself or anybody you know.

AJ’s advice:  Don’t blog using your real name or location.   Don’t post details about health conditions or medications.  Don’t mention family histories of illness or disease.  Don’t use your primary email address as your blog contact address.  The tougher it is to connect a real life physical person to the text on the screen, the better.  The fewer details that you reveal, the better.

I’m sure that with enough digging, a reasonably crafty person could determine my identity by reading my various blog posts and digging through other resources on the web.  However, that’s not really the objective of my obfuscating efforts.  I just don’t want some automated system to be able to put all those pieces together.

Proper Props from Planet Rock

In Uncategorized on November 21, 2008 at 3:57 am

The very first 12″ album I ever owned was Planet Rock by Afrika Bambaataa.  It was a promo record that my dad got at a garage sale.  He bought it for me based on the title since I was (and pretty much still am) crazy about anything having to do with space.

I was really young, and that album really influenced my taste in music, and influenced a lot of the groups that I ended up liking later in life.  Now there’s a commercial on TV featuring Afrika and some hip-hop guy (dunno his name, too lazy to google it) arguing over who influenced who with Planet Rock, and blah blah…no mention whatsoever of Trans-Europe Express, the Kraftwerk song to which Planet Rock owes its melody riff.

So Afrika…I know it’s just a commercial, but puh-leeeeze…before anybody talks about credit or influences, please include a shout to Kraftwerk.  And not just because you got your ass sued last time, but because props are only proper.

Second Life: Creativity Sink?

In Uncategorized on November 14, 2008 at 2:45 am

For me, Second Life has become little more than a creativity sink.  I’ve wasted enough time dreaming up ideas, coding and designing products for so little financial gain.  Without going into specifics, I’ll just tell you that sales have hit rock-bottom for me and I don’t think it’s going to get better anytime soon.  I’m selling about 20% as much as I was this same time last year.

And it sucks, too, because I love making stuff in SL.  Love it.  As much as I bitch and complain about the lack of features, I really think it has potential.  So while I’m not going to devote as much idle brain cycles to crazy new product ideas, I’m not quite ready to pack up the shops yet.

There’s so much amazing art and architecture and coding going on in SL.  Unfortunately, there’s hardly anybody around to see it.  So I’m gonna go cry and stuff.    See ya.

Intellisense fix for Visual Studio 2008 ASP.Net pages

In Uncategorized on November 13, 2008 at 10:01 pm

Somehow my settings got jacked up on VS 2008 and Intellisense didn’t work when viewing editing aspx pages in “source” mode (when you’re editing HTML and web form tags).  It coulda been a service pack install, it coulda been some of the paranoid junk that corporate America loads onto work computers nowdays, but regardless of the cause I was hosed.  I tried everything.

I finally found a post that led me to an answer while looking digging through the offical ASP.Net forums.  The proposed fix on the forum didn’t solve my particular issue (the topic was intellisense in XML files), but one poster mentioned switching the editor by right-clicking and selecting “Open with…”.  I remembered seeing that and tried out a couple of different editing modes.  It turns out that the “Web Form Editor” is the one to use.  I set that mother as my default and now I’m plugging away at aspx pages again.

Soooo…in VS 2008’s Solution Explorer, right-click on an aspx page you’d like to edit, then select “Open with…”.  Choose “Web Form Editor” and click the “Set As Default” button.  Done.

Give Up and Use Tables

In Uncategorized on November 12, 2008 at 7:35 pm

When I think about how much time I’ve wasted during various projects just trying to get a nice, clean table-less CSS layout to work on multiple browsers, I get a little nauseous.  Tables…I love tables.  They’re so…tabular.  They make simple layouts really easy.  They work in all versions of Internet Explorer.  Honestly, if you’re going to overhaul your site so drastically as they demonstrate on A List Apart (*love* that site, btw), then your underlying page structure is going to change, too.

This is why I love the fact that Give Up And Use Tables exists.  It’s good to know I’m not the only out there who gets frustrated by hacking away at CSS only to revert to tables out of desperation.  I think those of us on the programmy side of web development (as opposed to the design side) have more trouble with CSS layouts.

Active Directory – pulling your hair out trying to get the username?

In Uncategorized on November 6, 2008 at 8:36 pm

After much digging and trying to get the userPrincipalName and/or samAccountName properties when doing a search for users on my Active Directory thingy, I found an obscure post on an obscure site that mentioned the “cn” property being used as the actual username.  All of the other sites I’d seen said that “cn” was the user’s first name (or “christian name”).  I pulled the “cn” and viola, the username was right there.

ORA-01036- The Comprehensive Guide for Frustrated ASP.Net People

In Uncategorized on October 29, 2008 at 5:01 pm

If you’re running into the ambiguous, unhelpful “ORA-01036: illegal variable name/number” error when trying to do an update or an insert in ASP.Net while using a SqlDataSource, here’s some advice that may prevent you from pulling out all of your hair, swearing off technology forever, moving to rural Wyoming and living off the land until the end of your days…

  • Make sure you have the ProviderName specified in your SqlDataSource tag.  It should be System.Data.OracleClient (unless you’re using the Oracle.Whatever.Whatever provider)
  • Make sure you’re using :MyParameterName instead of @MyParameterName.
  • Get rid of OldValuesParameterFormatString in your SqlDataSource tag.
  • Each and every input where you have specified Bind(“FIELD_NAME”) MUST be represented in your UpdateParameters (and/or InsertParameters).  To debug this problem, what I recommend is that you change ALL of your Bind()s to Eval()s and pare down your SQL statements and update/insert parameters to just one or two things…then change the Evals to Binds as you add parameters to your SQL statement.  Every time you get a successful update/insert, add another parameter or two until you’ve found the problem.  More than likely you’ve got an extra input lurking somewhere that isn’t represented in your SQL query and/or parameters.

Second Life – some thoughts about business

In Uncategorized on October 28, 2008 at 1:59 pm

Here’s a post I rattled off to slashdot a few min. ago…

From my experience, a virtual economy can support itself without any intervention or participation from outside companies. For example, there are lots of people who sell skins, clothing, accessories, you-name-it to the residents of Second Life, and *I* make money by providing business tools to them (for visitor counting/automated greetings/report services/surveys, etc.).

I think Second Life paved the way for bigger and better things, but by no means should it be considered the model for the way a virtual environment should work. The utter lack of an interactive forms API and zero support for interaction with real-world documents (such as PDF, .DOC, Excel, PowerPoint) are big flaws that are already frustrating businesses that try to conduct meetings in SL. And don’t get me started about their “land” approach to paying for CPU cycles.

From the outset, SL hasn’t been about business. Linden Lab created a barren virtual landscape and has let the residents create just about 100% of the content using a very limited (dare i say “primitive”?) set of tools. It has been a big hippie-furry-fetishfest that has concentrated on bugfixes rather than connecting to the outside world. Considering how long it’s been around, Second Life shouldn’t still be regarded as a place where cyberweirdos go to get their kink on…and yet it still is very much regarded that way by even hardcore geeks.

Now that Linden Lab is starting to realize that their talk of SL as a place for serious business isn’t just the hot air even *they* thought it was, they’re trying to turn the ship around with some meager business-related integration. Fortunately for them, most other tech companies have watched them struggle and have stayed out of the game.

Seriously, Oracle…?

In Uncategorized on October 22, 2008 at 9:46 pm

OK, so it looks like Oracle databases don’t have a quick, easy, non-triggery way to do an autoincrement the same way MS SQL, MySQL, postgres, and every other database on the planet have.  You have to create a “sequence” and then create a trigger to run use that sequence whenever data is inserted into the table.

Seriously?  Wow.

One page I came across in my search for a non-shitheaded way to do this describes this as being a more flexible way than having an auto-increment.  Go to that page and check out the code for MSSQL’s way vs. Oracle’s way.   One line of code versus about 20, plus you have to do it in 3 separate steps.  Using that page’s definition of “more flexible”, I guess a gnawed piece of bone is more flexible than a backhoe.

I imagine Oracle DBAs and developers probably have some quick scripts to let them add incremented keys more easily.  I’ll have to dig around and see.  Considering how much effort Oracle puts into their products as far as scalability and performance, I’m really surprised to see this kind of glaring omission.

Excellent indy game dev post – Asterope by Niklas Wahrman

In Uncategorized on October 16, 2008 at 10:12 pm

http://www.gamedev.net/reference/articles/article2570.asp

This guy hits the nail on the head so many times in this article.  He refers to a lot of development ideas that I tend to agree with, such as the “Ready, Fire, Aim” approach…just build it and stop overthinking!

Making virtualization sexy again

In Uncategorized on October 15, 2008 at 5:50 pm

Ok, check out this ad for an upcoming Virtualization Conference + Expo and tell me how hot it makes you:

Sausage.  Fest.  Which, honestly, is to be expected when you’re talking about servers and system administrator type stuff.  But is this the picture you’d choose for your ad?  Seminars and conferences are boring enough without a visual preview.  How about something abstract, like a big 3d globe with wires coming out and surging electrical charges or maybe a translucent humanoid bust with a high-tech-looking green grid background?  How about choosing a picture wherein the ONE female in it is NOT picking her nose?  How about a picture where the seminar audience are all facing the same direction instead of scattered about like stock traders with ADHD?

I wouldn’t really be picking on this so much if it wasn’t one of those “blocker” style ads that gets between you and the content.  If you’re going to stick something in your readers’ faces and force them click it to get it out of the way, at least make it somewhat appealing.

ActiveX weirdness will make you pull your hair out.

In Uncategorized on October 13, 2008 at 3:18 pm

Note: Non-developers can skip this post completely.

If you’ve ever had to make an ActiveX application run within a web page, then you know how frustrating it can be to get it working, much less try to debug the $!&@# thing. If you’re building it with .Net, it’s even more of a pain.

What do you do in this situation: You’ve read through the available online tutorials (which I will not list, since they’re all somewhat incorrect in one aspect or another) and have had the app working at one time or another, you may still have the “missing/broken” section appearing on your web page instead of your nice new application after you’ve made a change. You’ve cleared your IE cache, restarted IE and may have even rebooted your computer trying to get your app to re-appear. You’ve done just about everything and it’s still broken.

Well, the simple answer is that there’s an error in the app itself. Apparently everything has to run super-smooth in order for IE to even display the app. Comment-out the stuff you’ve changed or throw some try-catch blocks in there. Rebuild the app, clear your IE cache, restart IE, and see if your app appears.

Bliztards: Cheating OK as long as nobody else makes money off it.

In Uncategorized on October 2, 2008 at 10:58 pm

Blizzard Entertainment has been awarded $6 million as a result of their suit against the makers of  MMOGlider, a program that takes a small amount of suckage out of the grindfest that is World of Warcraft.

So let’s get this straight…it’s perfectly OK for you to multi-box 5 shamans, but you can’t run what is essentially a beefed-up macro program to grind some ore?  It’s the whole multibox thing that makes me think that the goldfarmers that are “ruining the game” aren’t so bad.

If I’ve learned anything while leveling my four (yes, 4) 70’s, is that the game is all about the plug-ins and helper sites.  As soon as you discover sites like wowhead.com, thottbot, etc., then the game is pretty much over in terms of mystery or effort.  You grab the essential plugins like QuestHelper, which takes you by the hand and leads you to your next mind-numbing killfest.  No exploration needed.

If you’re into the PvP scene, there are plenty of plugins and macros for that, too.  I have a sap macro for my rogues that gives me the upper hand against other rogues.  I just spam it and it automatically targets nearby enemies and saps them.  It’s great for ferreting-out stealthed rogues.  Is it cheating?  It’s not considered cheating by WoW…it’s just another spell macro.

I cancelled my account(s) soon after getting most of my purple PvP gear for my main rogue (I have 2 horde rogues and one alli rogue).  I was hardcore-addicted to the game and one day I just overdosed and saw through the madness.  This recent court battle is yet another reason to stop wasting my money and my precious time on BULLSHIT.

I tried multiboxing for about a week, and I think that contributed greatly to finally quitting.  I realized that it’s all about money and time.  If you have enough cash and/or time to put into WoW, you can dominate in whatever aspect you choose.

Am I against multi-boxing?  Nope.  Go right ahead and spend your money how you see fit.  But don’t look down on somebody who buys gold or runs a program like Glider to try to catch up with you.

To sum up: Screw you, Blizzard.  The thing that ruins your game is the lack of original content and the rudeness of your players, not the goldfarmers or botters.

I shan’t be participating in the upcoming Bath of the Rich King, either.  OH LOOK!  We’re going to fight some zombies!  They look just like the ones outside Brill…but they’re level 80!

A Shout to My Old Blog…

In Uncategorized on October 1, 2008 at 3:14 pm

http://sarcasmic.net/blogs/baboon/

Baboon Placenta, aka Anorak Champloo

One day I might migrate it over to this blog.  Some good stuff there.  Formerly available at beatdevice.com/blogs/baboon/

Egosurfing yields comics of old

In Uncategorized on September 30, 2008 at 4:11 pm

I totally forgot about Misc. Kitty, my old comic on StripCreator.

Good times, good times.  My favorite is this one.  Make sure you disable the obscenity filter.

After all these years…

In Uncategorized on September 30, 2008 at 2:55 pm

I finally sat down and watched THX 1138 from start to finish last night, and I’m glad I did.  I didn’t understand it at all when I was younger.  I’d try to watch it and get bored, or something would happen, or I would catch it halfway through or something.  As a fan of the original Star Wars trilogy, and George Lucas’ American Graffiti, and as a sci-fi nut in general, I had been meaning to watch it for years and years.

I wish I could have seen it all the way through when I was a bit younger.  It’s kind of like The Catcher in the Rye in that it’s profound when you encounter it when you’re young, but you don’t fully grasp it until you’re more experienced.  For me it’s a good pre-middle-age movie.

I saw it on Netflix Instant, which has a pretty nice collection of movies.  It’s good to finally grasp what that string of letters and numbers really means.  I knew the gist of it, but man, it’s one of those movies that alters your thinking and perception for a while.

The office sounds totally different to me right now.  I sit by a printer/copier, and the hums, screeches and whirrs it makes are straight out of the techno-nightmare world of that film.  I work at a large telecom company, and so the banter I hear is mostly corporatespeak laced with various high-tech sounding terms.  Throw in the occasional loud rumbling of an aging HVAC system, and you’ve got yourself a premade ambient track for THX 1138 II: Bald Revolution.

I’m amazed at how prophetic the sounds were.  I’m hearing voices over several speakerphones and the garbled din is eerily similar to the intercom chatter in the movie.

As I look around the sagging beige fabric walls of my cubicle, I suddenly realize that I definitely need to add some more flair to my personal workspace.

Name change.

In Uncategorized on September 26, 2008 at 12:13 am

I have once again changed the name of this blog.  At first it was “SL and SL”, and was to be my Second Life and Silverlight development blog.  Then it was “Building With AJ”, and was broadened to overall development stuff.  Now, it’s just “AJH-1138″ – a nice, ambiguous, generalized name for a blog that will contain every random crap thought that I care to make public.  The reason for this change is because I have some stuff I need to say and I don’t want to have 300 blogs out there in order to say it.

Business Intelligence != Success

In Uncategorized on September 18, 2008 at 10:31 am

At my new job I’m currently studying whether or not to use a (gigantic) business intelligence suite for a particular project.  The company already owns the software, has it implemented, and has a huge staff of people trained in its use, maintenance, development, etc.  I think I’m obligated to take advantage of it.  The software is damned impressive, and while it probably has way more functionality than we could use on this project, I think it’s the right choice.

That being said, let me rail against Business Intelligence (BI) in general…BI is becoming yet another crutch for corporations, and yet another way to make the shareholders feel like something is being done to make them more money.  Instead of focusing on innovation, customer service and making good products, we’re supposed to “mine” a bunch of data and magically pull out numbers and statistics that will point us in the right direction.

It’s crap.  The whole idea is crap.  It’s just like Six Sigma and all the other corporate culture garbage.  It’s the lingo of d-bags in polos and khakis.  BI is an attempt to aggregate buttloads of data and try to share it and display it in ways that are beneficial to all of the divisions of your company – and that’s a noble thing to do and probably helps in many ways – but I’ve seen cultish devotion to BI and I want to slap people around and try to make them see that they’re not going to read the customers’ minds with it.

There are a lot of corporations out there that are good at one thing – being corporate.  BI is making them even better at it.

Ripped Off!

In Uncategorized on September 9, 2008 at 4:32 am

They say that imitation is the sincerest form of flattery.  If that’s the case, then I’ve received a double-dose of flatterization this evening.

I’ve been stuck in World of Warcraft *a lot* the past few months and haven’t been active in Second Life at all except to answer a few questions and handle some small issues for customers.  In that time, it seems, the imitators and thieves have been at work.

Imitation is something I can handle.  It has happened on the FunSign – most notably by the XtremeTag, which is a *great* product and has several advantages over my product; and on my Farty Follower Advanced – there’s a guy selling a “Fart Follower”, but based on his ads/marketing I’d say it’s nowhere near my quality.

I was told about the “Fart Follower” this evening , checked it out, and to be honest I’m not at all worried about losing market share in the virtual flatulence area.  But I did some digging around tonight on SLExchange.com and found some douche had COPIED, almost word for word, my description for my Sic Title product on his (vastly inferior) “Fun Title” pile of crap.  Horrifying!!  I sent a message to SLX’s merchant help folks and we’ll see how speedily this guy’s wee-wee is spanked.

Use my ideas – build a better mousetrap – make improvements and do your thing…but don’t ever, EVER plagiarize my marketing text!

teh bestest coffeemug evar!

In Uncategorized on August 1, 2008 at 9:58 pm
mah skull n xbones mugh from target!

mah skull n xbones mugh from target!

i got this mug for $3.99 at target.  it’s huge.  it’s like filling a cave with coffee.  got one for the Mrs., too.

What I Learned Today – 30july2008

In Programming, What I Learned Today on July 30, 2008 at 7:27 pm
  • A LinkButton in ASP.Net has both an OnClick event and an OnCommand event.  The OnClick event expects your typical EventArgs, while the OnCommand event can receive CommandEventArgs.  I was about to go nuts trying to figure out how to convince my app to use CommandEventArgs in a regular OnClick event!  I was like “If I can use CommandName and CommandArgument in my LinkButton tag, HOW THE HELL am I supposed to get them fed into the click event!!?!?!”  Well, now I know.
  • If you’re using a GridView to display a list of items, you can use Container.DataItem.Index to display the items’ index in the collection.  It probably works with other things like DataGrid, etc.  You can also use it as an argument, thus: <asp:LinkButton … CommandArgument=’<%# Container.DataItem.Index %>’ />  – remember that it’ll come across as a string or object in the argument, though.  Just do an int.Parse() or whatever.

My nine-year-old outproduces me.

In Uncategorized on July 29, 2008 at 3:48 pm

My boy Max has posted his Flash version of the Spore Creature Creator for people who can’t run the real thing.  It’s really, really cute and I’m amazed as his technical prowess.

http://www.carrotandkaret.com-a.googlepages.com/max%27sblog


A Change in Direction

In Uncategorized on July 14, 2008 at 3:57 am

I’m really damned bored with the game as it is right now.  I’m not going to finish it just to finish it.  In its current state, it would be an exercise in programming tedium.  It’s time to bring in the creative big guns: my kids.

I was thinking about making it the same sort of game, but more action-focused, and with the boys (9 and 7 year-olds) doing the art work.  Max came up with a great name – “Space Drawn”.  We might put it on a notebook paper background (but that’s been done before…we’ll see).

I also want to come up with some unique angles on the game play.  The mechanics of the thing needs to be new and different.

Stop with the Silverlight 1.0, already!

In Uncategorized on July 14, 2008 at 3:10 am

I have an RSS feed from Silverlight.net that supposedly lets me in on the latest news, etc. about Silverlight.  A couple of days ago, this gem popped up: “lynda.com Silverlight 1.0 Essential Training”.  (Am I going to link to it?  No.)

Why?  Oh, why do we have Silverlight 1.0 tutorials making the news?  Why are people posting new ones?  Why are people posting old 1.0 tutorials they’ve just found?  Silverlight 1.0 wasn’t even a commercially viable product!  Silverlight 1.0 skills will never be sought after!  Well, barring self-fulfilling prophecy, anyway.  I mean, if the net keeps getting cluttered with 1.0 crap, guess what everybody’s going to know?

I think in the interest of getting Silverlight (1.0, or 2.0 beta 2, or 3.7 rc2, or what the hell ever) off the ground, Microsoft should PURGE its websites of SL 1.0 material.  I realize that some of it is pertainent, namely the XAML stuff…but the rest of it is going to do nothing but confuse the hell out of people just getting into it.  It’s not to late to nip the 1.0 in the bud before it pollutes everything.

I realize that there have been oodles of tutorials, videos, blah blah made about Silverlight 1.0.  I’m sorry, but it needs to go.  Much like we let go of phrenology as barking up the wrong tree, so must we do away with SL 1.0.

Now if you’ll excuse me, I need to figure out why my SL 2b2 project has people thinking is SL 2b1…

“New Tab” Syndrome

In Uncategorized on July 11, 2008 at 8:36 pm

When I’m browsing, I open almost everything in a new tab.  I used to open stuff in a new window, but now with the incredible advancements made in the areas of Multiple Document Interface as Applied to a Web Browser (after only 10 years or so of web browsers not having the capability), I end up having about 7-10 tabs open at any given time.  I just seem to never want to close the originating page until I’m absolutely done with it.

This, of course, can lead to memory issues – and I’m not talking just about RAM.  But RAM is an important consideration when multi-tabbin’ it.  One of the primary reasons I use FlashBlock is because during any given browsing session I would have so much Flash going on that it would crash my browser.

MaxiVista: Streamlining the viewer laptop

In Uncategorized on July 11, 2008 at 8:14 pm

MaxiVista has turned out to be one of the most useful programs I’ve ever installed.  It can turn an old laptop into a much-needed extra monitor for your main computer, and it’ll let you remotely control a computer as well – you can just mouse right over to the other machine’s screen as if it were part of your desktop.  It shares the clipboard with the other machine, too.  Sweet.

I scrounged an old, clunky Toshiba Satellite Pro at work and put it to use as a 3rd monitor there (along with my 19″ LCD I brought from home).  What has bugged me for a while was that the hard drive would tick every few seconds.  So I did a little investigating using FileMon and such and found some old apps hanging around.  Deleted.

I’d like to nuke’n'pave it and put a lean install of XP on it.  Right now it has Windows Server 2003, and even though I’ve disabled just about everything I can, I can’t help but think that there are still miscellaneous server-y type processes lurking in the background.  I even took out the CD-ROM drive since it showed up in the “safely remove hardware” list.

I’m going to do a little investigating this weekend to see which operating system (XP or Server 2003) can run the leanest.  Unfortunately, Win9x variants are out of the question.  Vista, I’m thinking, can’t even be considered since it’s notoriously resource-hoggish.  I’m not going to look at Win2k, either, since XP and 2003 are refinements.  So it’s not going to be completely scientific or all-inclusive (i can’t use any *nix variants, for example).

Ships

In Uncategorized on July 9, 2008 at 6:25 am

I’ve added ships to the game.  They don’t do much yet, but they appear in-world and on radar.  I changed the player’s ship to something I whipped up quick to look like a small shuttle; a starter ship.

I need to flesh out the Ship class so it has all the necessary properties and behaviors I’ll need…type, image used, armament, cargo, faction/alignment, “hostile” flag, hit points, shields, speed, velocity, etc.

Locations and Radar

In Uncategorized on July 2, 2008 at 6:01 am

I added the locations (planets, moons, space stations, etc.) to the screen, and I’m about half done with the radar.  The max velocity has been cut from 20 to 10 px per frame.  It’s a bit easier to control.

I’m freekin’ thrilled about the radar.  I’ve been thinking about how that’s done in video games forever.  What I’m doing is scaling down the game world by a factor of 75…and that’s adjustable, of course.  I’ll have zoom in/out buttons on there pretty soon.  I stayed up a bit late to get the radar working, and it paid off.  It was the fulfillment of a lifelong dream when I pointed the ship toward a distant planet on the radar and saw it come into view on the main screen.

I need to learn how to use clipping in Silverlight to hide the radar blips that are outside the intended visible area.  I could turn them off manually, but that’s one more if statement to slow things down.  The way I’m doing the radar probably isn’t the most efficient anyway, but I’ll refactor it later.

The locations are stored in an XML file that has their coordinates, name of the corresponding image, and a brief description.  The same file contains the commodities I’ll use later in the game.

The consensus with amongst my work buds is that the steer-by-mouse needs to go, in favor of key controls.  I’m inclined to agree.

Latest version (a3) here.

Next steps:
- come up with a name
- make some graphics
- get the radar clipping done
- add some enemies to dispatch

Inertia fixed

In Uncategorized on July 1, 2008 at 5:24 am

Check out the latest version here.

After much thought and messing around, I realized that I needed to control the total velocity of the ship instead of trying to control the X and Y amounts separately.  So now I’m checking the velocity using Pythagoras’ handy theorem (a squared x b squared = c squared) and then scaling back the vector when it goes over the limit.

i still have some polishing to do, but here’s the code real quick…

double thrust = .27;

double velX = _playerVel.X;
double velY = _playerVel.Y;

double newX;
double newY;

double curRot = GetRotation();
pnl0.Text = “rot: ” + curRot;

Utils.CalculateMovement((int)curRot, thrust, out newX, out newY);

velX += newX;
velY += newY;

_playerVel = new Vector2D(velX, velY);

double veloc = Math.Sqrt(Math.Pow(_playerVel.X, 2) + Math.Pow(_playerVel.Y, 2));
pnl3.Text = “vel: ” + veloc;

double testVel = 20;

if (veloc > testVel)
{
double scale = testVel / veloc;
_playerVel.X = _playerVel.X * scale;
_playerVel.Y = _playerVel.Y * scale;
}

Now, fly around the galaxy yelling “Git some!  Git some!”  I’ll have something for you to shoot at pretty soon.

Inertia

In Uncategorized on June 27, 2008 at 5:52 am

More futzing with the “drift” on my game.  I believe the correct term is “inertia”.  I really need to read that “pysics for game developers” book.

i simply took the ship’s current rotation and generated a vector from it based on an arbitrary thrust value, then added that to the ship’s current velocity vector.

like so:

CalculateMovement((int)curRot, .3, out newX, out newY); // this function ripped off from Silverlight Rocks

velocityX += newX;
velocityY += newY;

_playerVel = new Vector2D(velocityX, velocityY);     // i then use this vector to move my background layers, as well as the player’s position in the game universe.

And I have a check in there to make sure the ship doesn’t go too fast in any direction.   Before I had the check in there, the thing could go to warp speed in a few seconds.  It was a good test of my starfield generating algorithm, anyway.

So now I’m slipping and sliding all over the place.  It looks really good.   I’ve found a bug with my min/max check that I knew would happen, though.  More thinking and tweaking before I upload a new version.

Solving the velocity problem

In Uncategorized on June 25, 2008 at 3:05 pm

Last night I fiddled with my game’s physics a bit and I came close to a method of providing “drift” to the player’s ship when you change direction and add thrust.  The previous version instantly changed direction but maintained the same speed – not realistic, not elegant, and highly dangerous.  (Instant 180 degree turns would probably turn your crew and cargo into a nice thick paste coating the rear wall of your ship.)

Here’s the solution I came up with after playing Three Card Monty with the variables (I am not a math person by any means)…

currentHeading – ((directionShipIsPointing – currentHeading) * arbitraryThrustValue) = newHeading

This works great for the most part…but a problem arises when you turn the ship from, say, 5 degrees to 350 degrees…my algorithm interprets that as a change of 355 degrees, and thus the ship bounces backward for a second before coming to its correct course.  I won’t bother posting the actual code here since it’s WRONG!

Oy!  What to do?  Fortunately, Avi Pilosof just posted a thorough, illustrated and wonderful set of blog entries about this very thing.  I cought it via Silverlight Cream.  So I’m going through that and I’ll rework my physics using vectors instead of basing everything on rotations.  This will help me out with Second Life programming, too, I’m sure.

Password Guidelines

In Uncategorized on June 24, 2008 at 4:24 pm

Here’s a password message I’m expecting to see in corporate use fairly soon:

Your password will expire in 7 weeks.  Would you like to change it now?

Passwords must contain at least 20 characters, including 3 uppercase and no more than 5 lowercase characters.  Characters may not be repeated.  Passwords cannot contain any characters used in your last 8 passwords.  You must use at least three non-English (US) characters and passwords cannot contain any dictionary words from any actual or imaginary language (including Klingon, Huttese, Proto-Eldarin, or Quenya), nor can your password be phonetically construed to contain any dictionary words.  Passwords must conform to the syllabic pattern of Haiku, or in some special circumstances, Senryu.

Moving backgrounds

In Uncategorized on June 20, 2008 at 4:35 am

I was using a pretty lame technique to move the background starfield under the player’s ship and the more I struggled with it, the more I saw its flaws.  I had 4 panels, each was the same size as the game screen and a pretty nice starfield pattern.  I would move the panels according to the ship’s velocity and direction.  When one panel went offscreen, I would move it to the opposite side so it could be re-used.

My primary flaw in logic was that I had a cyclic error when testing to see if the panels’ x,y coordinates were less/greater/equal to the boundaries of the game.  I’d detect that panel 1 was off-screen, then place it in a position where it would then get picked up by another off-screen check and guess what?  You’d never see that panel again.  The equal-to part of the check was the main problem.

Anyway, I decided to use two overlapping randomly-generated starfields instead.  My offscreen checks are now nice and tight, and I can get funky with what happens in those checks (like change the star’s color or whatever).  The double-starfield looks sweet, too.  The top layer has 3-pixel stars and the bottom has 1-pixel stars.  The bottom layer moves a bit slower.  The effect pleases me.  I am pleased.  Yes.

Your first taste of Splodge Pre-Alpha .0001

The ship is ripped off from Lost Garden’s free game graphics collection.  I highly recommend Lost Garden for anybody noodling about in the indy game cosmos.  I’m probably going to use some of my kids’ art as soon as I get it digitized, or they’ll make some for me on their ‘puters.

Anywhooo, this is your first chance to test out Splodge Pre-Alpha v0.00001!  Some notes before you check it out:

- Click yer left mouse button to fire, use your mouse to aim/steer.
- Press W to accelerate, S to decelerate.  I don’t have fancy physics worked out so that your velocity/direction is dampened correctly when you turn and burn.
- I don’t have thrust sound or graphics yet.
- The laser shot sounds get clipped occasionally.  Still working on that.
- The stars are really cool.  Just keep that in mind.
- Be careful using Silverlight in Firefox (especially FF3, apparently).  I’ve seen it crash several times, and not on my stuff, but on the official Silverlight.net site mostly.
- This build was made with Silverlight 2 Beta 2.

Some steps forward

In Uncategorized on June 13, 2008 at 3:34 pm

Last night I decided that my Silverlight game wasn’t heading in the direction it should, so I went back to a previous iteration with some insights from my recent effort. I’ve had a problem getting the vision of the game solid in my head.

At first I had built a top-down, ship-centric shooter but I decided to try a map-driven, simpler game where you click on planets and then do your trading. I had the map part working nicely, but man it would have been a pretty dull game.

So mow I’m going for a model that’s much closer to Escape Velocity…top-down, player-in-the-center pew-pew game with a galactic map, commerce and weapon/ship upgrades. Last night I was able to (with the assistance of my older boy, Max) get a starfield moving under the ship, and move the ship around using velocity, etc. I still need to do the physics for thrust/velocity/turning, but for a guy that’s used to doing event-driven programming all the time, seeing this real-time action is pretty exciting.

One of the aspects of the game that I’m apprehensive about is building the AI for non-player ships (NPS? hehe). They’ll need to turn, thrust, fire weapons, target the player, etc. etc. Sometimes I think I’m getting a little too ambitious, but that’s what I need to do so I don’t get bored.

Where I am Now:

  • The game universe is 30000×30000 pixels. I generate a background starfield using about 7,000 randomly-placed white circles.
  • player ship in the center; a target reticle is moved by the mouse, which causes the ship to rotate to point at it.
  • ship fires lasers when the left mouse button is clicked. no sound yet.
  • ship increases velocity when the W key is pressed. the starfield moves in relation to the ships velocity/direction.
  • Map currently represents one solar system. You can click on a planet and your ship ( a totally different ship ) appears there.

Next steps:

  • Create the background more efficiently. The stars take too long to generate, IMHO, and maybe take up too much memory. I’m thinking a tiled bitmap would be better. Requires investigation.
  • Get the thrust/maneuvering to be fluid. Add some graphics for thrust, sound too.
  • Create a new data hierarchy to have star systems with planets/moons/stations. Each system should have a security rating, description, etc.
  • Refactor the map to show star systems and enable jumping between those systems.

Pet Peeve Mitigation 1

In Uncategorized on June 11, 2008 at 9:19 pm

When I’m banging out some CSS in Visual Studio, I like to keep my attribute values tabbed nice and neat. One of the problems I’ve had in VS is that when I try to tab-indent my values, it causes Intellisense to select the first available value for me, which is rarely what I want to happen.

I have found, however, that if one uses a Shift-Tab you can get out of the Intellisense menu once it drops down. After that, you’re free to hammer on that tab key as much as you want. I’ll upload some pics and code samples to explain a little better.

RPGs, XML documents, stuff, things

In Uncategorized on June 1, 2008 at 6:50 am

Going from my happy little web-based world (with forms and spans and whatnot, with C# on the backend and JavaScript handling the stuff in between) to the XAML/Silverlight world has been like switching classes in an RPG. Those of you familiar with role-playing games of any genre will know what I’m talking about. You get really used to playing a rogue or a warrior, and then all of a sudden you decide to try out a warlock or mage. The way you play is completely different from class to class.

So I’m not only dealing with XAML newbtasticness, but I’m also struggling due to the fact that Silverlight 2.0 just doesn’t yet have the same documentation/tutorialization/discussion board saturation level as more established (I don’t dare say “legacy” hehehe) technologies. It’s almost got a hobbyist feel to it, and I kinda like that.

Anyway, I’ve been avoiding the ‘light for the past week due to illness (pinkeye and strep simultaneously!) and becuase I couldn’t figure out how to do something that would be dead simple for me in regular C# winforms/asp.net…how to read an XML file and use its data.

After some rigorous searching I finally figured out the following:
1. How to stash an XML document into your Silverlight app the right way: Create the document in your project, then right-click on it, go to Properties and set the Build Action to “Embedded Resource”. Now your document will be neatly tucked away inside your code file when the user downloads it.

2. How to read said XML document: First off, you’ll need to add the System.Xml.Linq namespace to your References in your project. Then, make sure you add your “using System.Xml.Linq;” statement (or VB equivalent) in the file you want to do XML magic with. THEN…do this:

XmlReader rdr = XmlReader.Create(this.GetType().Assembly.GetManifestResourceStream(“YourApplication.YourFileName.xml”));

You’re creating an XmlReader that grabs the file that you tucked away inside the application. Of course, you might want to toss this into a using block so it cleans up better, but you get the idea.

THEN…create an XDocument (a fancy Linq XmlDocument) like this:

XDocument xdoc = XDocument.Load(rdr);

see how it loads the content of the reader? nifty.

THEN…use Linq to XML to grab the stuff you need out of the XML. I’m not gonna cover that on this post. ScottGu does that much better. Download his example app and study it.

The part that was driving me crazy with this was the whole XDocument thing. I read some articles that said XDocument wasn’t even supported in Silverlight! Maybe they meant v.1? Anyway, I finally saw ScottGu mention that you have to reference System.Xml.Linq, and there was much joy in my heart as I finally saw all the pieces fit together.

I realize that what would probably help alleviate some of my frustration would be to go through all the tutorials I come across step by step and build my knowledge before I start my own projects…but man, that bores the hell out of me.

Silverlight/VS 2008 quirks driving you crazy?

In Uncategorized on May 25, 2008 at 5:58 am

One of the things I’ve noticed about editing XAML files in Visual Studio 2008 is that sometimes you’ll need to close the file you’re working on then re-open it in order to see certain changes take effect, in particular when you change the ImageSource attribute on an element.  That took me a while to figure out.  There are few things more frustrating than stumbling on a bug in the IDE when you’re trying to learn an entirely new way of building apps.

Another interesting thing is that you apparently need to specifically tell elements to be a certain height/width.  For instance, if you have an element inside another rectangle, don’t expect it to inherit the size of its parent…it won’t fill that space unless you tell it to!

Back in SL

In Uncategorized on May 23, 2008 at 6:46 am

I sell stuff in Second Life. My two main avatars, Buckminster Rust and Serious Wood, have been offering quality virtual goods since mid-2006. A couple of months ago I decided that I’d withdraw Bucminster from SL, mainly to just stop getting all those group emails and spam from sex clubs. Sales were dropping off anyway, and I figured I needed one fewer complication in my real life.

Well, it turns out that I really miss having the extra little bit of moolah I made every month, and I started getting emails from people wondering where they could buy a Primsworth, my greeter robot. I actually got more email from potential customers than SL spam. So last week, I upgraded Buck to a premium account (Serious always has been a premium) and bought a new chunk of land for Rust Automata. It took a couple of days, but my new (admittedly hideous) shop is getting traffic and making sales.

If you’re in SL, stop by Rust Automata sometime.

Howdy, howdy, howdy.

In Uncategorized on May 23, 2008 at 5:25 am

Finally, a place where I can claim First Post.

I’m currently working on a Silverlight game based on the classic “Solar Wars” space commerce/cargo game (which is itself based on Dope Wars, et al). Another inspiration for this game is Ambrosia’s Escape Velocity. I spent countless hours being a galactic menace in that game. Other games in this genre are Elite, Privateer and Freelancer. I plan on eventually having a networked, persistent universe…but that’s far in the future. My dream is a low-rez, casual version of EVE Online.

My project is a top-view game with two main modes: a map of the solar system or galaxy, and a commerce mode where the player can buy/sell commodities. The player tries to buy low, sell high, and transport special cargo in order to make money to upgrade his/her ship in order to make more money, etc. ad infinitum.

The first iteration of the game will be strictly event-driven. Click on a planet/space station to travel, and then do your commerce, maybe buy some upgrades or take a mission, then it’s back to the map. The player will start with a small, unarmed shuttle capable of carrying a small amount of cargo.

I have no idea what to name the thing yet. I’m sure my 6 and 8 year old boys will come up with something catchy.

So far I’m enjoying Silverlight and XAML.  It’s like working with any other taggy paradigm (html asp.net, xslt, etc.) so I’m comfortable with the angle brackets and attributes.  Man, it’s verbose though.  And a bit odd.  The first thing that really showed me how different XAML is from HTML is the way tables (grids) are built…the grid is fully defined before any content is added.  Then when you add the content you tell it which row/column to pop into.  Pretty nifty.

I can’t wait to get into doing some styles in XAML.  I can tell it’ll be handy as hell (much like CSS), but I can’t quite wrap my head around it yet.  I’ve only had a few hours’ experience so I’m a bit clumsy when it comes to remembering all the setter property thingies and whatnot.  Fortunately I found a tool called Kaxaml which should help quite a bit.  If you’re new to XAML or just want another wicked-handy tool, I highly recommend it.  It’s free (as in beer).  May the gods bless Robby Ingebretsen.