Sign in to follow this  
WilliamNorman

Newb here

Recommended Posts

WilliamNorman    106
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

Share this post


Link to post
Share on other sites
zerothrillz    152
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.

Share this post


Link to post
Share on other sites
WilliamNorman    106
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?


Share this post


Link to post
Share on other sites
fastcall22    10845
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".

Share this post


Link to post
Share on other sites
Atrix256    539
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)

Share this post


Link to post
Share on other sites
WilliamNorman    106
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.

Share this post


Link to post
Share on other sites
jnmacd    197
??
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?

Share this post


Link to post
Share on other sites
WilliamNorman    106
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.

Share this post


Link to post
Share on other sites
KulSeran    3267
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.

Share this post


Link to post
Share on other sites
WilliamNorman    106

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

Share this post


Link to post
Share on other sites
pulpfist    528
Quote:
Original post by WilliamNorman
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.


Hi, and welcome


Things are done differntly depending on platform and tools, but some typical scenarios on windows would be:

There is 2 ways to link your program to a library.
You got dynamic linking. This basically means that your exe will depend on a dll file (dll = dynamic link library)
Then you got static linking. In this case, the library you statically link to becomes a part of your exe. This will obviously also increase the size of your exe.
Note that a lot of the third party libraries out there has licenses that requires you to use dynamic linking.



There is three ways I can think of to solve your problem.
1. Copy the dll and images along with your exe so they remain in the same folder.
2. Copy the dll to a folder that is listed in your PATH environment variable, like c:\windows\system32.
3. Add the folder containing the dll to your PATH environment variable.

A installer package will typically do either 2 or 3.




Regarding the BS degree, schools and universities often doesn't have time to teach students about specific tools or how to deploy and install programs. They are busy enough teaching all the math and programming languages required, so I'm not so surprised about that. In fact I'm glad I didn't learn that kind of thing myself as it is the kind of thing you can pick up along the way anyway.

Share this post


Link to post
Share on other sites
WilliamNorman    106
Quote:


There is three ways I can think of to solve your problem.
1. Copy the dll and images along with your exe so they remain in the same folder.
2. Copy the dll to a folder that is listed in your PATH environment variable, like c:\windows\system32.
3. Add the folder containing the dll to your PATH environment variable.



Thanks a lot for the response, I will mess around with this and see what i can come up with.

Share this post


Link to post
Share on other sites
pulpfist    528
Quote:

Thanks a lot for the response, I will mess around with this and see what i can come up with.

Sure. Actually I had C++ in mind. With C# things can be a bit different. I'm pretty sure you can make resources like images a part of the assembly/executable but I don't remember how atm.

Anyway, good luck with that

Share this post


Link to post
Share on other sites
NightCreature83    5006
Quote:
Original post by Atrix256
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)



In most professional development areas C++ is used for PC and X360 development, C# is used as a tools development language. So it pays to actually know both when you apply for a job in the industry.

Share this post


Link to post
Share on other sites
WilliamNorman    106
Quote:
In most professional development areas C++ is used for PC and X360 development, C# is used as a tools development language. So it pays to actually know both when you apply for a job in the industry.


Noted, Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this