Conflicting Genius

Musings on everything past, present, and future

Mass Dummy File Creator – BAT Edition

Those who’ve read my blog recently will remember my Mass Dummy File Creator. However, some of you might have been wondering, “Why did you create an entire application to do what could be done in the Windows Command Line?” To that, I would say, “I didn’t know I could until I looked!” Therefore, I’ve create a separate repository for a version which uses the Windows Command Line via a Batch file to create dummy files, backup files, and/or restore created backups. It does almost everything the original does, with two differences: there’s no way to backup then dummy out files (easily added), and only files with a single extension are supported (not so easily added). In an attempt to fix the latter, I will be recreating the Mass Dummy File Creator – yet again! – into Windows PowerShell, which I hear is significantly more powerful than a Batch file.

Mass Dummy File Creator v1.1

I just updated my Mass Dummy File Creator to version 1.1! Aside from some improvements, such as threading the file dummier, I also optimized the program so it only holds onto as much information about the files in the directory as needed – namely, the files with the user-specified file extension. You can find the updated code on GitHub: https://github.com/Expack3/MassDummyFile

I just created my first code repository!

I just recently created my first code repository on GitHub for a program I called the Mass Dummy File Creator, which replaces files of a user-specified extension contained within a folder with empty “dummy” files. Rather useful for diagnosing issues with audiovisual content for an application or bypassing annoying videos in a PC video game. Any comments, feedback, and/or critisism would be greatly appreciated!

You can find the code repository here: https://github.com/Expack3/MassDummyFile

Musings on Science and Logic

Authors note: The following was postulated by me at this week’s κοινότητα (Community) gathering at Saint Thomas the Apostle Catholic Church in Grand Rapids, Michigan.

As Fr. Robert Barron wrote in his Word on Fire blog post, The Myth of the War Between Science and Religion, modern science is not in conflict because Catholicism holds that ours is a created world. “To hold that the world is created is to accept, simultaneously, the two assumptions required for science, namely, that the universe is not divine and that it is marked, through and through, by intelligibility.” As Fr. Baron also writes, because the world is marked throughout by intelligibility, science is possible because it relies “upon the presumption that nature can be known, that it has a form.” Hence why scientists are able to create things like chaos theory, which studies mathematical systems highly sensitive to how they are set up initially, and be able to get predictable, repeatable results.

As such, I would ask a simple question: if, as atheists posit, God does not exist, then how can we guarantee logic actually exists in the universe? Could it be that, in order to maintain our sanity, we assign meaning to things which, in fact, lack the meaning assigned? Do we assign logic where there is no logic? Food for thought….

Character Set Woes, or How C# and Java Differ When Writing to a File

Recently, I just finished porting my Java JAR-based console app to C# .NET. It was a fun, challenging little venture – but there was one thing of note which makes me want to repeatedly slam my head into the nearest wall. That, my friends, is the differences in how C# and Java write an integer to a file.

 

Before I get into differences, here’s an example rundown in sudocode:

1. Assume the code will eventually be outputting to a file in the Latin-1 character set.

2. Assume the following variables exist:

  • The 16-bit integer k, used to keep track of the number of bits in a given byte.
  • The 16-bit integer j, used to keep track of what part of a given byte is being accessed.
  • The 16-bit integer i, used to keep track of which string array is being accessed.
  • The 16-bit integer s, used to store the final Latin-1 bytecode.
  • The list of the 2×1 string arrays vectorString, which stores the complete Huffman Compression encoding table; the first row contains a character, while the second row contains a string holding the bits representing the character in row 1.
  • The byte byter
  • The file writer writer; it is set to use Latin-1 encoding.

If k does not equal 8, do the following:

 If the character in element j of row 1 of the string array kept in element i of vectorString is not equal to the character 1, do the following:

Make byter equal to the result of the new byte created by applying a logical OR to byter using the result of shifting 1 by 7-k bits.

Increment k and j by 1.

Otherwise, do the following:

Make s equal to the result of applying a logical AND to byter using 0XFF

Write the Latin-1 character represented by s to a file.

Make byter equal to 0.

Make s equal to 0.

 

OK, now that we know what supposed to happen, here’s how to ensure s is correctly written to the file in each language and what that actually looks like:

Java

Write the character represented by s to the file based on the encoding used by the file writer.

bitWriter.write(s); (bitWriter is a properly-initialized FileOutputStream)

 

