UDK Redesign

For a couple of months now, I worked with the Unreal Development Kit (UDK). It is a game simulation engine and a really nice piece of software.  The UDK has grown over the last several years continuously in functionality but it  never was redesigned. Over the last weekend i sat down and redesigned the main screen. It was challenging to redesign the visuals but being consistent with a certain workflow and logic that users are familiar with.

you can see the final result here:

Portfolio: Unreal Development Kit – Redesign

Scaleform batch Export

I am working with Scaleform now for quite some time, and everyone who knows the Scaleform workflow is familiar with the GFxExport Tool. It is a cmd program to convert .fla files in to .gfx files. But it is uncomfortable as hell if it is not Connected into a workflow and you have to convert your files by hand. I always wanted to write my own application to make this process easier, but I didn’t find the time until now.

But there are always several ways. I wrote a little batch file that creates a subfolder and exports all the necessary .gfx files and images into it. The only problem is, you have to set it up the first time you need it:

 EDIT: I found out I am not the first one who had this idea. I discovered that there are batch files already in the Scaleform Demo Projects, they had some solutions that where nicer than mine, so i have updated my script:

 

  1. @echo off
  2. cls
  3. echo.
  4. rem ===========================================================================================
  5. rem This file originated from the scaleform example projects and was edited by konrad koch
  6. rem addictedtocreation.com If you have remarks or an idea to optimize it, let me know
  7. rem ===========================================================================================
  8.  
  9. set resourceDir=.
  10. if not "%1" == "" (set resourceDir=%1)
  11. echo resourceDir("%resourceDir%")
  12.  
  13. set resourceFile=yourSWFfilename.swf
  14.  
  15. rem ###########################################################################################
  16. rem ===========================================================================================
  17. rem IMPORTANT: CHANGE THE NAME OF THE SUBFILE YOU WANT TO HAVE YOUR EXPORT!
  18. rem CURRENTLY IT IS "data". The folder will be deleted each time you runn the script.
  19. rem So you have always the newest files
  20. rem ===========================================================================================
  21. rem ###########################################################################################
  22.  
  23. set resourceCompiledDir=%resourceDir%\data
  24. echo Deleting folder "%resourceCompiledDir%"
  25. if exist %resourceCompiledDir% (rd /s /q %resourceCompiledDir%)
  26.  
  27. rem ###########################################################################################
  28. rem ===========================================================================================
  29. rem IMPORTANT: CHANGE THE PATH TO YOUR GFXEXPORT.EXE PATH!
  30. rem ===========================================================================================
  31. rem ###########################################################################################
  32. set gfxexportApp="C:\Program Files (x86)\Scaleform\GFx SDK 4.0\Bin\gfxexport.exe"
  33. echo GFxExport("%gfxexportApp%")
  34.  
  35. rem ###########################################################################################
  36. rem PRESELECTION:
  37. rem ###########################################################################################
  38. echo.
  39. echo How do you want to export the files?
  40. echo 1. TGA export:
  41. echo 2. DDS export with uncompressed DXT1:
  42. echo 3. DDS export with uncompressed DXT1 and compressed DXT5 with alpha:
  43.  
  44. :selection
  45. set /P wahl=please select:
  46. if /i "%wahl%"=="1" goto:tga
  47. if /i "%wahl%"=="2" goto:dxt1
  48. if /i "%wahl%"=="3" goto:dxt5
  49. echo Wrong selection!
  50. goto:selection
  51.  
  52. :tga
  53. echo.
  54. echo Exporting files TGA...
  55. %gfxexportApp% %resourceDir%\%resourceFile% -d %resourceCompiledDir%-tga
  56. pause
  57. goto:eof
  58.  
  59. :dxt1
  60. echo.
  61. echo Exporting files DXT1...
  62. %gfxexportApp% -i DDS -d0 %resourceDir%\%resourceFile% -d %resourceCompiledDir%-dxt1
  63. pause
  64. goto:eof
  65.  
  66. :dxt5
  67. echo.
  68. echo Exporting files DXT1 and DXT5...
  69. %gfxexportApp% -i DDS -d5  %resourceDir%\%resourceFile% -d %resourceCompiledDir%-dxt5
  70. pause
  71. goto:eof
