Jump to content
  • Advertisement
Ferik

Game Physics by Dr Eberly

Recommended Posts

Hi there everybody,

My pleasure to be here, My question is a bit embarrassing,

I am a guy with good background in math/physics but I have only knowledge in C programming (and a little bit of C++) and have done writing small programs for console application. I have not done serious things in programming but at least I am not scared of it.

The thing is that I purchased Dr Eberly's Game physics and the book was in perfect condition but there was no cd-rom. I contacted him and he helped me a lot.He provided me with the content of CD_ROM and introduced me to this forum.

But I am still badly stuck. I know nothing about project and sln and these kind of jargons and when I follow the instructions I get either no answer or lots of errors. 

I have installed non-commercial version of visual studio 2019 and still no result.

I totally gave up but wanted to give one more try.

First of all is there anyone who struggled like me? What was the first step on running those physics related simulations? 

Will you please help me get started in right direction? 

Thanks a lot in advance for any and all help.

Share this post


Link to post
Share on other sites
Advertisement

Can you put the source up on GitHub?

Solutions encapsulate projects encapsulate source files, header files, and resource files. When putting your source code on GitHub, it is best to not include the solution/project(s) files, because they can contain malicious configurations.

Are you familiar with the concept of compiling and linking a C++ program?

Edited by taby

Share this post


Link to post
Share on other sites

Can't help with Visual Studio specifically and am not a professional. Yet i try to portion the problem 🙂

You say you know the command line and how to invoke an editor and the compiler and linker and execute a console program so it shouldn't be too hard to overcome an IDE. It just hides the work of writing makefiles and organising a project and offers simple access to debugging. I suggest to go in steps to tackle to block of ide, c++, graphics api-programming, game physics and simulation.

Write a few small programs in the ide, get to know its handling and how to use the debugger and how to set parameters like environment variables, command line arguments, debug- and release configurations. You can produce images without an api like opengl by just writing a text file with colour values (ppm format for example). Done a Mandelbrot set yet ? 🙂

