Starting up programming for Physics engines/unsure of future career
12 replies, posted
Hello ladies and gentleman that hail from Facepunch
I am wonder what programming languages can I use for programming Physics Engines
I have been programming for some time now on some extremely basic stuff and I just want to jump right into Physics Engine programming for video games. I am not sure what I want to do in the future as a career (as I am only 17 atm) and have always had an interest in Physics and Graphic engines
If you have to ask that question, a physics engine isn't something you want to/can program.
[editline]11th February 2013[/editline]
To answer anyway: You can pick any language you want obviously, as the only limiting factor will be your skill in using the language and the speed of the language.
A good choice would be C++ or Java.
Some people start by making a hello world program.
Others just make a physics engine.
Whatever floats your boat.
(Why did you make two threads? Here's my reply to the other one.)
First, you must learn basic programming (tutorials).
Then you must higher math (tutorials, samples, and school).
Then you must mess around with small experiments (tutorials and samples).
I suggest Lua as your initial programming language; it's simple enough to learn and powerful to achieve what you want.
You will not be able to make an advanced rigid-body simulation engine (like Havok, PhysX, Bullet, etc) for a long long time (years and years).
Here's a kickstart for you:
- Install [url=http://love2d.org/]LÖVE[/url].
- Make a folder called "shapes" (or whatever).
- Save the file below as "main.lua" in the "shapes" folder.
- Find (in your start menu) the shortcut to LÖVE, copy it to be next to the "shapes" folder.
- Drag the "shapes" folder onto the LÖVE shortcut to run the program.
[lua]
time = 0
mouse_x, mouse_y = 0, 0
function love.update(time_delta)
time = time+time_delta
mouse_x = love.mouse.getX()
mouse_y = love.mouse.getY()
end
function love.draw()
local x, y = mouse_x, mouse_y
local radius
x = x+math.sin(time_delta)*radius
y = y+math.cos(time_delta)*radius
love.graphics.setColor(150, 150, 255, 255)
love.graphics.rectangle("fill", x, y, 20, 20)
end
[/lua]
Mess around with this and learn to draw shapes and such.
([url=http://www.love2d.org/wiki/love.graphics]the wiki[/url] will help)
Once you've experimented and are comfortable, you'll want to learn more Lua; Google for tutorials and samples ([url=http://lua-users.org/wiki/TutorialDirectory]these tutorials[/url] are good, but rely quite heavily on past experience).
If someone's nice, they may mentor you; you can add me on Steam and I will answer the occasional question.
Also, get a DVCS like [URL="http://git-scm.com/"]Git[/URL] or [URL="http://mercurial.selenic.com/"]Mercurial[/URL], if you haven't already.
You don't need a server for them and it's very useful to be able to go back to a previous version of your code.
(Git has a larger community, Hg(Mercurial)'s GUI on Windows much better than Git's and has a built-in console window.
[URL="http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2010-hg-and-git-can-t-we-all-just-get-along-154-3379011"]It doesn't really matter which you choose because they are very similar[/URL] and there's [URL="http://hg-git.github.com/"]a Hg extension[/URL] that makes them compatible (it's almost perfect but not 100%).
Just don't use SVN, it sucks for almost everything.)
[QUOTE=Tamschi;39560029]Also, get a DVCS like [URL="http://git-scm.com/"]Git[/URL] or [URL="http://mercurial.selenic.com/"]Mercurial[/URL], if you haven't already.
You don't need a server for them and it's very useful to be able to go back to a previous version of your code.
(Git has a larger community, Hg(Mercurial)'s GUI on Windows much better than Git's and has a built-in console window.
[URL="http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2010-hg-and-git-can-t-we-all-just-get-along-154-3379011"]It doesn't really matter which you choose because they are very similar[/URL] and there's [URL="http://hg-git.github.com/"]a Hg extension[/URL] that makes them compatible (it's almost perfect but not 100%).
Just don't use SVN, it sucks for almost everything.)[/QUOTE]
@Slash215: A DVCS is a Distributed Version Control System; it allows you to make "snapshots" of your working files so that you can retrieve old versions, work in parallel with someone else, source libraries from others, and so on.
This will be useful when you are experimenting.
Until then (while you're learning basic programming), completely ignore Tamschi's advice!
Or don't ignore his advice, because it's relevant even after a single line of coding.
[QUOTE=gparent;39563837]Or don't ignore his advice, because it's relevant even after a single line of coding.[/QUOTE]
I disagree, but won't argue because your avatar is so intimidating.
[QUOTE=Deco Da Man;39572086]I disagree, but won't argue because your avatar is so intimidating.[/QUOTE]
I just think it should be part of your learning experience. Learning the basics of git is much easier than learning how to tackle the most simple of programming problems.
[QUOTE=gparent;39575324]I just think it should be part of your learning experience. Learning the basics of git is much easier than learning how to tackle the most simple of programming problems.[/QUOTE]
I have (privately) tutored around ten people on the basics of Java programming (good money!).
In most cases when offered a solution, they do not (or can not) understand the problem it solves in the first place.
For example, two students did not like using indentation because they didn't understand why it was needed and thought it made their code messy and hard to understand (something compounded by the teacher's ugly coding style and reference to indentation as "optional").
Instead of forcing them to use it and running them through a typical scenario, I gave them the homework to solve the following problem with only nested [i]if[/i] and [i]else[/i] statements (the course hadn't reached other control statements or functions yet... four weeks on arithmetic and if statements!).
[code]
A pilot is trying to land an outdated aircraft with confusing systems.
He needs to enter two numbers: A and B.
For each thing, print a message.
If A is dividable by two, then the landing gear is down.
If A is greater than 80, then the attendants are ready for landing.
If B is negative and the landing gear is down, then one of the wheels have faulted.
If B is negative and the landing gear is up, then one of the wheel hatches has faulted.
If B is dividable by two, then the fault is in the front area, otherwise the back area.
If the wheels are down and A is equal to B, then the aeroplane has already landed (or crashed!).
If the wheels are up and A is equal to B and not equal to zero, then set B to negative A and check everything again.
[/code]
Those who did not use indentation properly were utterly confused by this simple task; they had the right idea, but the code was horrible looking and didn't function properly. They realised that they had messed up.
I gave them a few minutes to look over the other students' solutions. They realised what indentation was, how the [i]exact[/i] style was unimportant, and – most importantly – the problems it solves.
Learn by experience; learn from mistakes.
Let Slash215 make the mistake of not using versioning software. He'll make the mistake some day, recall "VCS" from the back of his mind and then be encouraged to research and use it!
If he's lucky enough, a friend will convince him to use it at the perfect time (after a small mistake but before a huge mistake).
For now, let him learn [i]if[/i] statements, [i]for[/i] loops, types, etc.
[editline]14th February 2013[/editline]
[QUOTE=Slash215;39551435]
...
I have been programming for some time now...[/QUOTE]
I completely missed this until now.
Argument is still valid, however.
Writing non-indented code is a simple mistake that can be fixed with a single shortcut in most IDEs. Not using source control can make you lose weeks of work, and makes it significantly harder to track bugs. That's all I'll say, otherwise we'll just disagree.
[QUOTE=gparent;39586902]Not using source control can make you lose weeks of work, and makes it significantly harder to track bugs.[/QUOTE]
This is the "big mistake" that I'm referring to.
My small mistake was refactoring my (incredibly messy) GMod Zombie Survival gamemode. I wasn't happy with the first attempt, so I went back to the original source and tried again.
Turns out the first way was preferable, but I didn't have it anymore.
Ever since then, I have used version control and love it.
[QUOTE=Deco Da Man;39593530]This is the "big mistake" that I'm referring to.
My small mistake was refactoring my (incredibly messy) GMod Zombie Survival gamemode. I wasn't happy with the first attempt, so I went back to the original source and tried again.
Turns out the first way was preferable, but I didn't have it anymore.
Ever since then, I have used version control and love it.[/QUOTE]
Alright, let's just end this here. If you think people are too stupid to learn two commands (commit, checkout, that's literally all you need to get you started) until they make a major mistake that might make them lose weeks of work, then go ahead and suggest that they don't learn the very basics of source control. I'm glad you replied, but at this point I'll do as I said and just disagree.
Sorry, you need to Log In to post a reply to this thread.