<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF
	xmlns="http://purl.org/rss/1.0/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel rdf:about="http://feeds.garagegames.com/rss/blogs/developer/35899/">
		<title>Blog for Anders Dahnielson at GarageGames.com</title>
		<description>Blog feeds for Gamers and Developers in the GarageGames community.</description>
		<link>http://www.garagegames.com/</link>
		<image rdf:resource="http://www.garagegames.com/images/GarageGames_logo_small_w.gif" />
		<dc:date>2008-11-21T14:22:16+00:00</dc:date>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/35899/9451"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/35899/9445"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/35899/5621"/>
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.garagegames.com/blogs/35899/9451">
		<dc:format>text/html</dc:format>
		<dc:date>2005-12-30T21:32:02+00:00</dc:date>
		<dc:creator>Anders Dahnielson</dc:creator>
		<title>Showing Bare Bones for Torque 1.4</title>
		<link>http://www.garagegames.com/blogs/35899/9451</link>
		<description>I've decided to use this space on GG to chronicle my endeavours into game making as a TGE n00b. It will probably not be very novel. Just a diary over what I've done, how I'm thinking and what I'm aiming for.&lt;br&gt;&lt;br&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br&gt;&lt;br&gt;After having fixed the file system bug on Linux and compiled the TGE demo binary without file redirection enabled (see previous post for details) I was finally ready to create the base my game prototype could be built upon.&lt;br&gt;&lt;br&gt;I'm no expert in Torque, scripting or modding. This is just a description of my own dabblings in creating a minimal bare bone framework to use as a starting point. So I will at this point subtract more than add to the project. I start by creating a brand new project directory and then copy all the necessary files over from the SDK's example directory, then modify and remove files from the copy.&lt;br&gt;&lt;br&gt;&lt;b&gt;Copying All We Need&lt;/b&gt;&lt;br&gt;&lt;br&gt;Start by creating a directory for the project. All the files and folders we need to copy do we find in the SDK's 'example' directory.&lt;br&gt;&lt;br&gt;* First we need to copy our compiled Torque binary and any necessary support libraries to our project.&lt;br&gt;&lt;br&gt;* Next copy the 'common' directory and all its subdirs.&lt;br&gt;&lt;br&gt;* Do the same with the 'creator' directory.&lt;br&gt;&lt;br&gt;* And likewise with the 'tutorial.base', but rename it to 'game'.&lt;br&gt;&lt;br&gt;* Finaly copy the 'main.cs' from the 'example' dir to our project dir.&lt;br&gt;&lt;br&gt;&lt;b&gt;What All That Stuff Was&lt;/b&gt;&lt;br&gt;&lt;br&gt;A quick run through...&lt;br&gt;&lt;br&gt;* The 'common' directory contain commonly shared code implemented in TorqueScript that your game and the TGE editors can use. We copy it since the editors need it, but we are free to ignore it and implement our own version of the functions we may need in our game code. (The reason for that is so we can drop in an updated version of the 'common' without having to merge it with our own modified code.)&lt;br&gt;&lt;br&gt;* The 'creator' directory contain all the editors we need to create a game. Just like with the 'common' we do not have to ship it with our game.&lt;br&gt;&lt;br&gt;* The 'game' directory will contain all code and resources for our game. It will contain all the files we will create or modify. This is the directory you should concentrate on exploring.&lt;br&gt;&lt;br&gt;&lt;b&gt;Big Ol' Main Entrance&lt;/b&gt; &lt;br&gt;&lt;br&gt;When running the Torque binary it will look for a script called 'main.cs' in the directory the binary was executed from. That script is responsible for initialising, executing all the necessary script and setting up the engine.&lt;br&gt;&lt;br&gt;I will reuse the regular 'main.cs' script and just change the folowing line...&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;$defaultGame = &amp;quot;demo&amp;quot;;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;...to read...&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;$defaultGame = &amp;quot;game&amp;quot;;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Well, that's all for now. You can remove all the add mod and game stuff from the command line processing if you like. But that's kinda handy to keep around.&lt;br&gt;&lt;br&gt;&lt;b&gt;Fixing the Default Mission&lt;/b&gt;&lt;br&gt;&lt;br&gt;Modify the 'game/main.cs' file and change the line...&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;$Editor::newMissionOverride = &amp;quot;tutorial.base/data/missions/flat.mis&amp;quot;;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;...in the onStart function to read...&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;$Editor::newMissionOverride = &amp;quot;game/data/missions/flat.mis&amp;quot;;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;So that it will find the default mission that we will use as a starting point for all the other missions we will create.&lt;br&gt;&lt;br&gt;&lt;b&gt;Fixing the Console Key Binding&lt;/b&gt;&lt;br&gt;&lt;br&gt;I've seen that more people than I had problem toggling the console. The regular tilde keybinding may be alright on a US_en keyboard but on other layouts it won't work.&lt;br&gt;&lt;br&gt;So find the following line in 'game/client/default.bind.cs'...&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;GlobalActionMap.bind(keyboard, &amp;quot;tilde&amp;quot;, toggleConsole);&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;...and change it to something like...&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;GlobalActionMap.bind(keyboard, &amp;quot;alt backspace&amp;quot;, toggleConsole);&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Now I can press &lt;i&gt;Alt + Backspace&lt;/i&gt; to toggle the console.&lt;br&gt;&lt;br&gt;&lt;b&gt;The Game File Hierarchy&lt;/b&gt;&lt;br&gt;&lt;br&gt;Here's an overview of the current directory layout in 'game':&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;/game&lt;br&gt;  /client               -- all the client side scripts&lt;br&gt;    /ui                 -- all gui definitions&lt;br&gt;      /buttons          -- bitmaps for the bitmap buttons&lt;br&gt;  /data                 -- contain all game data&lt;br&gt;    /interiors          -- all the DIF files and their textures&lt;br&gt;    /missions           -- all the mission files and their terrain height maps&lt;br&gt;    /shapes             -- all the objects in a scene and their associated files&lt;br&gt;      /3dtorquelogo&lt;br&gt;      /markers&lt;br&gt;      /particles&lt;br&gt;      /player&lt;br&gt;    /skies              -- textures for the skies&lt;br&gt;    /sound              -- sound effect files&lt;br&gt;    /terrains           -- terrain textures&lt;br&gt;    /water              -- water textures&lt;br&gt;  /server               -- all the server side scripts&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Ok, as you already may know the game is split up into three parts: client, server and data. The splitting the code into a client and server part is obvious if you doing a multiplayer game (and when running a dedicated server there's no need to run the client part), but it can be a good design decision even for a single player game to split it up as well.&lt;br&gt;&lt;br&gt;The data part contain all the game resources, missions (TGE's name for &amp;quot;levels&amp;quot;), terrain height maps, textures, 3d objects and animations (you name it...)&lt;br&gt;&lt;br&gt;&lt;b&gt;Gentlemen, Start Your Engines!&lt;/b&gt;&lt;br&gt;&lt;br&gt;Now let us start it up and see if it works (well, it &lt;i&gt;is&lt;/i&gt; supposed to work). If you want you can continue by following the &lt;i&gt;GettingStarted.pdf&lt;/i&gt; tutorial, or read on if you already familiar with the editors.&lt;br&gt;&lt;br&gt;&lt;b&gt;Cleaning Up All The GUI&lt;/b&gt;&lt;br&gt;&lt;br&gt;When starting up the game you're presented with the main menu of the Tutorial Base. Let's start by cleaning it up. Hit F10 to enter the GUI editor.&lt;br&gt;&lt;br&gt;Start by removing the gray bar an all the buttons at the top and the RSS feed displays at the bottom. We leave the background as-is, it's nice until you have some game specific background image to replace it with.&lt;br&gt;&lt;br&gt;Now create two new regular GuiButtonCtrl buttons, one which says &amp;quot;Exit&amp;quot; and trigger the &amp;quot;quit();&amp;quot; and another that says &amp;quot;Options&amp;quot; and trigger &amp;quot;Canvas.pushDialog(optionsDlg);&amp;quot;. And save the GUI as 'mainMenuGui.gui'.&lt;br&gt;&lt;br&gt;Click on the &amp;quot;Options&amp;quot; to make sure it works, then do the same with &amp;quot;Exit&amp;quot;...&lt;br&gt;&lt;br&gt;To really get rid of the RSS feed stuff open up 'game/client/ui/mainMenuGui.gui' in a text editor and remove everything below the '//--- OBJECT WRITE END ---' line.&lt;br&gt;&lt;br&gt;We continue our &amp;quot;Operation: Clean GUI&amp;quot; by removing the following files:&lt;br&gt;&lt;br&gt;* game/client/ui/gameonebg.jpg&lt;br&gt;* game/client/ui/gray_bar.png&lt;br&gt;* game/client/ui/buttons/*&lt;br&gt;&lt;br&gt;The ui directory should now contain the minimal GUI:&lt;br&gt;&lt;br&gt;* background.png      -- the background image&lt;br&gt;* loadingGui.gui      -- the screen for loading missions&lt;br&gt;* mainMenuGui.gui     -- the main menu&lt;br&gt;* optionsDlg.gui      -- the options dialog&lt;br&gt;* playGui.gui         -- the game play gui&lt;br&gt;&lt;br&gt;&lt;b&gt;Data&lt;/b&gt;&lt;br&gt;&lt;br&gt;Actually we won't remove any of the data since it doesn't matter that much what we keep. Some of the stuff can come handy as stand-in objects and textures. For the first time we're actually ready to add stuff. Start adding terrain textures you've created or downloaded that you think you'll need, start adding interiors you've built and start adding objects to populate your world with.&lt;br&gt;&lt;br&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br&gt;&lt;br&gt;As promised this entry haven't contained anything novel. But it's my first step to create a game prototype. Next I will add some content to play with, create some new missions and finally start groking the TorqueScript code.</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/35899/9445">
		<dc:format>text/html</dc:format>
		<dc:date>2005-12-30T00:17:13+00:00</dc:date>
		<dc:creator>Anders Dahnielson</dc:creator>
		<title>Obstacles In the Development Path</title>
		<link>http://www.garagegames.com/blogs/35899/9445</link>
		<description>Ok, since I bought my TGE license I haven't created anything yet. Well, I did once a long, long time ago almost managed to build TGE on Linux with the autotools (autoconf, automake, libtool, etc.) but screwed it all up by copying the wrong files when updating the tree to a later TGE version (I think I copied HEAD files when the autotool tree was based on TGE 1.2).&lt;br&gt;&lt;br&gt;But this will hopefully change now when I together with a friend decided to make a game our &amp;quot;Project 2006&amp;quot;. Especially with me bragging about how much easier it will be to make a finished game with TGE than sail another movie project into port.&lt;br&gt;&lt;br&gt;So I pulled the latest TGE 1.4 from CVS and held my breatch while waiting for it to compile on my Gentoo GNU/Linux box. And it did!&lt;br&gt;&lt;br&gt;But I soon bumped into an obstacle when trying to walk through the GettinStarted.pdf. I became very confused over the issue where the editors saved my files. Then I found out by accident that it all gets saved in a hidden dir in my home dir &lt;i&gt;~/.garagegames/torqueDemo/&lt;/i&gt;. I asked myself: Varf&amp;amp;ouml;r? Warum? Why?&lt;br&gt;&lt;br&gt;Why isn't it saved in my games data dir? And how can I change this behaviour? The helpful answer found in the forum was the need to run with the -nohomedir option on the commanline. Now everything will be saved in the regular game/mod file hierarchy (note this is a GNU/Linux only TGE behaviour) including the &amp;quot;compiled&amp;quot; script dso files.&lt;br&gt;&lt;br&gt;However, everything wasn't fine. First, all files, textures and other files, was listed in a flat namespace making it a veeery long scrollist in the file dialog. Second, running with the -nohomedir option would save the mission files et al. in the &lt;i&gt;example&lt;/i&gt; dir (or whatever dir I ran the binary from) but in something like a &lt;i&gt;home/anders/Torque-CVS/example/GameOne/...&lt;/i&gt; subdir in the &lt;i&gt;example&lt;/i&gt;... Argh!!&lt;br&gt;&lt;br&gt;This turned out to be caused by the same bug in the Linux specific parts of TGE codebase. For what Todd &amp;quot;zaz&amp;quot; Koeckeritz already had &lt;a href='http://www.garagegames.com/mg/forums/result.thread.php?qt=38157'&gt;submited a patch&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;blockquote&gt;&lt;font size=1&gt;Quote:&lt;br&gt;&lt;hr height=1 noshade&gt;&lt;br&gt;Had a bear of a time with the new file dialog. In fact I thought it was completely broken, but when I went to debug the problem, it turned out to be an issue with the use of dirent on certain file systems during the recursion in recurseDumpDirectories() and hasSubDirectory().  This is because they rely on dirent-&amp;gt;d_type to be useful, which isn't guaranteed on all file system types. Once I fixed this problem the file dialog works much better.&lt;br&gt;&lt;hr height=1 noshade&gt;&lt;/font&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;After I aplied the patch everything was working much better. The new file dialog finaly made sense and stuff where no longer saved in some insane subdir hierarchies but in the proper places, the places you actually picked in the dialogs... Yes this is still an AAA game engine we're talking about. ;-)&lt;br&gt;&lt;br&gt;Well, now when that's finaly working I'm off to create a bare bone framework (creating something similar to the MinApp tutorials) to build my prototype on.</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/35899/5621">
		<dc:format>text/html</dc:format>
		<dc:date>2004-04-27T22:53:40+00:00</dc:date>
		<dc:creator>Anders Dahnielson</dc:creator>
		<title>Tuesday Apr 27 22:53</title>
		<link>http://www.garagegames.com/blogs/35899/5621</link>
		<description>* Deleted my last FAT/FAT32 partition this weekend. Have not used any of the old Win32 partitions in two years... So lets see what I should do with them... ext3? reiserfs? :)&lt;br&gt;&lt;br&gt;* I'm going to see if I can use the autotools suite (automake, autoconfig, libtool) as usual to build my Torque Game Engine on GNU/Linux, replacing the currently somewaht clunky makefile build system.&lt;br&gt;&lt;br&gt;* It would also be really cool if I then could use the MinGW for GNU/Linux to crosscompile TGE and ending up bulding Win32 binaries entirely in a GNU/Linux environment. ;)</description>
	</item>
</rdf:RDF>
