Game Development Community

GPGT Chapter 14 - Issues and Questions

by Edward F. Maurina III · in Torque Game Engine · 05/16/2006 (10:42 pm) · 21 replies

Hello All. This thread is dedicated to any questions or issues that you may find in this chapter.

If you have issues and questions for other chapters, please post them in the appropriate thread:

Chapters 1 & 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14

GPGT Support Page
Appendix E. Maze Runner Lessons (Steps Only) - Covers Mac and Windows
OSX Executable - Use for GPGT Lesson Kit and MazeRunner
Page «Previous 1 2
#1
07/07/2006 (7:27 pm)
I recently purchased The Game Programmer's Guide to Torque.

I'm a newbie and very frustrated.
I am working on an iMac G5 with Torque DemoOSX-1-4
I'm trying to get the prototype to work.

On page 576 -
14.4.4 Modify "main.cs" it says:

Next, edit "main.cs and change line 6 from this:

$defaultGame = "demo";

to this:

$defaultGame = "prototype"

This will use our new "prototype" mod instead of the demo mod.

Question 1
I can't find a "main.cs" that has $defaultGame = "demo"; anywhere in it's script.
Where can I get It?

14.4.5

I've added the new code to \MazeRunner\prototype\main.cs so it looks like this:

function onStart()
{
// Maze Runner changes Begin -->
exec("./EGSystems/SimpleInventory/egs_SimpleInventory.cs");
exec("./EGSystems/SimpleTaskManager/egs_SimpleTaskManager.cs");
exec("./EGSystems/Utilities/egs_ArrayObject.cs");
exec("./EGSystems/Utilities/egs_Misc.cs");
exec("./EGSystems/Utilities/egs_Networking.cs");
exec("./EGSystems/Utilities/egs_SimSet.cs");
exec("./EGSystems/Utilities/egs_String.cs");
// <-- Maze Runner Changes End

Parent::onStart();

This is what I have in my MazeRunner directory so far:

\deldso
\delml
\prototype
\Torque Demo OSX
\Torque ShowMod

This is what I have in prototype directory:

\client
\data
\EGSystems
\main.cs
\server


Question 2
Should I assume I need the "main.cs", that I can't find, in the \MazeRunner directory with "prototype & Torque Demo OSX"? The book does not tell me to add anything else to execute the test run.

Question 3
Is "Torque Demo OSX" the executable?
#2
07/13/2006 (5:24 pm)
I'm having the same problem that Kenneth is for Question # 1.

Also, what .exe is the book referring to? I don't recall reading anything in the book that mentions copying an .exe from the CD over to my computer to run.
#3
07/13/2006 (7:17 pm)
Changes to Question 2 and 3 above.

Question 2
What should I have in each directory (file) to make the prototype work and where can I find it?
It is damn hard for a beginner to get a grasp of this material if he can't get to square one. Don't I need an executable in the first directory(MazeRunner)? Where is it?
Should I assume I need the "main.cs" (which I can't find) in the \MazeRunner directory along with "prototype & Torque Demo OSX"? The book does not tell me to add anything else to execute the test run.

Question 3
How can I get MRA to run on my Mac?
I downloaded MRA from the author's website. I can't get the zip files to unarchive. I get a dialog box that says:

Unable to unarchive "common.zip" into "desktop". (error 78 - function not implemented)

I thought by looking at MRA it would help me understand what is needed in "prototype"
alas, nothing seems to work.

Question 4
In the GPGT LessonKit there appears to be an executable "gpgt.exe". When I double-click on it I get a dialog box that requests an application. Shouldn't this start the demo?

If anyone can help me, my eMail is kenmalone@a-znet.com.
I hope someone out there was once a newb and understands my frustration.

Thanks in advance for pointing me in the right direction.
#4
07/14/2006 (1:39 pm)
Ok, having accrued a certain amount of emnity for the standard filepaths, here's what I can see:

If you are running this directly from the book, you MUST install the Demo version first. That is what defines the basic Torque setup, including the engine Application, and that pesky "main.cs" file you're attempting to modify.

On the disk that came in the book, you're looking for the file "TorqueDemoOSX-1-4.tgz" -- I found a copy in the "TorqueDemoInstallers" folder in the disk's root folder. (@Oliver, sounds like you are on a Wintel box so you would be looking for "TorqueDemo-Installer-1-4.exe" instead.)

Once that has been unarch'd and placed on your HD, you should find those files waiting for you.

Another vital reference is the PDF file for Appendix C located in the appropriate folder on the disk. (It at least mentions what and how to set things up.)

As far as MRA goes, never messed with it. Sorry.

The GPGT.exe file should just be the Torque application with a different name (you can rename it to whatever you want as far as I can tell.) In all cases you need to use the version of the engine for that machine (i.e. as setup by the Demo installer mentioned above) and just change the files/subfolders it's looking at -- which is what that modification to the "main.cs" file is all about. (By changing the "$defaultGame" variable, you are telling it which subfolder to look into for more Scriptfiles to execute.)

For instance, I got tired of changing all the files (or setting command line parameters) to force different "mods" to load and run. So I just created directories for each one, copied the application files into the main folder of each copy and now each mod runs it's own little heart out. Efficient or elegant? Hell no. Effective? Yup.

Hope this helps a bit.
#5
07/16/2006 (9:18 am)
Thanks Sean,

What you have told me, I've done four times and do understand everything you've said. That helps me know I'm going in the right direction but, I still can not run "prototype", so I can't move beyond 14.4.7.

Do you run Mac or PC?

Your last paragraph interests me.

"For instance, I got tired of changing all the files (or setting command line parameters) to force different "mods" to load and run. So I just created directories for each one, copied the application files into the main folder of each copy and now each mod runs it's own little heart out. Efficient or elegant? Hell no. Effective? Yup." <== I like those last two words!!!

What do you have in your root directory that allows it to work as compared to mine, as listed below?

This is what I have in my "MazeRunner" directory so far:

\deldso
\delml
\main.cs <== I've changed the word in line 6 to "prototype"
\prototype
\Torque Demo OSX
\Torque ShowMod

This is what I have in my "prototype" directory:

\client
\data
\EGSystems
\main.cs <== I've changed the function onStart() to: See below *
\server

*
function onStart()
{
// Maze Runner changes Begin -->
exec("./EGSystems/SimpleInventory/egs_SimpleInventory.cs");
exec("./EGSystems/SimpleTaskManager/egs_SimpleTaskManager.cs");
exec("./EGSystems/Utilities/egs_ArrayObject.cs");
exec("./EGSystems/Utilities/egs_Misc.cs");
exec("./EGSystems/Utilities/egs_Networking.cs");
exec("./EGSystems/Utilities/egs_SimSet.cs");
exec("./EGSystems/Utilities/egs_String.cs");
// <-- Maze Runner Changes End

NOTE: It was suggest in someone else's post that the line:
exec("./EGSystems/SimpleTaskManager/egs_SimpleTaskManager.cs");
be used instead of:
exec("./EGSystems/SimpleTaskMgr/egs_SimpleTaskMgr.cs");
which was printed in the book.

I've tried both.

Got to go to work, be back to the Forum tonight.
#6
07/17/2006 (6:04 am)
MOVING ON! (But, still the same problem)

On page 574, Chapter 14.4 it states:

* "\MazeRunnerAdvanced". This directory contains a completed version of MazeRunner with several additional features as suggested in Section 14.10, "Improving The Game".

The operative words here are: "completed version".

Am I to assume that by placing the "Torque Demo OSX" in this root directory and double clicking it, it should launch "MazeRunner"?

I tried that and it did not work.

I also added "Torque ShowMod" and that did not work.

I am beginning to believe that not enough effort was put into testing the instructions in the book and the files on the CD to make sure things worked.

The best way to get us Mac Guys to buy book two is for someone at HOW to help us with book one.

Some nice PC Guys have tried to help but the suggestions are not working.

IF THERE IS SOMETHING MISSING FOR THE MAC (script or whatever) --- TELL US SO!

Maybe the Mac community can fix it.

- - - - - - -

This is what I get from "Torque ShowMod" when I try to load "MazeRunnerAdvanced"

Completed Command

Last login: Sun Jul 16 10:36:40 on console
/Game\ Development/Maurina\ -\ GPGT\ /MazeRunnerAdvanced/Torque\ ShowMod.command; exit
Welcome to Darwin!
G5-2:~ Ken$ /Game\ Development/Maurina\ -\ GPGT\ /MazeRunnerAdvanced/Torque\ ShowMod.command; exit
/Game Development/Maurina - GPGT /MazeRunnerAdvanced/Torque ShowMod.command
/usr/bin/cd: line 4: cd: /Game: No such file or directory
/Game Development/Maurina - GPGT /MazeRunnerAdvanced/Torque ShowMod.command: line 6: ./Torque Demo OSX.app/Contents/MacOS/Torque Demo OSX: No such file or directory
logout
[Process completed]
#7
07/17/2006 (6:26 am)
Missed putting this in the last post.

Does information provided by the Torque ShowMod indicate any problem?

I notice the lines

Quote:/usr/bin/cd: line 4: cd: /Game: No such file or directory

and

Quote:/Game Development/Maurina - GPGT /MazeRunnerAdvanced/Torque ShowMod.command: line 6: ./Torque Demo OSX.app/Contents/MacOS/Torque Demo OSX: No such file or directory

have "No such file or directory"

Can someone tell me what Torque ShowMod is telling me?
#8
07/19/2006 (5:36 pm)
@Kenneth - Here are some answers to questions you've asked thus far, both here and in the thread Mac User frustrated with GPGT book.

1. Regarding the issues you are seeing with getting the Maze Runner Lessons to run/work. As you know already, I'm working on improving the OSX experience. Please bear with me for a bit. I do have access to an old iMac from 2002 belonging to my wife, but my access to the machine is limited and it is somewhat dated. That said, I may accelerate my own hardware update schedule and add a Mac to my collection of dev machines. Meanwhile, keep a watch in this thread for updates specific to the MAC experience.

2. What should you have in each directory? I will lay this out as part of my effort and in Appendix E as I polish it up.

3a. How can I get MRA to run? Well, as you probably know, I have supplied a new demo version of MRA on my site. You can download it here MRA for OSX. However, please be aware there are some disclaimers attached to this demo right now.

Disclaimer 1. I was able to play the game on my wife's (old) iMac, but it did crash when I tried to bring up the credits screen. This might be because her Mac has never been updated or rebuilt, or it might be because something is wrong on my end. I will know more as I investigate.

Disclaimer 2. This demo only has DSO files. Because it is available publicly, I ran it once and then deleted the .cs files (excluding main.cs). This means you can't see the scripts.

Disclaimer 3. The file is currently corrupted. After I get these answers out I'll upload it again.


Note: You said this above "Am I to assume that by placing the Torque Demo OSX in this root directory and double clicking it, it should launch "MazeRunner?". The answer would be yes, but the Torque Demo OSX file that come w/ the demo (not the SDK) is some kind of executable zip file (or something like it) which contains all the assets, scripts, and executable. Thus it always looks in itself for main.cs and all other files. I know this is confusing, but I'll come up with a clear/clean solution as I work on #1.

3b. Why can't I open common.zip and prototype.zip in the windows demo. Again, because I posted the demo on a public site (my own), I locked the contents of those directories as password protected zip files. If you want to take a look at the MRA scripts, you'll find them on the CD that comes w/ the book.

4. gpgt.exe - Yes, this should start the application, but only for Windows machines. On a Mac, you need to drop a Mac version of the executable into that directory and then run it. However, I'm guessing it won't be that easy. As part of #1 above, I am going to be looking at the GPGT lesson kit too.


All of your questions have underscored how poorly I have prepared the accompanying materials for OSX guys. However, I am now working to right this.

Thank you for posting and getting me on the ball.

www.hallofworlds.com/how.ico Hall Of Worlds - For Gamers
EdM|GPGT
#9
07/24/2006 (1:08 pm)
Hey Edward,

I'm not a MAC user but I was having a similar problem getting setup. Any advice for me?

Thanks.
#10
07/24/2006 (4:49 pm)
@Oliver,

1. Be sure to see to get the Errata Doc and the FAQ from my GPGT Support Page.

2. If those documents do not have any advise that helps and you don't see an answer in these forums, please post a short description of your problem and the steps you have tried to the appropriate chapter- forum (as you already know, this is the correct one for setup issues).

Once you've posted an issue description, I'll look at it investigate if neccessary. Either way, I will reply with instructions.


www.hallofworlds.com/how.ico Hall Of Worlds - For Gamers
EdM|GPGT
#11
07/26/2006 (12:26 pm)
Thanks, I'll read through that Errata Doc first. If I still have problems I'll post a detailed write up of my issue.
#12
07/28/2006 (7:15 pm)
In case you missed my recent blog, the OSX fixes are ready for use.

First, get the new appendix here.


Second, get the OSX Starter. You'll need this if you're using OSX.


Third, if you wish, you can get a copy of the OSX Executable for use with both the full copy of the 'GPGT Lesson Kit' and 'Maze Runner Advanced'. Instructions follow:

To use this with the 'GPGT Lesson Kit',
1. Copy the 'GPGT LessonKit' folder off the CD onto your hard drive.
2. Unzip OSX Executable into this new folder.
3. Double Click 'Torque Demo OSX'

To use this with 'Maze Runner Advanced',
1. Copy the 'MazeRunnerAdvanced' folder off the CD onto your hard drive.
2. Unzip OSX Executable into this new folder.
3. Double Click 'Torque Demo OSX'


www.hallofworlds.com/how.ico Hall Of Worlds - For Gamers
EdM|GPGT
#13
12/02/2006 (9:48 pm)
I'm not using the Demo version that came with the book, as I already own a copy of 1.4. I installed it into C:/Torque, and then I copied the SDK directory into C:/Mazerunner. The only main.cs file I have is in the prototype directory. There is no main.cs in the Mazerunner directory, and there isn't one in SDK directory either. Can someone point me in the proper direction, please?

Also, (knowing what I know from TGB), will Mazerunner have to be in a "game" directory somewhere in order for the .exe to be able to find it? Or can it be outside of the normal Torque directory structure? In my structure my directory looks like this:

c:\Mazerunner
c:\Mazerunner\SDK
c:\Mazerunner\prototype

The .exe for Torque isn't in the SDK directory, so I'm assuming it must be somewhere else.

Thanks!
#14
12/02/2006 (10:28 pm)
There should be a main.cs in the MazeRunner directory and also the prototype directory. The one you edit in 14.4.4 is the one in MazeRunner. Its used to launch the game from the demo.exe.
#15
12/03/2006 (8:12 am)
Thanks for the fast reply, but I understood the directions. There's only a main.cs in the MazeRunner directory if you use the Torque Demo from the CD. I didn't do that. I had a previous install of TGE 1.4 on my hardrive under C:/Torque. It contained a single folder => C:/Torque/SDK and I copied that into the MazeRunner directory so that my MazeRunner structure looks like => C:/MazeRunner/SDK. When I looked around, the only main.cs I found (other than in the prototype directory) was at C:/MazeRunner/SDK/Example/. When I altered it, and followed the other directions, nothing loaded. I'm assuming it's because main.cs and the executable are in a different place from where they need to be. Unfortunately, I don't know how to alter the directory structure to fix this problem, without ruining the full version of TGE.

Thanks again.
#16
12/03/2006 (9:08 am)
Sorry I didnt understand you at first. You need to put your prototype directory into the example directory.

SDK/example/prototype

then change the main.cs in C:/MazeRunner/SDK/Example

edit:

Or if you dont want to edit the main.cs file you can make a new file in notepad and put this in it:
Demo.exe -game prototype

Where Demo.exe is the name of your torque executable and the directory is called prototype. Then save as 'Prototype.bat' in the same folder as the Demo.exe. Then click on that to launch your prototype game.
#17
12/03/2006 (10:24 am)
Thanks! I've already edited the main.cs in the Example directory. It's how I tested whether it would work last night. I'll just drag over the prototype directory and see if that works. :) I really appreciate the help!
#18
12/03/2006 (11:52 am)
No prob :)
#19
03/08/2007 (10:32 pm)
I tried to unit the std editor with Mazerunner advanced but there is a bug that causes texual names not appearing in the tree view of world editor. can it be resolved.
#20
03/09/2007 (4:20 pm)
Saurabh,

Hi. Actually, I think that the names are there, but the font doesn't show up well in the editor.

If you look in the file ~/client/ui/customProfiles.cs, you will find two references to the fontType "Smilage".

Try replacing that with "Arial" or another font of your choosing. If that fixes the problem then you have three choices.

1. Continue using your newly selected font,

or

2. Go back to using Smilage, but play around with the font settings so that the letters show up better in the editor tree,

or

3. Remain with smilage, but fix the profiles used ONLY by the editors so that they use a more visible font.


www.hallofworlds.com/how.ico Hall Of Worlds - For Gamers
EdM|GPGT
Page «Previous 1 2