Error in 3-D programming all-in-one?
by Romick, Richard · in General Discussion · 06/15/2004 (1:12 pm) · 7 replies
This is a question for those people who have read this book,
I've been working my way through Ken's book 3-D programming all-in-one, and i've gotten to the end of chapter 4 to the point that I am supposed to run the game. However, when I double-click the tge.exe icon at the c:\emaga4 it doesn't work. To fix this, I replaced all of my source files with ken's source files from the book. It still doesn't work. I then double checked to see that they were all in the right places, they were. Has anyone else come across this problem?
I've been working my way through Ken's book 3-D programming all-in-one, and i've gotten to the end of chapter 4 to the point that I am supposed to run the game. However, when I double-click the tge.exe icon at the c:\emaga4 it doesn't work. To fix this, I replaced all of my source files with ken's source files from the book. It still doesn't work. I then double checked to see that they were all in the right places, they were. Has anyone else come across this problem?
About the author
#2
06/15/2004 (4:51 pm)
What does it mean when you start tge.exe and you come up with a blank msdos screen?
#3
06/15/2004 (4:57 pm)
Not a lot, really. With the chapter 4 code nothing gets written to the DOS screen. Chapter 5 is different in that you will see additional info in the DOS window. What you should do is look at the contents of the console.log to see if there are any error messages written there that will help you diagnose the source of the failure.
#4
I'm used to microsoft visual c++ to where it will tell you upon compiling when there is an error. I with Ultraedit would do that, but oh well.
06/15/2004 (5:15 pm)
Kk, tnx for the helpI'm used to microsoft visual c++ to where it will tell you upon compiling when there is an error. I with Ultraedit would do that, but oh well.
#5
Another very useful thing to do is scan the console.log file that gets created in the program's root directory when you run the program. I nailed most of my problems because of errors written in that log.
"That said, I actually think the discrepancies are a good thing in many ways. I typically learn way more through debugging than I do through simple text input."
I second that! I've learned quite a bit more from sorting out my typos and getting code to work.
06/15/2004 (7:33 pm)
I had a similar problem with Emaga 4. The CD Source code doesn't match the book examples in a number of places and I tried substituting it as well. The remedy was to type in all the program listings *just* the way they appear in the book. One thing I learned from this was to be VERY careful when typing the % and $ characters! Also, I found it was easy to make a mistake in "where" I placed the files, especially the "main.cs" files. It was easy to get confused at first.Another very useful thing to do is scan the console.log file that gets created in the program's root directory when you run the program. I nailed most of my problems because of errors written in that log.
"That said, I actually think the discrepancies are a good thing in many ways. I typically learn way more through debugging than I do through simple text input."
I second that! I've learned quite a bit more from sorting out my typos and getting code to work.
#6
That installs everything EXCEPT the files in the book. From there, either type in the files from the book OR look in the same place you got the installer (Ch4 resources on CD) and copy the files over from there.
That leaves you with 1 error still. That is the file called something like game.cs. It should be named "server.cs" and there is ONE file (I wanna say initialize.cs) that needs one line it it changed from: Exec("./game.cs") to read Exec"./server.cs").
Note that (for me) even without making that one change, it still worked (because it still loads the file, it just has it named wrong).
Hope this made a little bit of sense and more importantly, I hope it helped.
-DWB aka Pony
06/16/2004 (12:23 pm)
I had problems with emaga4 also. It has been a couple weeks, but if memory serves me correctly, you can put the CD that came with the book into the drive, then choose resources and chapter 4, from there double click the thing that is like "emaga4 installer". That installs everything EXCEPT the files in the book. From there, either type in the files from the book OR look in the same place you got the installer (Ch4 resources on CD) and copy the files over from there.
That leaves you with 1 error still. That is the file called something like game.cs. It should be named "server.cs" and there is ONE file (I wanna say initialize.cs) that needs one line it it changed from: Exec("./game.cs") to read Exec"./server.cs").
Note that (for me) even without making that one change, it still worked (because it still loads the file, it just has it named wrong).
Hope this made a little bit of sense and more importantly, I hope it helped.
-DWB aka Pony
#7
Aside from my own typo's, making sure that I had semi colons after statments, the main issue I found was in control\server.cs where it defines the dataBlock as HumanMaleAvatar, but in player.cs I could only find MaleAvatar, I removed the "Human" bit and it worked fine, so either remove the "Human" bit on server.cs or add it in player.cs and you should have it ok.
Brian
ps I better add a disclaimer, in that 5 hours later I'm not entierely sure if the human thing was an error on my part or the CD (yes...I could check...but its been 5 hours and I need coffee), but just keep checking hte log file to hunt down the bugs.
pps. yup after coffee, I checked the CD and it does indeed refer to a MaleAvatar rather than a HumanMaleAvatar, so I had used the CD player.cs file and typed in the server.cs file which use different references....not sure how many others will get stuck on this but just so you know its probably best to use all the CD or all the book text and not mix them up as I did.
06/17/2004 (7:38 am)
I've just been going through that example myself, I know the code is on the CD and copied some over but was reluctant to use it all as I wanted to get used to the way the code is written...its possible I may have unknowingly fixed the errors mentioned above myself, but now I've done it I'm not sure.Aside from my own typo's, making sure that I had semi colons after statments, the main issue I found was in control\server.cs where it defines the dataBlock as HumanMaleAvatar, but in player.cs I could only find MaleAvatar, I removed the "Human" bit and it worked fine, so either remove the "Human" bit on server.cs or add it in player.cs and you should have it ok.
Brian
ps I better add a disclaimer, in that 5 hours later I'm not entierely sure if the human thing was an error on my part or the CD (yes...I could check...but its been 5 hours and I need coffee), but just keep checking hte log file to hunt down the bugs.
pps. yup after coffee, I checked the CD and it does indeed refer to a MaleAvatar rather than a HumanMaleAvatar, so I had used the CD player.cs file and typed in the server.cs file which use different references....not sure how many others will get stuck on this but just so you know its probably best to use all the CD or all the book text and not mix them up as I did.
Torque Owner Jay Eakins
I have noted, however, that the source provided in the resources directory for each chapter does not necessarily match that in the text of the book, so just copying the source from the CD to your runtime directory isn't going to be sufficient, as it may not match with entries in other .cs modules that you have in your directory structure. There are variable names that are different here and there, for one thing (more so in Chapter 5 than in 4) and in chapter 4 there are a few stubs missing in the the book text for client.cs (that's a non-fatal issue though, just writes messages to the log).
If you want to use the code from the resources directory, probably the best thing to do is to make another comparison run through the code and compare each line with that in the book. When they are different, change it to match that in the book and it tends to work just fine.
That said, I actually think the discrepancies are a good thing in many ways. I typically learn way more through debugging than I do through simple text input. :)