Tag Archives: Cursor Lock

Diablo II Mods and Code Stuff

Hello all. My apologies for not updating this website more.  My life has become complicated lately, and in these uncertain times I find it difficult to want to write about it.  A shame really, as the site has never been more popular.  Seems like every time a new game comes out lacking multi-monitor support, I get hundreds of new visitors and users for Cursor Lock; a few weeks ago, it was Cites: Skylines.  And today with the announcement of another new Deus Ex game, my version of the soundtrack is hotter than ever.  It does make me feel good to know that I can produce things that people need, even if it’s only for video games.

Speaking of video game content, I spent a lot of time a few months ago working on a new class for Diablo II.  Well, it’s not really a completely new class, more like a subclass since I only changed one skill tree for the Amazon.  It just really bugged me how the Amazon felt so lame compared to the Diablo 3 Demon Hunter.  It’s really difficult to keep the monsters from swarming the Amazon, so I designed some Demon Hunter-inspired skills to help remedy the problem, such as caltrops, turrets, and smokescreens.  You can see these skills in action in the video below.

I also just wanted to fulfill my desire to do some really hardcore modding for Diablo II.  The game has a rather awkward system for making modifications.  If it were made today, we’d probably have XML files and LUA scripts to work with.  But since it was made 15 years ago, we instead have to settle for massive CSV files.  You can find the Demon Hunter mod on my Diablo II mod page.  And massive props to the Phrozen Keep for continuing to support D2’s modders.

Another thing that bothered me about Diablo II for so long is that when you die your corpse keeps all your equipment on it, and you respawn basically naked and unarmed.  Your only options are to run in, snatch everything off your corpse, and teleport back to town, or rage quit and hope that your corpse returns to town like it’s supposed to.  Obviously, this is almost always zero fun and is why no games handle death like this anymore.

Unfortunately, there’s no way to change this in the game’s CSV tables.  But I didn’t let that stop me.  Every now and then, a problem comes along which must be solved through assembler hacking, and this was one of those times.  But I didn’t really have a clue which function was involved in character death.  So, I just put breakpoints on every function in IDA and attached to the running process.  It took a while of breaking, disabling breakpoints, and resuming, but I eventually narrowed it down to several dozen functions involved in death.  Some functions did death animations, some saved character data, but then I found a suspicious bit of code that would loop 14 times—the number of equipment slots.  This was the code where the game looped through each equipment slot and moved the item from the player to the player’s dead body.  And then there was nothing left to do but some trial and error to figure out where I could safely jump over the offending code and re-enter.  Now the only problem is that this mod will have to be updated every time there’s a Diablo II patch. 😥

Here we see the fateful jump operation to bypass the character equipment being removed.

Here we see the fateful jump operation to bypass the character equipment being removed.

Since then, I’ve been turning back to more PHP/HTML/CSS/JS coding.  I’m working on a project that I can’t disclose at this time but which quite possibly could be my most epic work yet.  Wish me luck in completing it.

Recently, I’ve also been using PHP as my go to scripting language for everyday projects.  A couple days ago, I wanted to be able to pull all GPS image data from a directory and display it in Google Earth.  PHP has file IO, EXIF, and XML libraries, so it was real convenient to bash out a script using that.  Then I realized I had created an account on Github recently to comment on some projects and thought why not just put this code on there.  So I did.  Maybe I’ll add more small projects like this in the future.

Posted in Modding, Programming, Website | Tagged , , , , , | 2 Comments

New Cursor Lock Live

Cursor Lock 2.6 went live yesterday.  Funny enough, I didn’t actually need to change anything but the version number in the lock program itself; that code is proving to be very solid.  But the setup program seems to need constant fiddling since it actually has a GUI.  I’m always trying to make it easier to understand and use.

