Game Development Community

InializeProject error with a new project in IDE (newbie)

by David Janik-Jones · in Torque Game Builder · 01/25/2008 (5:38 pm) · 12 replies

I created a brand new project and it build and runs fine as a standalone but when I try to play it from within the IDE I get the dreaded "initializeProject" error message that is in the main.cs from the root of the project.

What do I do to get it to run from within the IDE? The Behaviour Tutorial runs fine from within the IDE so why won't a new project?

Thanks.

#1
01/25/2008 (6:45 pm)
I'm not sure I understand your issue... which IDE are you meaning, Visual Studios C++, Torsion, or TGB. Maybe if you include a few more details as well :)
#2
01/25/2008 (8:33 pm)
Hi Matthew.

The TGB IDE. When I create a new project in TGB, save it and the scene etc, then hit the "Play Scene" button in the top bar of the TGB editor, the game screen opens then slides down a dialogue box that states ...

Game Startup Error
'initilaizeProject' function could not be found. This could indicate a bad or corrupt common directory for your game. The game will now shutdown because it cannot function properly."

I found the code that generates this error message in the main.cs file in the top level of the project's directory. This error does not appear though when the project is built into a standalone game, and also does not occur when I open one of the supplied tutorials such as the Behaviour Tutorial and try to Play Scene inside the TGB editor ... in the later case the game plays without a hitch and when done pops you back into the TGB editor.

It must be something missing or not linked in the basic files that get created when you do a New project that exists in the code for the Behaviour Tutorial. Is there any code you need to add to the newly created (game or common) files that get generated when you create a new project?
#3
01/25/2008 (9:27 pm)
Matthew, this is a fairly common bug for new users. When running a project through the TGB Interface, the program will not accept paths with spaces or other odd characters. When the project is built, no such limitation exists however.

Here's another thread (in the bug reports forum) with the same problem.
www.garagegames.com/mg/forums/result.thread.php?qt=71092
Quote:Topic: TGB 1.6.0 Game Startup Error
Carpenter Software
Member Posted: Jan 09, 2008 17:15
I try to RUN a game but I get the following:


Game Startup Error

'initializeProject' function could not be found.
This could indicate a bad or corrupt common directory for your game.

The Game will now shutdown because it cannot properly function


I just downloaded the latest Mac version TGB 1.6.0.

IS there a work around for this?

Operating System:
Mac OS X version 10.5.1
Model Name: Mac Pro
Memory: 1 GB
Bus Speed: 1.33 GHz

(added)
I had used this version on another machine (Mac G5) and I had no problem!?

(added)
Weird: I just downloaded TGB 1.5.1 and The installer crashes upon starting up!?
Using the same Operating System as mentioned above.

Carpenter Software
#4
01/25/2008 (9:31 pm)
And another thread, this time for the fish tutorial. As you can see, new users are very confused when confronted with this error message. It's very misleading, often forcing the developer to think they coded something wrong in their main.cs file or that the tutorial they are following is flat out wrong.

www.garagegames.com/mg/forums/result.thread.php?qt=67890
Quote:Topic: Mac 1.5.1 (INDIE version) + Fish tutorial
Mark Armitage
Member Posted: Oct 03, 2007 11:23
I tried the fish tutorial using 1.1.3 and it works fine (until the end with the 1.5.1 features obviously).
[I actually tried it in 1.5.1 first, had problems so tried it in 1.1.3 in case it was me].

I try the same thing in 1.5.1 (it's a 1.5.1 tutorial that I am following from the 1.5.1 documentation), and now I have lots of problems.

The menu title stays as Untitled unless I reload - 1.1.3 puts the proper name in the title bar.

My main problem though is whenever I try to run it (step 4) then I get an error:
Game Startup Error - initializeProject function could not be found.

Considering all I have done is install 1.5.1 and I am following a 1.5.1 tutorial then this seems a bit poor! Not like I am doing anything really odd.

Can anyone enlighten me on how to get it working and why I should be having problems when all I have done is a normal installation?


I'm using a MacBook Pro, 10.4.10, latest patches, loads of disk space, 2MB RAM.

Quote:Posted: Nov 09, 2007 22:23
I've run into this bug myself a few times too. Has to do with Filenames, more specifically it's going to occur if you have a space inside the parent folder for your project.

So lets say you've got My Torque Games/My Game/project.t2dProj as your directory in the user folder.
You'd have to change the folder path to something like this
MyTorqueGames/MyGame/project.t2dProj or
My_Torque_Games/My_Game/project.t2dProj

I'm sure there are many other types of characters that will prevent your project from opening. Make me curious to see if this would effect a fully built game. Don't exactly want someone downloading my game, and dropping it into a seemingly harmless folder, and discovering it doesn't work.

I'm really not sure if it's ever been reported seeing as the forum search is broken. If we don't end up getting an acknowledgment from GG in this thread, you should probably repost this in the private Bug Reports forum if you have access.
#5
01/25/2008 (9:34 pm)
It's also worth noting that so far, I have not seen any reports of TGB Windows displaying this problem, only the Mac version. Anyone experience this on Windows yet? I'd love to hear about it.
#6
01/26/2008 (12:59 am)
Nope, I'm running windows TGB 1.6 pro and created a complete new project from within the IDE and can run it just fine. The game path has spaces inside.
#7
01/26/2008 (7:59 am)
And I get the error on a new project in 1.6 even without spaces, so that's not it.
#8
01/26/2008 (7:12 pm)
What is the folder path you are saving the project to?

Is it something like Hard Drive/Users/[Username Here]/My Torque Games/Project Folder

If so, make sure there are no spaces (or extra characters) in the "My Torque Games" or "Project Folder" too. You'll want to name them something like "MyTorqueGames" and "ProjectFolder".
#9
01/26/2008 (7:19 pm)
Quote:What do I do to get it to run from within the IDE? The Behaviour Tutorial runs fine from within the IDE so why won't a new project?

The behavior tutorial works fine because Torque installs itself by default in the Applications folder. There are no special characters used in the file path. Any projects you create default to within your Home location within some sort of folder usually. You're getting this message because for some reason, torque is unable to read the path to your project. If you move the entire project to your Applications/TorqueGameBuilder folder, you should be able to open it and run.
#10
01/27/2008 (6:52 am)
I also posted in the other thread but for completeness for anyone else reading this I'll post here ...

Thanks, Chris, that was it. My projects were being stored in /myhardrivename/users/documents/david/development/tgb projects/gamename.

The minute I changed the folder name "tgb projects" to "tgbprojects" it works fine.

I'd personally say that's something that needs to be fixed in the next revision of TGB.
#11
05/24/2009 (6:55 pm)
Thanks for this thread! It really solved a vexing problem.
I'd just like to suggest that this probably isn't much of an issue for Windows users because Windows doesn't traditionally allow users to set up any paths with spaces.
I'm not sure if this is how things are automatically configured on most Macs, but I had to be sure not just to re-name my hard drive folder "MacintoshHD" from "Macintosh HD".
Thanks again!
#12
05/25/2009 (1:35 am)
The harddrive name doesn't matter, as the actual path to your home directory is under /Users. The harddrive is "/", but it has a name. The name isn't a folder name, but a device name, so you'll be fine that way.

The fact that the Mac version of TGB can't handle spaces is a bug. Something in the OS X side of platform code is doing its own path handling code. TGB should be ported over to Cocoa, and use platform methods for all path handling so that stuff actually works. Cocoa code can also be compiled as 64-bit, so three-platform Universal apps are possible.