• I Left Programming Temporarily ( Because of Physics )
    57 replies, posted
  • I learned almost all C++ syntax. And dived in to game libraries for 1 week and learned a little bit event driven programming too. But today I realized something that without knowing physics you just cant make a game even you know all the syntax of C++ and the game library you use. I'm stuck like never before and very desperate. Now I have to learn physics from zero. I feel like my time is wasted and I came to start line again. Just wanted to share my sorrow with you. Any help will be appreciated too.
  • [QUOTE=Nigey Nige;35702262]Physics library. Boom, you're done.[/QUOTE] Thank you, but I dont wanna use readymade things. I cant feel like a real coder in that way.
  • [QUOTE=LuaGuy;35702294]Thank you, but I dont wanna use readymade things. I cant feel like a real coder in that way.[/QUOTE] Why re-invent the wheel unless you have to? Ever popped open an AAA game? "MILES SOUND SYSTEM" "HAVOK PHYSICS" "POWERED BY UNREAL" "BINK VIDEO" - These are all using proven, tested third party solutions so they can get on with what they want to do - Make games.
  • [QUOTE=LuaGuy;35702294]Thank you, but I dont wanna use readymade things. I cant feel like a real coder in that way.[/QUOTE] Glad you said it so I wouldn't be accused of putting words in your mouth The single most important lesson any programmer learns is that "real" programmers strive to accomplish tasks as efficiently as humanly possible. This means using other people's work whenever possible. I want to stress this: [B]BAD[/B] programmers insist on doing everything themselves.
  • [QUOTE=Lord Ned;35702352]Why re-invent the wheel unless you have to? Ever popped open an AAA game? "MILES SOUND SYSTEM" "HAVOK PHYSICS" "POWERED BY UNREAL" "BINK VIDEO" - These are all using proven, tested third party solutions so they can get on with what they want to do - Make games.[/QUOTE] I dont know I'm a little bit perfectionist, control maniac and obsessive maybe this is the reason but one thing I know is that I have to learn physics. [editline]24th April 2012[/editline] [QUOTE=ryandaniels;35702397]Glad you said it so I wouldn't be accused of putting words in your mouth The single most important lesson any programmer learns is that "real" programmers strive to accomplish tasks as efficiently as humanly possible. This means using other people's work whenever possible. I want to stress this: [B]BAD[/B] programmers insist on doing everything themselves.[/QUOTE] So you say use physics library and never learn physics but what will be If i want to write my own engine after some time. I will stuck again.
  • There's more to programming than bideo games. And if you just want to make a game, why get bogged down in all the crap that isn't "making a game"? Physics should just be there, physics isn't a game.
  • [QUOTE=LuaGuy;35702403]I dont know I'm a little bit perfectionist, control maniac and obsessive maybe this is the reason but one thing I know is that I have to learn physics.[/QUOTE] "Luaguy" You do realize you're a joke, right? You are claiming that you [B]need[/B] to do everything yourself, you have to reinvent and reimplement and understand every idea ever conceived, and yet your name suggests you are fond a rather high level language; shouldn't you be making your game in assembly? Or maybe you should write your own operating system and build your own computer to run this game. Oh, and we can't use any parts made in factories, we'll need to build a lab and a manufacturing plant. But wait! How is anyone going to play it? I guess you'll have to start your own personal computer company. Oh no, wait, before you do any of this, you are going to need to amass a perfect knowledge of all the related sciences and their related sciences... Jesus- you are going to need to come up with a unified theory for the workings of the entire universe! Who knew making games was so hard.
  • [QUOTE=ryandaniels;35702632]"Luaguy" You do realize you're a joke, right? You are claiming that you [B]need[/B] to do everything yourself, you have to reinvent and reimplement and understand every idea ever conceived, and yet your name suggests you are fond a rather high level language; shouldn't you be making your game in assembly? Or maybe you should write your own operating system and build your own computer to run this game. Oh, and we can't use any parts made in factories, we'll need to build a lab and a manufacturing plant. But wait! How is anyone going to play it? I guess you'll have to start your own personal computer company. Oh no, wait, before you do any of this, you are going to need to amass a perfect knowledge of all the related sciences and their related sciences... Jesus- you are going to need to come up with a unified theory for the workings of the entire universe! Who knew making games was so hard.[/QUOTE] This was an overly aggressive reply to a perfectly understandable problem. I hate using physics libraries because I feel like I'm missing out even though I know making a physics engine is still out of my league. Yet, I use .NET and don't feel at all bad. It's not as straight forward as you think.
  • What about the time lost learning how to program physics? There's more than just physics in games you know.
  • [QUOTE=Darwin226;35703098]This was an overly aggressive reply to a perfectly understandable problem. I hate using physics libraries because I feel like I'm missing out even though I know making a physics engine is still out of my league. Yet, I use .NET and don't feel at all bad. It's not as straight forward as you think.[/QUOTE] I am being agressive; and this is because I once suffered from the same debilitating mental disease: "perfectionism". I see it in most if not all beginning programmers. I don't want others to have to go where I did; coming to hate programming and myself simply because I was at the point where every time I sat down to program I ended up tearing my hair out within 15 minutes because I [I]couldn't[/I] just solve the problem in front of me, I had to solve every problem tangential to it, and the problems tangential to those problems, ad infinitum
  • Uh, also, learning C++ [b]syntax[/b] doesn't mean much at all. I can learn Python [b]syntax[/b] in a day. But it wouldn't make me a Python programmer at all.
  • Exactly. Like one of the first programs I made was a music player in Qt. I didn't write the code to actually decode MP3 files, and of course I didn't write the GUI framework (Qt). I did the library managment stuff, and when it came time to play a song I just did like play("file.mp3"); Why waste my time writing yet another MP3 decoder.
  • [QUOTE=ryandaniels;35703281]I am being agressive; and this is because I once suffered from the same debilitating mental disease: "perfectionism". I see it in most if not all beginning programmers. I don't want others to have to go where I did; coming to hate programming and myself simply because I was at the point where every time I sat down to program I ended up tearing my hair out within 15 minutes because I [I]couldn't[/I] just solve the problem in front of me, I had to solve every problem tangential to it, and the problems tangential to those problems, ad infinitum[/QUOTE] Well, I'm not a beginner and I still don't like using physics libraries. I've used plenty of others that I didn't mind at all. It's just the physics ones that feel like cheating... Maybe the OP feels the same.
  • Programming is already [I]plenty[/I] hard enough, there's no need to create challenges for yourself by doing things the hard way. I mean, think about it for a second. People who use libraries; do they just program once a month, and THAT'S why it takes them several years to make a finished product? NO! They are working their ass off solving REAL programming problems. Which is what you seem to be so intent on solving. You don't need to go looking for a challenge, the challenges are already coming for you. [editline]24th April 2012[/editline] Note that this isn't a response to any posts since my last post, this was mostly supposed to add to my last point.
  • [QUOTE=Darwin226;35703400]Well, I'm not a beginner and I still don't like using physics libraries. I've used plenty of others that I didn't mind at all. It's just the physics ones that feel like cheating... Maybe the OP feels the same.[/QUOTE] I don't think you're as much of a lost case as the OP. It seems you understand when it's right to work on your own code. The OP, however, wants to create a physics engine without even knowing C++. Assuming this isn't a troll, because god, it's fishy.
  • [QUOTE=ryandaniels;35703281]I am being agressive; and this is because I once suffered from the same debilitating mental disease: "perfectionism". I see it in most if not all beginning programmers. I don't want others to have to go where I did; coming to hate programming and myself simply because I was at the point where every time I sat down to program I ended up tearing my hair out within 15 minutes because I [I]couldn't[/I] just solve the problem in front of me, I had to solve every problem tangential to it, and the problems tangential to those problems, ad infinitum[/QUOTE] I feel that it's an important part of the learning process. If you re-invent the wheel a couple times, you're tackling a problem that has plenty of resource material and various benchmarks that you can use to assess yourself. The 'try things; evaluate results; draw conclusions' feedback loop is nice and small. This way when you've got to tackle unique problems, you've got experience to draw on. You don't have to worry about being productive until you actually need to be productive. And if you test your limits beforehand, you'll actually know them when it's important.
  • [QUOTE=LuaGuy;35702403]So you say use physics library and never learn physics but what will be If i want to write my own engine after some time. I will stuck again.[/QUOTE] I believe learning the physics may be helped by using a pre made third party package ... Once you create your project using the package you can then go back and look into the physics classes to see whats going on. The chances are that the physics package will have thought of ways of doing things that you wouldn't have thought of without having looked at it. And therefore teach you much faster then you would learn otherwise! (At least that's my opinion / experience)
  • [QUOTE=ROBO_DONUT;35703889]I feel that it's an important part of the learning process. If you re-invent the wheel a couple times, you're tackling a problem that has plenty of resource material and various benchmarks that you can use to assess yourself. The 'try things; evaluate results; draw conclusions' feedback loop is nice and small. This way when you've got to tackle unique problems, you've got experience to draw on. You don't have to worry about being productive until you actually need to be productive. And if you test your limits beforehand, you'll actually know them when it's important.[/QUOTE] I think the important (and fun) thing is progressing towards the goal of your project. Making your own HTTP library (or whatever) can be a fun project and an important one to look into, but if your project is something more composite like a game, I think it's silly to be tripped up by the notion that anything pre-made is cheating. I say find a cool beans physics library, use it in your game, then dispel that feeling of cheating by reading up on the library and what it does, look through its docs and maybe its source code in more detail. I think the feeling of cheating comes from not knowing the internals of what you're using, and you don't have to have written a given library to know well enough what it's doing internally.
  • [QUOTE=LuaGuy;35702294]Thank you, but I dont wanna use readymade things. I cant feel like a real coder in that way.[/QUOTE] That's how I felt at first, too, but then I realized, that that's a fatal way of programming.
  • Even if you wanted to teach yourself physics, most physics needed for game programming is just a basic understanding of mechanics/Newton etc. Bit o' trigonometry, some SUVAT, then you can just look up what you need when you need it. With basic trig and mechanics knowledge I implemented a pretty good gravitational model in Python recently, just googled the relevant equation and played around. You're making a mountain out of a mole hill.
  • I am more neutral with the subject. I beleive that LuaGuy has a great argument because I too once said that I should create my own physics library. Before you can make your library though you have to COMPLETELY understand other physics library. You also have to see how the whole physics library is structured. LuaGuy I feel as if you're taking the wrong approach. You should still learn physics but use other peoples physics libraries. I hope you understand my logic.
  • Wait a minute here, there's a difference between programming a game and programming a physics engine. I wouldn't consider writing my own physics for a game (Unless the physics were relatively simple), as physics engines encompass months of work on optimizing the routines, tweaking algorithms and code from people who have a better understanding of the subject. In addition to that, physics is the same in almost every case, and any 'extra' physics you want to implement in your game could easily be achieved. Writing a game on the other hand, is much different. No two games have the same laws, rules or game-play, you have to provide your own implementations for how you want the game to play. Plugging in a physics engine is just part of defining the rules for the game.
  • Thankfully there is perfectionist people out there, brave enough to go for and code a physics engine. I don't believe in argument called "re-inventing wheel" in programming. Since if you don't copy and paste code from other people's works, It wont end up as same wheel. Yeah they will have same purpose ( reducing friction ). But their shapes will be different, their material will be different and they will vary in structures. Like one man would build a wheel out of stone and one can make out of metal. It is like your own solution to a specific problem. Problem is same but solutions are becomes personal. If re-inventing the wheel is such a bad thing, there shouldn't be that much programming languages, libraries, operating systems out there. ( Who the hell was that had the crazy idea of creating a new operating system called Linux 20 years ago while hundreds of them were out there sitting and doing nothing? ) So I see you learning programming and you want to learn how things works, make your own solutions to these problems. Well people like you and me likes challenges. You may be the number thousand guy that climbed to mount everest but personal satisfaction to climbing everest has a feeling nothing like any other accomplishment. Because it is curiosity. You are curious about how earth looks up there. You could use other people's photographs taken when they were highest point of earth but this is not enough you should see it yourself. You should outperform yourself. So you can gradually improve yourself. BUT, as you can see climbing a mountain is not a easy thing anyone can decide and do randomly. You should have physical endurance and strength to accomplish this task. And very strong will. For building your strength you should run through hills, climb small mountains and gradually improve your skills and strength over time. Now you should ask yourself what you want to do and create layers of tasks out of it; 1. Make a game a. Learn programming by making everything yourself. i. Make game engine ii. Make a physics engine Like an ultimate goal, and sub goals of it then sub goals of sub goals. I remember I having I was that deep in holes there were 10 layers. But every layer you go up by getting successful at those tasks bring you a lot of experience. Now you should consider you are going a very long way. Like a way that it could take 10 years of your life very easily. ( It took mine, I know from experience :) ) And you going to be barefoot ( Because thats the purpose ). What would you carry in your bag? Problem is how much you can carry? How strong you are. If your purpose is climbing everest, I would ask how much hills and small mountains you climbed already (for building strength)? Process is goes like this. You randomly start picking objects to carry with you. In first miles you will see some stuff you carried have no use. So you drop these stuff and start from scratch. After few years passed you will see you are going in wrong direction. You start from scratch again. Thats why it takes 10 years. Or you could have a mentor that remotely helps you what you should take, what direction you should go decreasing time required to accomplish your goal. So problem is lack of experience. My ultimate goal was making a 3d engine 10 years ago. I started with visual basic 6 at the time did some stuff (model loading, textures, particles, camera). Folder name for that was "A VERY BIG PROJECT" a name you can expect from a kid ( I was 12 at the time) that filled with stuff not anyone can easily understand. Then I see I was in wrong way and I should use C++. I switched to c++. Because of some assembly knowledge I had no problems with C++ but I started from scratch 4 times and its 10 years passed over my stuff. Because I learned a lot every time I tried making an engine, that make me see my old codes are looks like shit, have no reuse, lot of missing properties that you can expect from a wheel. But I am happy of my code today. I feel I have enough experience to make engine and a MMORPG out of it. So my goal is changed from making an engine to making a game with it. But writing a physics engine (alone) were never in my goal list. I always considered it as part of game engine. Now I have enough experience to make a physics engine but I think like "meh It could just waste my few months of work" so now it has no challenge to me, and I am not focused on it. But its still a challenge for you because you think "you can't make a physics engine with your current level of knowledge". Solution; First of all never left programming. Because left it for 4 months and when you come back you will know nothing. Secondly do what you want straight away. Like if you want to make the game create the project and start coding it. If you are not successful repeat until you will. Thats the only way so far you can gain experience. When you feel you have enough experience you can go for more advanced stuff. Keep the challenge and do the coding. If you want to make a physics engine go for it. You will see its not that hard to keep walking when you begin the journey. In the end everything is about being brave enough to taking the first step.
  • Burak: The point of all this is the goal you persuade: Do you want to create a game, or a physics engine? Creating a physics engine just for your game is reinventing the wheel unless it requires special features other engines don't offer.
  • [QUOTE=DrLuke;35716768]Burak: The point of all this is the goal you persuade: Do you want to create a game, or a physics engine? Creating a physics engine just for your game is reinventing the wheel unless it requires special features other engines don't offer.[/QUOTE] If goal is learning how to programming advanced stuff it doesn't matter you coding a game, or game engine or a physics stuff. In the end of your projects you will have enough experience to make any of it. And when they are not a challenge anymore, you won't want to make a physics engine or game engine anymore.
  • In my opinion prioritizing is another key component to succesful programming.
  • [QUOTE=DrLuke;35717166]In my opinion prioritizing is another key component to succesful programming.[/QUOTE] Yeah you are right, only different thing I say is prioritize what your heart says you want to do. Like what you feeling enjoyment while making. So you can overcome the boring learning process. Because learning is simply repeating same things over and over. When you learned enough, you automatically don't want to do unnecessary things. He just look like picked a challenge to himself which is writing a "physics engine" but seems like he don't know where to start and struggling. But if he wants to make a game and if he wants to make a game as soon as possible, I agree he should use stuff ready to be used. But if he doesn't have much experience yet, he can't going to make the game with just using "magical" libraries. He should learn first and it doesn't matter how he learning. He would go with game maker then, and everyone who said "use library" here will laugh at him. And LuaGuy, You don't have to learn physics you have to learn math a little bit to understand vectors, matrices and quaternions. At least how to use them is still enough. Physics is just mathematical changes over time. acceleration is difference of speed per time unit. and speed is difference of position per time unit. just create a loop and use this information to calculate your object's position. with usage of time passed. like your rendering loop took 0.5 seconds, just multiply it with acceleration and add it to speed, then multiply speed with 0.5 again and add it to position of your object. Then check for collisions then make implement collision response. after you done these you can go for constraints between objects. You can use rendering library for testing your physics stuff. after your feel its enough, you can make your own rendering library. And when you think you got enough experience to make these stuff that make you think "I can do anything, it just takes time", like when you don't feel desperate when you don't know something, you can start making your game or whatever your end goal is.
  • How is your vector math? I made my own physics engine using the following resources: [url]http://www.metanetsoftware.com/technique/tutorialA.html[/url] - Explains the separating axis theorem well. [url]http://chrishecker.com/Rigid_Body_Dynamics[/url] -- VERY VERY USEFUL Basically the metanet explains how to do collision detection. Chris Hecker explains almost everything else. Making a physics engine was a really fun thing to do but in the end your engine is unlikely to ever be as stable as a third party library like Box2D, so you will probably just end up using a third party even after making your own engine. Although the learning experience allowed me to understand how to use Box2D much more effectively. [media]http://www.youtube.com/watch?v=qTV3ZQgTnkg[/media] I manage to make this with the two links I posted above.