The biggest change in this version is native support for Windows 7.  I achieved this mostly just by switching to Visual Studio 2008 and compiling for .Net 3.5, but it also needed a small amount of UAC tweaks.  Another major change is to the context-based help system, which used to be in a big, ugly textbox on the side of the window.  Not only was it ugly, but it gave me a limited amount of characters to work with.  In the new version, I’ve switched to a tooltip system that is activated by right-clicking on the feature in question.

And the last big change is something I’ve never done in a program before but became increasingly aware of its need after seeing all the hits and comments on Cursor Lock I get from around the world.  That’s right, it’s localization, or in layman’s terms translations.  I’ve already added a bunch of languages to the installer but have also added support for translations in the setup program.  I’m hoping some native speakers will contribute their translations, but I may do some computer-generated ones if not.  Full changelog below.

  • support for Windows Vista/7 and UAC
  • cleaned up help text
  • added support for translations
  • icons and other UI improvements
  • moved context-based help to tooltips
  • converted project to .Net 3.5
  • logging is now disabled by default
  • updated links
Posted in Programming | Tagged , , | Leave a comment

Cursor Lock 2.6 in the Works

I’ve wanted to do a massive update to Cursor Lock for a while now, but figured I’d scale that back and just fix some lingering bugs for now.  As you can see from the screenshot, I’m also working on better support for Windows 7.  Probably done in a couple weeks.

Cursor Lock 2.6 WIP

Cursor Lock 2.6 WIP

Posted in Programming | Tagged | Leave a comment

Cursor Lock and Steam Widgets

I just did a quick update to Cursor Lock to fix a painfully obvious bug that I somehow overlooked.  Thanks to the person that googled “cursor lock strict mode does not create shortcut” today! 😉

Steam Widget

Also, I noticed you noticed my Steam widget.  I just added it over the weekend and people are already clicking through on the game links.  I did the widget based on my code for Sitewide Recent Images (more about that on my work blog), so it supports the same caching and template options, which the other two Steam widgets on wordpress.org failed at.  I hope to release it over the weekend.

Posted in Programming, Website | Tagged , , | Leave a comment

Using Cursor Lock with Steam Games

I often notice people coming to my site from search queries asking how to use my program Cursor Lock. Of course, Cursor Lock comes with plenty of documentation for most users’ needs. I think most of those people are either noobs that can’t find the documentation, or they want Cursor Lock to do something it doesn’t actually do.

Anyways, there is one circumstance where I haven’t documented how to use Cursor Lock, mostly because I only just realized it myself. However, it can be rather tricky, so here’s how to lock games that must be launched with Steam. These instruction will work for the new version that just came out on April 26 and the previous version.

  1. Open Steam and go to your list of games.
  2. Right-click on the game in question and select “Create Desktop Shortcut”.
  3. Find the shortcut on the desktop and right-click to examine its “Properties”.
  4. For the new version of Steam, look at the “Web Document” tab and then the “URL” box. For the old version, look at the “Shortcut” tab and then the “Target” box. Copy the 5 digit number you see there.
  5. Open Cursor Lock Setup.
  6. Select “Open Program” and then find the path to the Steam executable, usually it will be something like C:\Program Files\Valve\Steam\Steam.exe
  7. Select “Open Program Args” and put in -applaunch xxxxx where xxxxx is the 5-digit number you copied earlier.
  8. Select “Lock Program” and then find the path to the game’s main executable–this would be what one would usually set as the “Open Program” when Steam isn’t involved. If you don’t know where it is, you should start looking under C:\Program Files\Valve\Steam\SteamApps\. You can also use Task Manager to help you find the executable name when the game is running.
  9. You’re done! Hit the “Create Shortcut” button to create a permanent shortcut to the game with Cursor Lock.
news300

Using Cursor Lock with Steam Games

Posted in Gaming | Tagged | 48 Comments

SnakeByte Studios Endorses Obama-Biden

The election will surely be a landslide for the Democrats with this crucial endorsement!

