I’ve recently (re-)started a little pet project to reverse engineer the Yendorian Tales games.

I made a small attempt at this in a VB6 project over 10 years ago, but with the advent of web technologies and a desire to learn them doing something fun, I’ve given it another go.

I’ve been able to tackle the following in quite a short period of time:

  • Wall textures
  • Floor textures
  • Almost the entire colour palette
  • Creatures
  • Found the first map in world.dat and a basic understanding of the data structure

This is also a chance to work with some libraries and technologies which I don’t usually get a chance to play with:

  • DataStream.js – A JavaScript library for dealing with binary data. One of the nice features of this particular library is that you can write configurations to load the binary data into objects. This feels a little closer to the good old days of loading a chunk of data into a struct in C/C++
  • Three.js – A great 3D Library with many useful features out of the box. It has renderers for HTML5 Canvas, WebGL and SVG. As a past enthusiast of 3D graphics programming, I’m looking forward to this part immensely

Overall the goal isn’t too ambitious. I’d like to simply create a rendering engine to explore the first level of the game.

Here is the important thing however. While I could just grab all of the necessary data, convert it all to modern file formats and throw it together to create a demo, I want to load the original game files and work with them just as the original game would have. That’s the fun part 🙂

Here are a few exports, plus a GIF I crafted (No such animation support yet):

With the recent problems with part of the Force 3 120GB line of Solid State drives, it seems that the 60GB models are problematic too suffering in much the same way, despite Corsair claiming that the other models aren’t affected.

After reading Corsair’s responses on their forums and the lack of real solutions to the problem, with the exception of some rather poor firmware with no changelog that is problematic to update, I’ve gone straight back to eBuyer in the hope of a refund.

Anybody else got anything to weigh in regarding this situation?

This is a batch file I wrote to handle the compression directories full of PNG files using Ken Silverman’s amazing PNGOUT tool.

Bear in mind that this isn’t exactly a replacement for PNGOUTWin which supports asynchronous file compression taking advantage of multiple cores, this is merely a batch file that recursively navigates through a given directory and throws all PNGs one at a time at PNGOUT.

Output example:

Output for D:\Images\ for 88 files
1252 kb before
922 kb after
saving a total of 330 kb (26%)
Press any key to continue . . .

Instructions:

  1. Download Ken Silverman’s command line PNGOUT tool (as provided in the link)
  2. Set the path for the pngo variable in the batch file
  3. Run the batch file simply like so
    • pngout-batch “D:\Images\”
  4. Optional: Create a shortcut to the batch file and place it in your SendTo folder for your user account for the sake of convenience
    • Windows XP
      • C:\Documents and Settings\<username>\SendTo
    • Windows Vista / 7
      • C:\Users\<username>\AppData\Roaming\Microsoft\Windows\SendTo

Here is a preview of the batch file or you can download the batch file itself at the bottom of the post.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: PNGOut Compressor Batch File v1.0
:: 
:: Author: Terry J. Butler
:: Website: http://www.terrybutler.co.uk/
:: Post URI: http://www.terrybutler.co.uk/2011/07/07/batch-pngout-file-compressor/
:::READ ME::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Distribute this batch file as you'd like but I ask that you please leave this 
:: commented header section intact.
:: If you want to modify this batch file, I ask that you give credit where credit 
:: is due.
:: 
:: Thanks to Ken Silverman for the fantastic PNGOut. Nothing compares to it.
:: You'll need to download it from http://advsys.net/ken/utils.htm, place it  
:: somewhere convenient and change the path to it for the 'pngo' variable under the
:: "CONFIGURATION" header
::
:: Thanks to the NT reference at SS64.com (http://ss64.com/nt/) for an incredible 
:: wealth of information that helped shape this batch file
:: 
:: Head to the link in the Post URI above for further details on how to use.
:::CHANGE LOG:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: v1.0
:: - Initial Release
::
:::CONFIGURATION::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Set this path to the locaation of your pngout.exe file
SET pngo="D:\tools\pngout.exe" 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

:: Setting EnabledDelayedExpansion will cause each variable to be expanded at execution 
:: time rather than at parse time. EnableDelayedExpansion is Disabled by default.
setLocal EnableDelayedExpansion

:: set some arithmetic capable variables
set /a value=0
set /a sum=0
set /a sumOriginal=0
set /a count=0
set /a diff=0
set /a diffPercent=0

pushd %1

	FOR /R %%G IN (*.png) DO (
		echo Now Compressing %%G 
		
		set /a value=%%~zG
		set /a sum=!sum!+!value!	
		set /a count+=1
		%pngo% "%%G"
	)

	set /a sumOriginal=sum/1024

	set /a value=0
	set /a sum=0

	FOR /R %%G IN (*.png) DO (
		set /a value=%%~zG
		set /a sum=!sum!+!value!	
	)
	
	set /a sum=sum/1024	
	set /a diff=!sumOriginal!-!sum!	
	set /a diffPercent=(100*(!sumOriginal!-!sum!))/!sumOriginal!;	

	@echo Output for %CD% for %count% files
	@echo !sumOriginal! kb before
	@echo !sum! kb after	

	@echo saving a total of !diff! kb (!diffPercent!%% decrease)
	
popd

:: Unset variables
SET _value=
SET _sum=
SET _sumOriginal=
SET _count=
SET _diff=
SET _diffPercent=

pause

Download pngout-batch.bat