@echo off
cls
echo.
rem ===========================================================================================
rem This file originated from the scaleform example projects and was edited by konrad koch
rem addictedtocreation.com If you have remarks or an idea to optimize it, let me know
rem ===========================================================================================

set resourceDir=.
if not "%1" == "" (set resourceDir=%1)
echo resourceDir("%resourceDir%")

set resourceFile=yourSWFfilename.swf

rem ###########################################################################################
rem ===========================================================================================
rem IMPORTANT: CHANGE THE NAME OF THE SUBFILE YOU WANT TO HAVE YOUR EXPORT!
rem CURRENTLY IT IS "data". The folder will be deleted each time you runn the script.
rem So you have always the newest files
rem ===========================================================================================
rem ###########################################################################################

set resourceCompiledDir=%resourceDir%\data
echo Deleting folder "%resourceCompiledDir%"
if exist %resourceCompiledDir% (rd /s /q %resourceCompiledDir%)

rem ###########################################################################################
rem ===========================================================================================
rem IMPORTANT: CHANGE THE PATH TO YOUR GFXEXPORT.EXE PATH!
rem ===========================================================================================
rem ###########################################################################################
set gfxexportApp="C:\Program Files (x86)\Scaleform\GFx SDK 4.0\Bin\gfxexport.exe"
echo GFxExport("%gfxexportApp%") 

rem ###########################################################################################
rem PRESELECTION:
rem ###########################################################################################
echo.
echo How do you want to export the files?
echo 1. TGA export:
echo 2. DDS export with uncompressed DXT1:
echo 3. DDS export with uncompressed DXT1 and compressed DXT5 with alpha:

:selection
set /P wahl=please select:
if /i "%wahl%"=="1" goto:tga
if /i "%wahl%"=="2" goto:dxt1
if /i "%wahl%"=="3" goto:dxt5
echo Wrong selection!
goto:selection

:tga
echo.
echo Exporting files TGA...
%gfxexportApp% %resourceDir%\%resourceFile% -d %resourceCompiledDir%-tga
pause
goto:eof

:dxt1
echo.
echo Exporting files DXT1...
%gfxexportApp% -i DDS -d0 %resourceDir%\%resourceFile% -d %resourceCompiledDir%-dxt1
pause
goto:eof

:dxt5
echo.
echo Exporting files DXT1 and DXT5...
%gfxexportApp% -i DDS -d5  %resourceDir%\%resourceFile% -d %resourceCompiledDir%-dxt5
pause
goto:eof

How to use it:

Copy the file in to a textfile, change attributes of the .swf filename in side of the textfile and the path of your gfxexporter. Then change the file name from whatever.txt to whatever.batch. Save and run the batch file.
Select which preset you want and the project will convert your files in to a data-tga, data-dxt1 or data-dxt5 folder.

If you have multiple files you can add them on the bottom. SO instead of:

  1. %gfxexportApp% %resourceDir%\%resourceFile% -d %resourceCompiledDir%-tga
%gfxexportApp% %resourceDir%\%resourceFile% -d %resourceCompiledDir%-tga

you can also write:

  1. %gfxexportApp% %resourceDir%\yourfile1.swf -d %resourceCompiledDir%-tga
  2. %gfxexportApp% %resourceDir%\yourfile2.swf -d %resourceCompiledDir%-tga
  3. %gfxexportApp% %resourceDir%\yourfile2.swf -d %resourceCompiledDir%-tga
%gfxexportApp% %resourceDir%\yourfile1.swf -d %resourceCompiledDir%-tga
%gfxexportApp% %resourceDir%\yourfile2.swf -d %resourceCompiledDir%-tga
%gfxexportApp% %resourceDir%\yourfile2.swf -d %resourceCompiledDir%-tga

