Newb here

Started by
14 comments, last by WilliamNorman 13 years, 6 months ago
Hello,

I just wanted to introduce my self and say hi. I just recently got my BS in Computer Science and I want to get into game programming but it seems like its a hard world to get in. In school we used C++ but i am teaching myself C# since that is used more often than C++.

I am looking for any advice anyone has on materials to study, books to read, or classes to take that will help me get into this industry. Right now i am using various tutorials i found on you tube using XNA, but any further help or advice is much appreciated.

I also had a question about the .exe file that gets created when compiling the program. The .exe file that is created only works in the folder the project is in. When i move it out of the folder it says it has stopped working. I ran into this problem in school with C++ and was able to solve the problem by making the .exe file independent form the .dll file. I am having trouble figuring out how to do this with C# and XNA in Visual Study 2008.

I just found this forum yesterday and started looking around it but it seems like there is a lot of good useful information. I am excited to find out what all it has to offer.

Thanks
Willam
Advertisement
Quote:recently got my BS in Computer Science


Quote:I also had a question about the .exe file that gets created when compiling the program.


Where did you get your BS from because you don't seem to have gotten your money's worth. And it's likely not working anymore because the locally referenced filenames in the binary are no longer in the place it expects them to be.
Quote:you don't seem to have gotten your money's worth


Ouch ... But, I'll agree with you there because the school i received my degree from which will remain nameless has got some of the worst teachers and academics i have seen.

That being said how do i fix my problem?


Quote:Original post by WilliamNorman
That being said how do i fix my problem?


What compiler are you using? In Visual Studio, the working directory of an executable is by default the project directory (the directory that contains your project). If you have resources your program depends on, then make sure that when you move the exe, you also move the resources along with it. Also, be sure to handle cases in your code where loading a file or a resource may fail. That aside, you can change the working directory when you run your project inside Visual Studio in the project properties sheet, under "Configuration Properties"->"Debugging".
FYI C# is not used more than C++ in game development.

That being said, it probably makes more sense for you to start with C# and learn there, then make the switch over to C++ if you want to.

Then again, it really depends on what platform you want to make games on.

PC or 360 XBLA would be C#
droid would be C++ or java
iphone would be C++/objective C probably
(etc)
Quote:If you have resources your program depends on, then make sure that when you move the exe, you also move the resources along with it. Also, be sure to handle cases in your code where loading a file or a resource may fail.


Yeah that works but i guess my question is, is there any way to switch settings so when it compiles it it will have it all in the .exe file.
??
What is your program doing? You should know if you require additonal files. Have you tried making a simple "Hello World" console app and moved that .exe?
Quote:Original post by jnmacd
??
What is your program doing? You should know if you require additonal files. Have you tried making a simple "Hello World" console app and moved that .exe?


It does require extra files which i have in the content folder (a few .png files) that are associated with it. I'm simply asking is there a way to make the .exe file when compiling it complete with everything so i don't have to include the content folder if i wanted to put it on say a disk.
Quote:
Yeah that works but i guess my question is, is there any way to switch settings so when it compiles it it will have it all in the .exe file.

Well the first step is figuring out what files is actually out of place. Like _fastcall is getting at, you have to debug your program and figure out why it is failing, and put in error checks to support that. If it runs in one directory, but not another then it is likely looking for files relative to the exe. You need to figure out what files those are. Put in error checks if it can't find them. Then remember to move those files too.

You can run your application outside Visual Studio, then when it crashes "attach to process" from the debug menu. You should be able to see the crash at that point.

edit:
Quote:
It does require extra files which i have in the content folder (a few .png files) that are associated with it. I'm simply asking is there a way to make the .exe file when compiling it complete with everything so i don't have to include the content folder if i wanted to put it on say a disk.

You can look up windows resource files. Thats where things like your application forms and icons are stored. You can put other data there too, but the resource loading process changes from a simple file load. You're better off just packing it all up in a zip file and using a zip file library to load the files. That way you're down to just two files to distribute: the zip of resources, and the exe.

Quote:
You're better off just packing it all up in a zip file and using a zip file library to load the files. That way you're down to just two files to distribute: the zip of resources, and the exe.


Ok, thats what i wanted to know.

Thanks

This topic is closed to new replies.

Advertisement