Game Development Community

Directory setup --bare bones

by Keith Mc Dowell JR · in Torque Game Engine · 07/24/2007 (4:58 pm) · 9 replies

Hey, everyone..

No, idea where I'm going wrong with getting a good setup on a clean game development directory setup.

This is how I have development setup.

(thgamename) main directory
main.cs -- this defines the loadDir(""); madness from last week
game.exe -- TGE

thegamename/game -- directory you find:

client
init.cs -- defines the InitCanvas, InitBase....etc
interface
server
init.cs
data
main.cs
-- exec("./client/init.cs"); -- location of InitCanvas

-- thegamename/main.cs -- can successfull find the /game directory and load files using ./client/init.cs
But the problem is that console.log and Torquescript give me an error message that it can not find InitCanvas()
I watch it find the init.cs file read the file, step into the functions and that it. Can work with the demos, but having a difficult time trying to get my setup going correctly.

Thanks,

#1
07/24/2007 (7:31 pm)
Here is an example, on this link is a downloaded .gif

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3749

there is one somewhere in the doc's but I can't remeber where it is
#2
07/24/2007 (11:52 pm)
Also check out this tutorial on TDN. Helped me no end.
#3
07/25/2007 (2:33 am)
Personally (folder hierarchy) I woud leave the creator, and common folder as is, and make a folder for the game itself, and use the hierarchy simiular to what is seen in the .gif in my initial post.

Here is the link's to the series that has been completed so far by Micheal Perry
These are great for beginners IMO like myself.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12721

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12846

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12943
#4
07/25/2007 (10:03 am)
Hey, guys
Thanks again . James, the Micheal Perry the documentation was very good, but visually I can not see where those examples are placed. The flowchart really open a better idea of the layout of the how a basic directory should look. I think the problem, with some of the documentation, is that when you compare the examples verus ones design by others, there is not a uniform method of laying out the structure.
Last week, I was trying to figure out loadDir(""); -- none of the instructions provided a paper trail to which main.cs it should be in or which directory it should be, and top it completely off.. you have to define the push commands in one of the main.cs, so it can pop-back and transverse the directory to find the other files.

Michael Perry, example in 1.1 on the first tutorial is a good example; it's is assuming that the designs knows where loadDir(""); is being called from. If you follow the example by face value. Your first error messages; is that loadDir("") can not be found.

Nothing is said about this tidbit of code; that you need inorder for loadDir("") to be found much less get past the error message "loadDir can not be found.

$defaultGame = "base";
$displayHelp = false;
function pushFront(%list, %token, %delim)
{ if (%list !$= "") return %token @ %delim @ %list; return %token;}
function pushBack(%list, %token, %delim)
{ if (%list !$= "") return %list @ %delim @ %token; return %token;}
function popFront(%list, %delim)
{ return nextToken(%list, unused, %delim);}

Once you get this piece of code, you can use loadDir(""); commands and statements like these
exec("./client/init.cs") -- do not throw illegal operations commands.

But, its all part of the learning curve.. :) so time spent on sillyness in the log run helps improve your understanding of the hiearchy of torque.
#5
07/25/2007 (10:29 am)
This is for superTag
img68.imageshack.us/img68/7726/layoutqy7.jpgimg236.imageshack.us/img236/315/foldersvh4.jpgthis is for starterFps
img374.imageshack.us/img374/7027/layout1ky4.jpgimg374.imageshack.us/img374/9219/folders1vd5.jpg
basically somethings can be based on how you want it, just be sure to put relative paths exec();
#6
07/25/2007 (12:18 pm)
Hey, James

Ok, this is what I'm talking about! -- Thanks a bunch!! Ok.. One last thing; I hope..

from the Super.Tag < -- Main directory
main.cs --> is going to connec the push commands for loadDir("") that is going to be found in

Super.Tag/Super.Tag/main.cs where you find loadDir("common") ?

Hmm, ok this bring me to the another on activepack..
Does the maingame directory need to reflect the activepack() function?
gamedemo <-- name development directory
but activepack() is reference to game?
Thanks, James
#7
07/25/2007 (12:49 pm)
@Keith - It definitely helps to download the sample project files from the second and third tutorials to see exactly what I've coded and how I lay things out in the directories.

As for your question about activatePackage(): this can technically be called anywhere, so long as it is called before anything else related to your game project.
#8
07/25/2007 (2:31 pm)
Hi, Michael
Thanks again for your reponse.. I've looked at the Super.tag tutorials from second, third tutorials with the layout. If I was to setup a Torquescript project, and attempt to run the third tutorial the way it is, it gives me an error message that it "can not find loadDir("common");
- So I pull over the "common" directory and it's is there but loadDir("common") " can not find loadDir.
Now, if i put the following: into the main.cs setting at the Super.tag directory:

$defaultGame = "Super.Tag";
$displayHelp = false;
function pushFront(%list, %token, %delim)
{ if (%list !$= "") return %token @ %delim @ %list; return %token;}
function pushBack(%list, %token, %delim)
{ if (%list !$= "") return %list @ %delim @ %token; return %token;}
function popFront(%list, %delim)
{ return nextToken(%list, unused, %delim);}

I still think, I'm doing something wrong here.. but I just can't see it. -- it never fires off the OnStart().

Thanks, again
Keith
#9
07/26/2007 (7:06 am)
Ok, I'm a little confused when you try and tell me where you are putting things, can you use some deeper paths for me?

For instance: is your common folder in example\common, or example\Super.tag\common