C# .NET

Write to a file the string created by getting the Latin-1-formatted bit string of a new 1×1 byte array containing the result of  converting s to a byte.

bitWriter.Write(Encoding.GetEncoding(“iso-8859-1″).GetString(new byte[] { Convert.ToByte(s) }));

 

WHAT THE HECK HAPPENED?!?!

 

As it would turn out, Java seems to default to Latin-1 for file IO and has a nifty file writer called a file output streamer which works exclusively with raw bytes; C#, however, defaults to Unicode-16 for file IO and only has a file writer called, creatively enough, a file writer, which works exclusively with characters. The result is in Java, I can simply throw bytecode at the streamer and it outputs properly; in C#, however, I have to convert s back into a byte, then take the result of that and convert it into a Latin-1 character. It’s so head-bangingly convoluted I still can’t get over it!

Retro Gaming without CDs: Old Time Baseball

Released in 1995 by Stormfront Studios, makers of the then-popular Tony La Russa Baseball series of baseball simulators, Old Time Baseball was a spinoff of Tony La Russa Baseball 3 – with the twist of being able to play as every major team from the beginning of baseball in the 1890’s up to the present and being able to pit two teams from different eras against each other. If you’ve ever wanted to see what Babe Ruth could do against the likes of Hank Aaron, this is the game for you!

Just like the game itself, getting Old Time Baseball to run without its CD is pretty straightforward – unlike what a first glance would reveal. The game has a hard-coded requirement for a CD-ROM, and the game’s configuration file is encrypted with little indication as to how it was encrypted. Thankfully, using DOSBOX’s built-in support for making OS folders look like actual CD-ROMs makes CD-less support for this game possible.

The Nitty-Gritty

  1. Create a folder somewhere on your hard drive called Old Time Baseball. Ensure you don’t place it within your Program Files folders – it will cause major issues with how the game saves.
  2. Download the latest version of DOSBOX from http://sourceforge.net/projects/dosbox/files/latest/download?source=files
  3. Install DOSBOX to the folder you created (i.e. if you put the folder on your C drive, you would install DOSBOX to C:\ Old Time Baseball \Dosbox)
  4. Insert the game disc into the CD-ROM drive of your choice.
  5. Navigate to the folder you installed DOSBOX to, and run dosbox.exe
  6. You will see DOSBOX’s command line.
  7. Type the following command into DOSBOX: mount c “..\..\Old Time Baseball”
  8. Press the Enter key. By doing so, DOSBOX will treat the folder you entered previous as the C drive of the emulated MS-DOS system.
  9. Before we move on, I’d like to explain why I had you type in those dots. Those dots tell DOSBOX to use what’s called relative pathing to look at a specific folder which is up one in the chain of folders. This allows these instructions to not rely on a specific path, and it enables some nifty things later like being able to run this off a flash drive. As this can get complicated to explain, I’ll let this image explain:

DotDot-Explanation

  1. Type the following command: mount d d:\ -t cdrom (Replace d with the letter of your CD-ROM drive.)
  2. Press the Enter key. DOSBOX will now treat the drive you specified as a CD-ROM drive accessible by the emulated MS-DOS system.
  3. Type in the following command: d:
  4. Press the Enter key. You’re now on the CD-ROM drive.
  5. Type INSTALL into DOSBOX, then press the Enter key.
  6. You will see the Old Time Baseball installer appear. Press the Enter key.
  7. You’ll then see a list of optional components. Press the Enter key to ignore this screen and continue to installation.
  8. Once installation is complete, press the Enter key.
  9. Enter SETUP into DOSBOX, then press Enter.
  10. You will be presented with the Old Time Baseball setup program. It will first ask for your video card.

VideoSetupOTB

  1. Ensure the “Auto-Detect the Video Card” option is selected using the arrow keys, then press the Enter key.
  2. You will then be presented with a new screen which says it is “Detecting SVGA type”. Press the Enter key.
  3. Press Y at the screen which appears.
  4. At the next screen, press the Enter key.
  5. You will then see a sample image from the main menu of the game. Press the Enter key.
  6. Press Y at the screen which appears.
  7. You will then be presented with the sound setup screen.

