Brad Wardell's Blog


DesktopX: External scripts

Published on Wednesday, June 14, 2006 By Brad Wardell In DesktopX Tutorials

3.2 Preview Guide

Our story so far...

DesktopX was the first program (for PC or Mac) that enabled end-users to easily create desktop objects that could be combined together to form mini-programs commonly referred to as widgets (or gadgets) or used to design an entire desktop environment.

Over the past few years, widgets and gadgets have become very popular with Microsoft, Yahoo, Google, and others all getting into the act.  In power, no other platform can deliver what DesktopX can do.  With that power, however, comes complexity.  Stardock has continued to focus on ways to make it easier for developers and artists to fully harness the power of DesktopX.

Another important event is the coming of Microsoft gadgets.  Microsoft's gadget concept is very similar to what DesktopX can do.  Stardock's long-term goal is to enable users to export their DesktopX creations as Microsoft gadgets.  The powerful development tools and underlying DesktopX technology (called DirectGUI) will be able to be used to create Windows sidebar gadgets and more.

The first step in that path is DesktopX 3.2 which has two main new features:

  1. Windows Vista compatibility.  Content made with DesktopX 3.2 will work on Windows Vista.
  2. Scripts can now be externally located making it much easier for content makers to create their own library of scripts.

A new development environment

Most end users won't really notice the difference between 3.1 and 3.2.  What they will notice is an increased variety in the types of scripts and hopefully, more content from desktop, gadget, and widget creators since the process of creating "Stuff" is streamlined.

For this example, I am going to make a dictionary widget. Please note I am not an artist. I'm a software developer so the graphics in this will be painful.

Example: Dictionary widget

One of the advantages DesktopX has over other "widget" enablers is that it provides a GUI for most of the common, tedious work.  You don't, for instance, have to (though you can if you want) define images and objects using some text editor.  In DesktopX, it's all GUI driven.  Try to create a dictionary widget as easily in any other platform.

Step #1: Background window

From the DesktopX Helper toolbox, I press "Create object". Then I go to its properties and press the change appearance button which opens a dialog asking me to provide the image. I provide the image.

Step #2: Provide the text input box

The user has to have something to type their word they're looking up into. So I go through the same object creation procedure as before except for this:

I press "New" on script which opens up the script editor box. Then I choose ActiveX control. Then I choose DesktopX edit control. (I agree, we should have really common controls not require the user to go through this but this also exposes users to all the possibilities -- your computer is full of objects already. DesktopX lets you make use of them easily on your desktop).

Then just exit the dialog.  Now, HOLD DOWN THE CONTROL KEY when you click on that object and you can resize it. 

Step #3: Create the text output area

Now we need the area to output the definition. So go through the same object creation method as before (you can also create a new object from the DesktopX system tray item). One change though:

On the "States" page change the appearance from Image to Text.

Now, you can get pretty smug because you can visually change all the text settings from this GUI rather than mucking with it in some ASCII text editor.  Get it the color and size you want first.  And thinking ahead here, you will want to make sure it word wraps. So go to the summary page and set its width in pixels. I'm going to set it to 400.

Anyone who's made widgets or gadgets knows how annoying it can be to do this in script.  By contrast, the total time taken so far is about 30 seconds to create this widget (other than making the tutorial).  Did I mention our goal for Windows Vista is to allow creations to go onto the Windows Sidebar?

Step #4: Write the script

This is where we part ways with really casual users. If you're not a developer, this part may be confusing.

The first thing we need to do is give these objects some names so that they can talk to each other. On the summary page is the ObjectID. Name your objects something you can remember (like Dictionary_Text) on the object we just created.

I'm going to write two scripts. The first script is a tiny one that I'll attach to the edit field.

Here's my script:

Sub Control_OnKeyPress(AsciiValue)
 If AsciiValue = 13 Then
     DesktopX.ScriptObject("Dictionary_Text").LookItUp
 End If
End Sub

All I'm doing is looking for Ascii value 13 (which is the enter key basically) to be pressed and then  I'm going to call "LookItUp" in my text object which will grab the contents and send it to dictionary.com.  I am going to name the entry field object "Dictionary_EntryField" so that I can refer to it.