and all the files are exported in to the data-tga folder. If you need help, please leave a comment.

UPDATE 2: If you use a global font or asset library. You have to export them first. Then the other files that reference those libraries.

yEd Graph Editor

For my work I regularly need flowcharts to display data and structures. Today I will introduce you to yEd. It is a free graph editor even though I tried several alternatives I stick to it. I use it mostly for custom diagrams like the display of pages and button structures. Usually I try not to make complex graphs because it is a pain for most people to create the” big picture” from a graph. If others don’t get the main idea immediately, you failed. So i cut them in smaller areas and made them as simple as possible.

A nice feature of yEd is the automatic layout structure. You can select connected objects and choose a layout format, yEd is doing the rest for you. An introduction video to yED is shown below. It is a nice software, available for for Windows, Unix/Linux and Mac OS.

Download link  |  Application Features

Baggage WIP Icons

Baggage IconthemeI am currently working on “BAGGAGE” an icon-theme for a client. It is produced for a  28x28px resolution. After finishing up, I will maybe release a free version of it. Currently it consists of 32 icons, perfect for shops.

Adobe Air and Save XML in a local File

In my earlier post I talked about loading local or online XML data. But how about saving. Since it is nice to save settings for an App. Here is my solution:

  1. import flash.filesystem.File;
  2. import flash.filesystem.FileStream;
  3. import flash.filesystem.FileMode;
  4. import flash.events.Event;
  5.  
  6. /* Determine Path of Loaded and Saved File */
  7. var appDirectory:File = File.applicationStorageDirectory
  8. var newFileStream:FileStream = new FileStream();
  9. var fileString:String = appDirectory.nativePath;
  10. var appFile:File = File.documentsDirectory;
  11. appFile = appFile.resolvePath(fileString+"\data.xml");
import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.filesystem.FileMode;
import flash.events.Event;

/* Determine Path of Loaded and Saved File */
var appDirectory:File = File.applicationStorageDirectory
var newFileStream:FileStream = new FileStream();
var fileString:String = appDirectory.nativePath;
var appFile:File = File.documentsDirectory;
appFile = appFile.resolvePath(fileString+"\data.xml");

This code uses a local file called data.xml in the applicationStorageDirectory.
In Windows it is stored here: //C:Users{username}AppDataRoaming{ProjectName}Local Store

  1. /* LOAD XML */
  2. var xmlString:URLRequest = new URLRequest(fileString+"\data.xml");
  3. var xmlLoader:URLLoader = new URLLoader(xmlString);
  4. xmlLoader.addEventListener("complete", init);
  5. var defaultXML:XMLDocument = new XMLDocument();
  6.  
  7. /* INIT DATA */
  8. function init(event:Event):void {
  9. var xml:XML = XML(xmlLoader.data); // Loads the XML data in to the variable "xml"
  10. }
  11.  
  12. /* Save the modified data to the xml file. */
  13. function saveData(e:Event):void
  14. {
  15. newFileStream.openAsync (appFile, FileMode.WRITE);
  16. var xml:XML = XML(xmlLoader.data);
  17. xml.newElement = ; // Here you can add a new element in to the XML list
  18. newFileStream.writeUTFBytes(xml);
  19. newFileStream.close ();
  20. }
/* LOAD XML */
var xmlString:URLRequest = new URLRequest(fileString+"\data.xml");
var xmlLoader:URLLoader = new URLLoader(xmlString);
xmlLoader.addEventListener("complete", init);
var defaultXML:XMLDocument = new XMLDocument();

/* INIT DATA */
function init(event:Event):void {
var xml:XML = XML(xmlLoader.data); // Loads the XML data in to the variable "xml"
}

/* Save the modified data to the xml file. */
function saveData(e:Event):void
{
newFileStream.openAsync (appFile, FileMode.WRITE);
var xml:XML = XML(xmlLoader.data);
xml.newElement = ; // Here you can add a new element in to the XML list
newFileStream.writeUTFBytes(xml);
newFileStream.close ();
}

If you have questions or a better solution. let me know.