But seriously, I’ve been behind Obama since the primaries. My decision is based on his keen intellect, technological prowess, and inspirational charisma (and you know, the fact that I’m a Democrat). I often wonder how anyone in my field can even support McCain, who can barely use a computer, versus the young, ambitious, and intellectual spirit of most programmers that is embodied in Barack Obama.

I normally wouldn’t discuss politics on my website and have continually shaken off the urge to do so recently, but the fast yet seemingly endless approach of the presidential election has gotten me so excited that I’ve turned into a political junkie over the past few months. Every morning, I scour the web for hot political news; every evening, I’m fixed to MSNBC’s line-up; and every waking hour, I’m watching for new poll data. It’s gotten so bad, that I’m starting to do programs and spreadsheets with election data.

Friday, I randomly decided to start crunching numbers on the differences in spread between the 2004 election and 2008 election predictions. I grabbed the predictions with a Regex on Pollster.com‘s fine poll trend data and the results from the Federal Election Commission for 2004 and mashed them together in Excel to get the spreads. Then, I got the crazy idea of seeing the data visually. So from there, I made a VB.Net script to take the data and decide what color to make a state (with the typical Blue equals more Democratic and Red equals more Republican) by adjusting hue, saturation, and luminance. Unfortunately, the linear hue equation made the map mostly purple, which didn’t convey the key point that the country is turning Democratic this cycle. So I switched to a logarithmic hue equation that would keep the purples towards the very center. For any interested, here’s the code I used to find the colors. (Where “x” is positive for more Democratic and negative for more Republican.)

Dim MaxDemHue As Integer = 147 'hue when input is MaxShift in the democratic direction
Dim MaxRepHue As Integer = 255 'hue when input is MaxShift in the republican direction
Dim MaxSat As Integer = 255 'saturation when input is MaxShift
Dim MinSat As Integer = 160 'saturation when input is 0
Dim MaxLum As Integer = 92 'luminance when input is MaxShift
Dim MinLum As Integer = 207 'luminance when input is 0
Dim CenterHue As Integer = ((MaxRepHue - MaxDemHue) / 2) + MaxDemHue 'hue when input is 0
Dim MaxShift As Integer = 40 'the max spread in either direction

Dim HueShift As Double = ((MaxShift * 0.262) * Math.Log(Math.Abs(x))) + 3.9138
If HueShift > 0 Then HueShift = 0 'possible that it could go negative with log
hsl.H = CenterHue - (Math.Sign(x) * HueShift)
hsl.S = ((Math.Abs(x) / MaxShift) * (MaxSat - MinSat)) + MinSat
hsl.L = ((Math.Abs(x) / MaxShift) * (MaxLum - MinLum)) + MinLum

Initially, I manually put the state colors into an image. This proved to be a bit time-consuming, so I moved to a vector art format called SVG that, because it’s merely XML, can be changed programmatically. With each state shape having a unique ID, I can just XPath to it in code and Regex change the color. Now the results.

Looking at the map, it seems quite clear that indeed the majority of the country is trending Democratic this year. Most of the states are 5 to 10% more for Obama than they were for Kerry. There are some notable exceptions, though. The northeastern states are surprisingly not much more Democratic (or even more Republican in the case of Massachusetts and Rhode Island); I’m guessing this is because they already turned out very strongly for Kerry last election. Similar to Mass. is Arizona, where McCain has the home-team advantage. That leaves Tennessee and Arkansas as the only other states not trending more Democratic, which may be explained by racial factors and population demographics.

Just for the hell of it, I also plugged the raw prediction data into my script to produce a map with a bit more information than the standard electoral ones you see floating around.

news273I’ve worked on the new version of Cursor Lock recently and a release is eminent (hope I didn’t say that last time I mentioned Cursor Lock). A new installer is already made and all the known bugs are fixed, so there’s just the matter of documentation left. If I can peel myself away from the polls, I’ll hopefully have the new release done before November 4th.

Posted in Programming | Tagged , , , | Leave a comment