SoundSetupOTB

  1. Select the “Done” option from the menu using the arrow keys, then press the Enter key.
  2. You will then see a screen asking you to configure two joysticks. At each joystick calibration prompt, press the Escape (ESC) key to cancel the configuration.
  3. You will be returned to the DOSBOX prompt.
  4. Type exit into the DOSBOX prompt, then press the Enter key.
  5. DOSBOX will automatically exit.
  6. In the Old Time Baseball folder you created, open the folder called OLDTIME.
  7. Right-click on an empty space within the folder, then click on the “New Folder” option from the menu which appears.
  8. Name the new folder CD
  9. Open the folder you just created.
  10. In a separate window, open the CD-ROM drive containing the Old Time Baseball CD.
  11. Select everything highlighted in blue in the image below:

OTB_CD

  1. Right-click on one of the selected folders, then select “Copy” from the menu which appears.
  2. Paste the folders into the CD folder.
  3. Go back to where you installed DOSBOX, and open dosbox.exe.
  4. You will again be presented with the DOSBOX command line.
  5. Type the following command: mount c “..\OLDTIME”
  6. Press the Enter key. By doing so, DOSBOX will treat the actual folder containing the game as the C drive of the emulated MS-DOS system.
  7. Type the following command: mount d “..\OLDTIME\CD”
  8. Press the Enter key. By doing so, DOSBOX will treat the CD folder you created as a CD-ROM drive with drive letter D which is accessible by the emulated MS-DOS system.
  9. Type the following command: c:
  10. Press the Enter key. You’re now in the game folder.
  11. Type OLDTIME into DOSBOX and press Enter. The game will now play!

If you don’t want to repeat steps 40-48 steps every time, just download this file and place it in the folder where you installed DOSBOX. Using the file, all you have to do to play the game is launch DOSBOX. I should also note that in the case of this game, you aren’t returned to the DOSBOX command prompt when exiting the program. Instead, the emulator continuously displays a blank screen. As such, you’ll have to exit the emulator manually.

Retro Gaming without CDs: Azrael’s Tear

Azrael’s Tear is a first-person adventure game – a rare combination – by Intelligent Games, Ltd. In it, you play as a Raptor, a futuristic thief who plunders archeological sites formerly untouched by humans, as you seek out the legendary Holy Grail.
This game is somewhat complicated to set up to run without a CD. While the game comes with a “Full Install” option, it doesn’t actually install the entire game – rather, it installs 150MB of the full 425MB game to your hard drive. It also unnecessarily clutters up your installation folder with files no matter what settings you use! Fortunately, the game can be set-up to read all data from the hard drive through changing a simple text file and copying over data from the CD-ROM.
The Nitty-Gritty

  1. Create a folder somewhere on your hard drive called Azraels Tear. Ensure you don’t place it within your Program Files folders – it will cause major issues with how the game saves.
  2. Download the latest version of DOSBOX from http://sourceforge.net/projects/dosbox/files/latest/download?source=files
  3. Install DOSBOX to the folder you created (i.e. if you put the folder on your C drive, you would install DOSBOX to C:\Azraels Tear\Dosbox)
  4. Insert the game disc into the CD-ROM drive of your choice.
  5. Navigate to the folder you installed DOSBOX to, and run dosbox.exe
  6. You will see DOSBOX’s command line.
  7. Type the following command into DOSBOX: mount c “..\..\Azraels Tear”
  8. Press the Enter key. By doing so, DOSBOX will treat the folder you entered previous as the C drive of the emulated MS-DOS system.

Before we move on, I’d like to explain why I had you type in those dots. Those dots tell DOSBOX to use what’s called relative pathing to look at a specific folder which is up one in the chain of folders. This allows these instructions to not rely on a specific path, and it enables some nifty things later like being able to run this off a flash drive. As this can get complicated to explain, I’ll let this image explain:

DotDot-Explanation

  1. Type the following command: mount d d:\ -t cdrom (Replace d with the letter of your CD-ROM drive.)
  2. Press the Enter key. DOSBOX will now treat the drive you specified as a CD-ROM drive accessible by the emulated MS-DOS system.
  3. Type in the following command: d:
  4. Press the Enter key. You’re now on the CD-ROM drive.
  5. Type AZRAEL into DOSBOX and press the Enter key.
  6. You will be presented with the installation window. Press the Enter key at the first prompt.
  7. Next, select the “Full Install” option using the arrow keys, then press the Enter key.
  8. Wait for installation to complete. This may take some time, so be patient.
  9. When installation is complete, select “Done” from the prompt which appears using the arrow keys, then press Enter.
  10. You will be presented with the Sound Setup screen.