The second script is more complicated and here is where DesktopX 3.2 starts to shine -- dynamic scripts.  I'm going to write the script in Visual Studio.  Special thanks to Sranshaft who made a dictionary object that I could use as the basis of this.

The one annoying thing I ran into that we're trying to think of a more convenient solution is that when you change your script in Visual Studio, you have to go to the object that is using it, right click on it, and toggle "script enable" back and forth in order for it to update what's there.  If anyone has any preferences on how we essentially "reload" the script to be "recompiled" on the fly, let us know.

Anyway, so I took Sranshaft's dictionary script and modified it.  It's not very long. In fact, most of it is just replacing the junk in the response with blank characters (i.e. getting rid of the HTML characters).

Step #5: Connect the script to the object.

Now I need to go back to my text object and connect the script:

I wrote my script over in my "c:\projects\dxdev\scripts\dictionaryscript.vbs". 

So why do it this way? Why have your scripts be external to the object? In DesktopX 3.1, you couldn't. The idea was to have scripts be totally integrated into the object.  The problem with that is re-usability. It's a lot easier for developers to have a library of scripts that they make that they can then just refer to.  Over time, depending on feedback and interest, we can make this even easier to do.  The other reason to do this is to prevent catastrophic loss.  For instance, while I was modifying this script and testing the output, I got a huge overflow that brought down DesktopX.  No problem, I just restarted DesktopX and it remembered my last state. But there's a dialog that pops up asking if you want to erase everything (in the event you get yourself into an endless loop or something). If I had answered that incorrectly, I would have lost my work.  But with external scripts, I don't lose all my work, the scripts are still there on my hard drive, easy to find.