Then how about an opengl tutorial (for example https://learnopengl.com/), that should enable you to draw primitives like spheres and boxes that you'll need for all kinds of physics. You'll need a linear algebra library to put things in places, apply transformations and have all the vector- and matrix data ready in a format opengl understands, often times people learning opengl use the glm library, but i am sure the one you mention will do as well, though maybe at the beginning use glm and switch to a home brew later with more experience.

Hope i wasn't totally off topic ...

Edited by Green_Baron

Share this post


Link to post
Share on other sites
8 hours ago, Ferik said:

I know nothing about project and sln and these kind of jargons and when I follow the instructions I get either no answer or lots of errors. 

The main thing to do, when confronted with lots of errors, is to address the errors.

If you're willing to post on a forum to ask what to do when you see lots of errors, you should be willing to post the errors on the forum and ask what they mean. :)

There's no magic way to equip people for programming - mostly they just have to dig in and accept that it's going to take a bit of research and a bit of asking around to learn things. Don't be afraid to ask here - but also make sure you're putting error messages into search engines to try and understand them.

Also consider spending time on documentation sites like MSDN to learn about "project and sln and these kind of jargons". For example, the first result I got when searching for "visual studio project solution" was very useful. https://docs.microsoft.com/en-us/visualstudio/ide/solutions-and-projects-in-visual-studio?view=vs-2019

Share this post


Link to post
Share on other sites

Thanks for taking your times and replying to my question, I tried to make my question a bit general and it was obviously vague. 

I am partly familiar with linking and compiling and I also have done ppm stuffs.

The reason I did not specifically brought errors up is because first and foremost there are lots of error (in one case 612 errors) and besides sometime I get no error and I am still not getting any answers.

As you can see my knowledge is way below average  and I can not specify my problem clearly.

Dr Eberly told me to open the proper sln file and build it which I did. I also did a lot of variations and I see no result.

Is there anyone here who has experience with this specific book? 

Share this post


Link to post
Share on other sites
10 hours ago, Ferik said:

Is there anyone here who has experience with this specific book?

I doubt, that you will find anyone here, who has. There are so many resources on this topic out there and the chances that a person who has read this book stumbles across this thread are rather small. Even if, you get lucky there is still the question if this person faced the same problems as you do. So let's focus on your specific problems and let's try to solve them.

 

10 hours ago, Ferik said:

I am partly familiar with linking and compiling...

So you have basically no experience in how c++ programs are structured and how they are composed. Nothing to be ashamed of, but using Microsoft Visual Studio is the worst thing you can do right now. Not because it is bad but because it is good. It does so much work for you that you usually don't need to know much about how your program is composed... until there is a problem. I know that from personal experience. I started learning c++ with VS and had a lot of linking problems I did not understand. I opened a lot of threads in forums where people told me which flags I had to change in some hidden options menu. It magically worked. I did not understand why but I was happy until I hit the next problem. I could have saved myself a lot of trouble, if I have learned the necessary lessons about the c++ build system. Unfortunately, the things modern IDEs offer, which make the lives of experienced programmers so much easier, are somehow bad for Newbies.

So my first advice: Do some simple C++ tutorials without using an IDE. Write makefiles, multiple mini-libraries and link them all together. If you don't make any mistakes (unlikely, but might happen), try adding one on purpose and see what happens if you want to build the program. You need to learn how the compiler/linker addresses certain error types, which leads me to the next point:

11 hours ago, Ferik said:

The reason I did not specifically brought errors up is because first and foremost there are lots of error (in one case 612 errors)

2

How cute, just 612? Try hitting 1000 or 10000. It's not that hard to achieve. 😛 Jokes aside. The number of compiler errors you get is absolutely irrelevant. The only thing that matters is the first one. If you forget to include a file where a certain function is defined, the compiler will create an error every time you use this function. I can only support the things @Kylotan mentioned. Try solving all errors step by step. Always solve the initial error and don't bother with the others which are probably just subsequent errors. If you don't know how to solve a specific error, ask and give us the error message and the code section that caused the error.

 

11 hours ago, Ferik said:

besides sometime I get no error and I am still not getting any answers.

We can't help you if we don't know, what is supposed to happen. If the program compiles, you have at least a more or less working program. If you run the program and you get no output there might be multiple reasons:

- The program is not supposed to print any output.

- The output is written to a file that you have to open with a certain software tool (ParaView is quite common in Physics simulations)

- The program crashed. In this case, you should get at least an error message which you can provide to us.

So please tell us, what the program is supposed to do and what it is actually doing.

 

11 hours ago, Ferik said:

Dr Eberly told me to open the proper sln file and build it which I did. I also did a lot of variations and I see no result. 

I stopped using VS a long time ago, but I think the VS Version which was used to create the file is somehow important and you might face a compatibility problem here. But that's some wild guessing from my side. Maybe a more experienced user can tell you something about it.

 

However, I suggest you put the book aside for a while and start learning the basics of c/c++. This is not an easy task since c/c++ are rather difficult languages, so it will probably take some time. In my opinion, it makes no sense to learn programming game physics without some solid knowledge about the programming language you intend to use. It will just frustrate you.

 

Greetings

Share this post


Link to post
Share on other sites

okay...I guess. Yes, it's true about VS version compatibility but isn't the problem in my opinion. This code set was released with VisualC++6 solutions and projects. I had to dig this book out because of its age, but the WildMagic2 engine library builds without error in VS2017 after standard solution upgrade process. Choosing at random the Application2 project, I can say there are issues. First I noticed that the solution upgraded general properties had set the configuration to build as a library. That seems wrong because there is a WinMain (at least in the DX build profile) and instead I would have thought the setting should be to build executable. Second, the project include and link directory search paths are not set. There are a few required additions for the include path here. One to the root folders include directory and one to the older version of DirectX and a path to the renderer implementation. (I'm ignoring GLUT and WGL profiles for the moment) I have the old DX9SDK so that gets me past the old d3dx9math usage. The other missing area will be dxerr9. I have the header that I can insert but seem to be missing the implementation, so I stopped there as a fail because I have no desire to go this far backwards. 

If I were to continue to try, I'd have to move away from this profile and attempt with GLUT or WGL profiles or hunt the void for the missing component. I respect the Eberly stuff a great deal and there are a considerable amount of gems littered almost anywhere you look at this.

I would encourage you to continue, but there will be some pain involved in getting the DX profile to build.

Now, the GLUT profile has the regular depreciated standard library string or stream io warnings that you'd expect to see from older software. But in code there is an inconsistent folder naming. In code, it searches for a folder named GL but is named differently on disk as Glut3.7.6 for the glut.h reference and the GLExt folder for glprocs.h so I stopped there. 

There will be some work to get this up and running but I disagree with kicking VisualStudio to the curb, but do agree an inexperienced developer will suffer to get this up and running. The journey begins on the path @Kylotan is pointing to, continue to ask questions and be prepared to expect other pain with the modern tools choking on long since depreciated patterns. If I could invest the time, I would love to rehash the wildMagic set, even as just a code browse to apply to new work.  

That's the best I can do. Hopefully that helps the conversation. 

 

Edit: Just a friendly mention because I suffered this, but don't expect to cut and paste yourself into existence. If I were putting my study efforts here, I'd be hunting for concepts instead of entire pre-built solutions. To me, the value here is the math and logic and his hard core ((cryptic)/descriptive) style. Not so much the engine. 

Share this post


Link to post
Share on other sites

Looks like the OP got lucky and there is someone who has this book :)

5 hours ago, GoliathForge said:

but I disagree with kicking VisualStudio to the curb

I am not suggesting to drop it completely. He should just put it aside and learn the basics about building a c++ program and then continue with VS. But maybe you are right.

 

Greetings

Share this post


Link to post
Share on other sites
9 hours ago, DerTroll said:

I doubt, that you will find anyone here, who has.

 

1 hour ago, DerTroll said:

Looks like the OP got lucky and there is someone who has this book

I have this book too :) But as usual, I let the CD in its pocket, forever. So I couldn't be of any help here...

Share this post


Link to post
Share on other sites

Guys, forgive me for such a late response, 

 

As you may see I am totally disappointed now (with myself).

 

Prior to starting this thread I was thinking that someone will help me by giving a simple scenario like "ok first open this then hit that and then do these". 

 

I totally understand there is no shortcut and everything has learning curve but I should learn visual studio first and then take your time.

 

Allow me to digest a bit and I will come back for helps.

 

Thanks a lot for taking your time. Sorry for such a shallow interaction.

 

p.s. Dear DerTroll, I might not be a professional C/C++ programmer but i know enough and have done lots of exercise from important textbooks and algorithms and my only results have been as numbers and texts. Thanks anyway for your suggestion.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!