SoundSetup1

  1. Press Enter. This will bring up a screen to select your MIDI (Musical Instrument Digital Interface) device.
  2. Ensure “Creative Labs Sound Blaster(TM) 16” is selected using the arrow keys, then press the Enter key.

SoundSetup2

  1. Select the “Attempt to configure sound driver automatically” option.
  2. After a moment, a dialogue will appear stating the device was detected successfully. Press Enter.
  3. Using the arrow keys, choose “Select and configure digital audio driver” from the menu which appears, then press the Enter key.
  4. Ensure “Creative Labs Sound Blaster 16 or AWE32” is selected using the arrow keys, then press the Enter key.
  5. Select the “Attempt to configure sound driver automatically” option.
  6. After a moment, a dialogue will appear stating the device was detected successfully. Press Enter.
  7. Using the arrow keys, choose “Done” from the menu which appears, then press the Enter key.
  8. Enter the following command into DOSBOX: exit
  9. Press the Enter key. DOSBOX will close automatically.
  10. Now we need to copy over all the important files from the CD-ROM to the game folder. First, go to the CD-ROM drive.
  11. Next, select the SOUNDS and MOV folders.

CDfilesAzrael

  1. Right-click on either folder and select “Copy” from the menu which pops up.
  2. Navigate to the Azraels Tear folder, then open the folder called AZRAEL.
  3. Right-click on an empty space, then click on the Paste button from the menu which appears.
  4. Still in the AZRAEL folder, search for a file called RESOURCE.CFG.
  5. Using the text editor of your choice, open RESOURCE.CFG.

ResourceAzreal

  1. Replace the second and third lines of text so the document appears as such:

Resource2Azreal

  1. Now let’s run the game. Navigate to the folder you installed DOSBOX to, and run dosbox.exe
  2. You will see DOSBOX’s command line.
  3. Type the following command into DOSBOX: mount c “..\AZRAEL”
  4. Press the Enter key. By doing so, DOSBOX will treat the actual folder containing the AZRAEL you entered previous as the C drive of the emulated MS-DOS system.
  5. Type the following command: c:
  6. Press the Enter key. You’re now on the C: drive of the emulated MS-DOS system.
  7. Type R into DOSBOX, then press the Enter key. You can now run the game without the CD!

If you don’t want to repeat steps 38-44 every time, just download this file and place it in the folder where you installed DOSBOX. Using the file, all you have to do to play the game is launch DOSBOX.

Retro Gaming without CDs: An introduction

If you haven’t noticed by now, I love older video games. In particular, I love MS-DOS and Windows games from the 1980’s and 1990’s because they’re from a time when I either had a limited amount of games to play (my parents were never into games like I am) or the games were way before my time. Some of these games include CD-ROM-based games, which slowly came into their own in the 90’s. However, there’s a number of a problem with these older CDs for MS-DOS and Windows – some of which aren’t immediately apparent:

  1. Discs can easily get damaged by accident, even under normal circumstances. Hard disks or flash drives, on the other hand, are hard to damage.
  2. Games can span more than one disc if they’re specifically designed for the format due to containing duplicate data for rooms you need to revisit as well as unique data.
  3. You sometimes can’t get rid of the disc(s), physically or virtually, due to DRM measures requiring them to be in your CD-ROM drive – even when the game’s installer allows you to put the entire contents of the CD on the hard drive!

Thankfully, there’s an excellent MS-DOS emulator called DOSBOX. This sucker allows us to play CD-ROM-based MS-DOS games without their original discs. This is thanks to its ability to pass off OS folders as physical CDs – especially useful when there’s no way to get a game working without one. With some work, DOSBOX can even pass off audio files as a CD’s audio tracks! This is where one of my other hobbies comes in: making MS-DOS and Windows games work without their CDs and without needing to do any coding. In my view, all the tools we need are at our disposal, so why waste time trying to re-implement an entire game just so it can run without a CD when we can do so as-is?
I’ll be going over some of my favorite games as part of an ongoing series, explaining step-by-step how to play them without their CD(s) with DOSBOX. Note that if I have to illegally modify a game’s files or executable (i.e. No-CD cracks), I won’t be covering it anywhere on my blog. Those things can get into a grey legal area regardless of where you live, so I’m keeping things strictly legal.

One man’s love is another man’s question mark…