External scripts also benefit for users who use real-time data protection programs like KeepSafe which will create revisions of your creations so that if you really screw something up, you can go back to a previous version (and if you don't have KeepSafe already installed, quit reading this and go get it RIGHT NOW).

Step #6: Clean up and finish

Now it's just a matter of taking the 3 objects I created and putting them together.

This just means dragging the 3 objects around on screen until you've positioned them the way you want and then grouping them. Don't forget to hold the CTRL key down when you are moving the ActiveX control.

I just drag select the objects, right click and choose "group".

And then voila.

Step 7: Export it to a widget.

DesktopX 3.2 widgets are .EXEs. So as long as you have DesktopX installed, you can use them like any EXE.  Using Keyboard LaunchPad I then assign them a hot key so that when I need something like currency conversion or dictionary lookup or whatever, I just hit a hot key to bring it up.

To export as a widget just select all the objects, right click, and choose Export as widget which will take the user through the steps of assigning it an icon and the file name.

And voila.

We're still working out some of the kinks such as how to handle external scripts when it comes time to package them. Do we allow users who import widgets that use external scripts to see them? Could this be used as a way for people to protect their code? Hence, why DesktopX 3.2 is still in beta. But you can see where we're going.

DesktopX 3.2 is in beta. If you have Object Desktop, DesktopX is one of the programs that comes with it (along with WindowBlinds, IconPackager, Keyboard LaunchPad, etc.).

Hooray for Gamers!

Published on Tuesday, June 13, 2006 By Brad Wardell In GalCiv II News

This month's Computer Gaming World has a letter to the editor giving us kudos for not putting CD copy protection on Galactic Civilizations II.  In it, he says that not having copy protection helped make his decision to get the game.

As a gamer, I have a similar point of view. I lose my CDs. I scratch my CDs. My desk is a mess.  Nowadays, with games requring 3 or 4 CDs (I wish retailers would universally accept DVDs but that's a different issue), keeping CDs around to play is annoying.

I don't have exact worldwide sales numbers for Galactic Civilizations II, but we do know they're well over 100,000 units sold worldwide in the first 90 or so days.  That number is about as high as a game of our distribution level can sell in that time frame (units sold is a function of popularity X outlets available in the same way that a movie's first weekend take is a function of how well received it is X how many theaters it's showing in).

The question about copy protection is straight forward in our view: Does CD copy protection generate more sales due to less piracy than it costs in sales due to people on the fence deciding not to purchase.

CD copy protection to me is a lot like the issue I have with shareware. I don't mind registing shareware. But I know that I'm going to lose that serial # at some point. IF the site has a very very simple way of looking me up and sending me my info that is very apparent, then I'm inclined to buy it.  Similarly, not having CD copy protection helps protect my investment -- knowing I'll be able to play the game even if I lose those CDs. 

In GalCiv II's case, our upgrade system even has electronic registration. When someone upgrades to one of the new versions, they enter in their serial # that came with the game and it automatically registers them. So even if they lose the CDs AND their hard drive dies, they can re-download the entire game from us (not just updates the ENTIRE GAME) even yeras from now.

For these reasons, we are convinced that game developers/publishers can increase their sales by focusing on SERVING their customers rather than focusing on thwarting pirates. If someone is paying $40 for a game, they should be treated with respect, not with suspicion.

Design your own enemies

Published on Monday, June 12, 2006 By Brad Wardell In GalCiv Journals

When I play a strategy, whether it be single player or multiplayer, the most important  thing to me is being able to have some say over how the game will be played out.

One of the reasons some people like multiplayer is that you get a lot more variety. But having played multiplayer for years and years (I love multiplayer personally) there really aren't that many strategies. At least, not when you get good at it. 

The problem with computer players is that players have very little control over what they get.

What we, as developers, need to do is empower the user. Empowering doesn't mean writing a bad AI and then throwing up ones hands and saying "Look, it's scriptable". By empower, I mean that there should be a lot of different options available to players when they set up their game.

Imagine an "advanced" button next to each player that let the player pick:

  • Resource Bonus (-50% to 200%)
  • Aggression Level (1 through 10)
  • Strategy Type (A, B, C, D) where most players would wnat to choose random but it would have various general strategies that TBS's and RTSs have.
  • Intelligence (1 through 10 which the higher the #, the more CPU it would use).

There are other factors as well that players might want to mess with that I'm not thinking of.  But what I'd like to see is the ability to have a lot more control of how my opponents play so that I can get a greater variety of playing experiences.

Blog: So what kind of community do you want?

Published on Monday, June 12, 2006 By Brad Wardell In WinCustomize News

Summer approaches and June is when we start to put together all our plans for the next year. It is traditionally the slowest time of the year as people go outside and find other things to do.  Things start to get interesting again usually around August.  Right now we're working on a new website for Stardock then the same team will start to re-skin WinCustomize.com.  Our hope is to make it so that user swill be able to eventually skin the site themselves (or at least WC subscribers).

We're going to have to make some tough decisions on what skin sections to highlight and which ones to not be on by default.  If you look closely on the skin gallery list on the left, you'll see a little wrench thing. If you click on it, you can control which skin galleries appear by default and which ones don't.  So users can already control this.  But some galleries are clearly on the way out. 

It's a time of change for our community. The community grows and as it grows, new people come in with their own ideas and preferences.  Old favorites like Litestep (for instance) start to fade away.  Litestep is likely to stop being a default gallery shortly.  What about Winamp and for that matter, the entire "skinned" media player movement. What's the future of that? Gadgets and widgets have taken some of the wind out of those things.

Another long-argued issue in the skinning community revolves around fair-use and copyrights.  WinCustomize.com has long had, by far, the strictest rules on copyright of any major skin site. We've tried to protect people's copyrights very aggressively.  But at the same time, we want users to be able to share and download things that they want. This site doesn't exist in a vacuum. Our friends at deviantART have over 22 million items in their galleries.  It's a different kind of site from WinCustomize so it's not quite an apples and apples comparison. But they don't have moderation.  So we try to find a happy middle ground where rips and such are quickly removed but at the same time we allow fan art.

I've written a post here that outlines our policy in more detail with regards to copyright, fair use, and rips.

Going forward, skinning is going to become much more popular than it is even today.  And this year, our job is to fix up and enhance the infrastructure we have on WinCustomize.com to deal with what is almost certainly going to be an unprecedented level of traffic when Windows Vista comes on the scene.  With so many new galleries, new software, and new users, we need to start thinking about -- all of us -- what kind of community we want to be. 

 

Society Status Report

Published on Monday, June 12, 2006 By Brad Wardell In Society News

Society continues to move along but at a very slow rate.

There's two ways of making a PC game.  You can build a large team and create the game in 18 to 24 months or you can have a smaller team and build it over 36 to 48 months.

Until we recruit more game developers, we're having to take the latter role. 

To give you an idea of the scope you have a game that needs a pretty good sized development team for the engine, features, multiplayer.  You also need a very large art team.  But you also have to have a large IT team to build the server infrastructure.

We are in the process of hiring more developers but there will be a ramp up time.  What I want to do is avoid the label of "vaporware" and make sure we're very up front -- we are working on the game but this isn't something that's going to be out next year or something.

We have one full game development team presently at Stardock.  Right now they're working on the expansion pack for Galactic Civilizations II.  Then they will be working on The Political Machine and other expansion packs for GalCiv II.

My job is to help build up the Society team. To find developers who are interested in coming to Plymouth Michigan to make a truly remarkable game. 

Stay tuned.

Reporting Rips: READ THIS!!!

Published on Monday, June 12, 2006 By Brad Wardell In Permissions

There has been some question with regards to users posting about potential rips. 

WinCustomize.com supports users reporting violations of other people's copyrights.  The forum "Permissions" (general->permissions) exists to that purpose (we are working on a new forum layout that will make this easier).

There was confusion in this thread:

https://www.wincustomize.com/forums.aspx?ForumID=144&AID=119968

Here's the deal:

WinCustomize allows FAN art.  This isn't open to debate.  If someone wants to upload a Superman wallpaper that they made, that's fine. If they want to submit an X-men wallpaper that is fine.  If there is an issue with it, Marvel, Warner, whoever will let us know.  However, in "real life" there are thousands of fan sites that post the same thing.  WinCustomize does not exist in a vacuum.

We allow fan art because no one will be "confused" or "misled" by what the fan art is about.  There is no confusion over the ultimate owner of the trademarks or trade dresses involved.

Ripping, however, is something different.  No individual skinner or icon artist has the fame or distribution in which a "casual user" would recognize their work as opposed to being the work of someone else who uploads it or uses it in their product.

WinCustomize takes copyright and trademark rights very seriously. So if someone sees a product, service, website, skin, or theme that is making use of another individual's work that they don't think they have permisison, you should feel free to post it here to draw attention to it.

In the past we have seen our own content made use without our permission.  We have seen Paul Boyer's icons used without permission.  We have seen our own skins used without permission.  So it is clearly a problem and as a community we should work together.

I realize there are some people who have much more stringent definitions of what copyright protection means and I realize there are those who have much looser views on what copyright means. This is not the place to debate that.  We have struck a middle ground (so no one will be quite happy).

Hopefully this clears up confusion.

Galactic Civilizations v1.2 release date set

Published on Friday, June 9, 2006 By Brad Wardell In GalCiv II News

Fixes, tweaks, and enhancements have been rolling onto the build machine all week and we're pretty close to being ready with 1.2.  But we want an extra few days to test all this.

Galactic Civilizations II 1.2 is a free update to all GalCiv II owners. But 1.2 is of particular significance because it has a LOT more content than what an update normally would have.  Besides a significant change in the combat system, lots of UI changes, AI enhancements, etc. v1.2 includes advanced modding support including a Stardock developed mod featuring a new set of alien races, custom planets, new technology tree, new UI, etc. all for the "example" mod.

We're going to spend the weekend and next week..ahem "testing" the game (don't worry, we're highly paid professionals, we'll be fine). Then on Thursday we'll release the new version via Stardock Central and as a stand-alone download.

You can see this journal entry for some screenshots of what we mean.

Stay tuned!

WindowFX 3 released

Published on Thursday, June 8, 2006 By Brad Wardell In GalCiv II News

Stardock has released WindowFX 3.0.  WindowFX adds special effects "fx" to your Windows experience.  Effects include shadows under windows, min/max/close/open animations, window dragging effects, window scaling, window tiling, alt-tab task switching options, taskbar preview thumbnails, and much more.  WindowFX when combed with WindowBlinds can give your Windows XP system a next-generation Windows look and feel. The two complement each other (and are developed by the same team within Stardock).

WindowFX 3 takes advantage of your video card to provide the effects without losing down your computer.  Stardock does caution that it does require a reasonable good video card with modern drivers to get the most out of.  WindowFX is, bar none, the most advanced visual enhancement utility for Microsoft Windows. No other program comes even remotely close to what it can do. 

You can download it right now for free and see for yourself.  The full version of WindowFX is $19.95 or can be purchased with Stardock's Object Desktop which is $49.95 and includes WindowBlinds, IconPackager, WindowFX, DesktopX, RightClick, SkinStudio, IconDeveloper and much more.

WindowFX's home page:
https://www.stardock.com/products/windowfx

Screenshots:
https://www.stardock.com/products/windowfx/screenshots.asp

WindowFX 3 released!

Published on Thursday, June 8, 2006 By Brad Wardell In WinCustomize News

Stardock has released WindowFX 3.0.  WindowFX adds special effects "fx" to your Windows experience.  Effects include shadows under windows, min/max/close/open animations, window dragging effects, window scaling, window tiling, alt-tab task switching options, taskbar preview thumbnails, and much more.  WindowFX when combined with WindowBlinds can give your Windows XP system a next-generation Windows look and feel. The two complement each other (and are developed by the same team within Stardock).

WindowFX 3 takes advantage of your video card to provide the effects without slowing down your computer.  Stardock does caution that it requires a reasonable good video card with modern drivers to get the most out of the program.  WindowFX is, bar none, the most advanced visual enhancement utility for Microsoft Windows. No other program comes even remotely close to what it can do. 

You can download it right now for free and see for yourself.  The full version of WindowFX is $19.95 or can be purchased with Stardock's Object Desktop which is $49.95 and includes WindowBlinds, IconPackager, WindowFX, DesktopX, RightClick, SkinStudio, IconDeveloper and much more.

This is a FREE upgrade for existing customers. If you already have it you can download it via Stardock Central, or go to www.stardock.com/support, type in your e-mail address and our system will send your serial numbers and updated download links.

WindowFX's home page:
https://www.stardock.com/products/windowfx

Screenshots:
https://www.stardock.com/products/windowfx/screenshots.asp

I don't have what it takes anymore

Published on Wednesday, June 7, 2006 By Brad Wardell In Real-Time

Years ago, I used to be very "into" RTSs.  I spent countless weekends and weeknights playing Warcraft, Total Annihilation, Starcraft and tons of lesser known RTSs.

And in most of them, particularly the ones with peons, what seperated the top players from the rest was knowledge of a simple game mechanic: Multiplication of resources.  Which translates to - send forces to disrupt the first couple of minutes of production of your enemy and you will win.  We're not talking about "rushing".  What I'm saying is that if you can eliminate even a couple peons getting gold or whatever the resource in question is very early on, it will put them behind the curve for the rest of the game.

When I played competitively, that was always my strategy too.  But as I've gotten older, I don't have the stomach for it.  It's just such a shitty tactic that is only remotely interesting when played against other top players and even then, it all usually boils down to who is most successful in pulling it off.  So I don't do it.

Which means that when I play top players at say Rise of Legends, I usually lose. RoL is a peon game. So a good player will move in with their starting forces and take out a few peons and then move out. The rest is pretty much written barring a really clever move.

Some people object to "rushing".  I don't.  I don't personally rush, but I think rushing is a legitimate tactic and a well designed game will allow players to defend against it.  In Rise of Legends, you can see how many units the the other guy has built early on. So it's pretty obvious when an unskilled player is about to rush.  I had that happen today and wiped the guy out.  One defense canon and a  bunch of purchased forces from neutrals (the guy didn't realize that units acquired at neutral cities don't count as "built" units so I had more forces than he thought).

Other tactics are still key, always know what your enemy is doing.  When someone rushes me, I usually see them gather their force, send them across the map and make sure I have something there to greet them.  Unfortunately, true rushers are usually pretty lame. The rush, having failed, means the opponent is doomed and they typically quit right there.  I never understand those kinds of players, given the pain to get a game going, why end it in 5 minutes?

But like I said, the most effective strategies are the ones that suck the fun out of the game.  I've always loathed the peon mechanic to begin with (no war in history was ever decided by eliminating the civilian population).  In some games, top players will take advantage of glitches in the game such as bad unit AI and such.  RoL does'nt seem to have that issue at least.

So I'll have to contend myself with being mediocre.