Recently, I discovered an awesome bit of British culture which is what happens when you take H.G. Wells’ War of the Words novel, turn it into a rock opera, and have it performed by an orchestral-electronica hybrid band (think Manheim Steamroller). However, I will say that I’ve found one problem when trying to talk to people about it – they’ve never heard of it. AT ALL. To demonstrate what I mean, I’m going to ask for a quick raise of hands.

Who recognizes at least something in this image?

Doctor Who

…hmm, that’s a lot of hands raised. I figured as much – Doctor Who is a worldwide phenomenon, after all.

Now, who recognizes this image?

Jeff Wayne's Musical Version of The War of the Worlds

…nobody? Well, that figures. How about this one?

Still nothing? See, here’s my problem. Jeff Wayne’s Musical Version of The War of the Worlds, aside from having one of the longest official album titles in modern music history, is seemingly unheard of in the United States. This, in spite of it being #38 on the UK’s official “Top 40 biggest selling albums of all-time” list…

…oh. Wait a minute. I just realized something.

Everything I'd Tell You Is Culturally Relevant TO THE UNITED KINGDOM

Kinda hard to expect my Yankee friends to understand a British thing, ain’t it?

Given this, it’s not surprising that my friends, most of whom were born and raised in America, haven’t heard about an album which has never been as popular in America as it has been overseas, let alone performed poorly in America compared with other countries. (http://www.thewaroftheworlds.com/thestory/default.aspx, Chapater 14, Page 142)

So, there you have it, ladies and gentlemen: the brief story of how one man’s love is another man’s question mark.

Does Myst have a legacy?

A recent article on Gamasutra raised an interesting question: does the classic first-person adventure game Myst really have a legacy? If someone were to ask me this, I’d say yes. However, I don’t think it left the kind of legacy most games do. Most games leave legacies which impact the video game industry. Sierra On-Line’s Quest brand of games, especially the King’s Quest series, led games into exciting new frontiers, from cinematic music scores using the once state-of-the-art Roland MT-32 Multi-Timbre Sound Module to full voice acting via the once-massive massive 600MB capacity of CD-ROMs, while games like Defender of the Crown were the forerunners of cinematic gaming with lush backgrounds and meticulously-detailed characters. Even spectacular failures left legacies – Jurassic Park: Trespasser is a notable example as its impressive-yet-horrifically-issue-ridden physics engine laid the groundwork for physics-driven first-person games like Half-Life 2.

However, Myst didn’t spawn a new breed of games which cleanly walked the line between art and an actual game – instead, it purportedly ended up singlehandedly killing the adventure game genre, paving the way for first-person shooters like Doom, Quake, and Half-Life. In fact, the only game which follows the Myst formula and people are to know about is the PS3 game Journey.

Think about it: both Myst and Journey minimize interactions to form an emphasis on artistic storytelling and world-building while providing puzzles of varying difficulties and complexities for the player to solve. Yet Journey is an epic tale of the journey you and others take across the world, while Myst is more of a chronicle of your adventures in a foreign land and a collection of interwoven, intimate tales on a small cast of characters you rarely get to interact with.

The legacy I think Myst left is the impact it had on its fans. Not only did it tell intimate stories, it build fantastic, lush worlds which hold (or once held) fantastic forms of life, both humanoid and alien. It also gave players puzzles to solve which were often very relatable, such as needing to read a compass or matching sounds to pictures of the animals which made them, and also tied well into the worlds and stories – how often does the solution to puzzles lie in learning a foreign number system through playing and observing a simple children’s game based around a terrible, ritualistic sacrifice? (If you played Myst’s first sequel, Riven, that’s exactly what you get to do.)

Honestly, I don’t think a Myst-like game would be appealing to publishers today. In a world where games tend to be, among other things, epic, flashy, and energetic, Myst hold a unique blend of intimacy, slow pacing, thoughtfulness, and exploration which goes against much of what’s being published today. Thankfully, Cyan Worlds is hoping to crowdfund enough money of Kickstarter to create a spiritual successor to Myst called Obduction. While, as of this writing, they’re 8 days away from their deadline and $266,008 away from the ambitious $1.1 million dollar goal. While I don’t think Cyan Worlds will make it, I do literally hope and pray they’ll make it. I think the legacy of Myst deserves to live on – it’s a rare breed of game which takes players on a unique, memorable journey they won’t soon forget.

Follow

Get every new post delivered to your Inbox.