Wednesday, November 13, 2019
Physics in Video Games :: physics video game computer
There are a few different physics engines that programmers use now for their games. There are 2 main physics engines that programmers use: Havok, and Math Engine. A Physics Engine is the code that game companies buy or Build to put in their code. The code is already written and they just have to implement the code in their program. The thing about Physics in video games is that none of it has to be realistic. Most of the physics in older games aren't close to being realistic for there were way too many equations the program would have to solve and it would slow it down. There are arguments that go on that unrealistic games are more fun, or realistic games are more fun. Video Games have been around for over thirty years now. A lot have changed in the way programs work. When they first came out Video Games weren't that powerful because the hardware couldn't support it. Now the possibilities are almost endless. Games have changed so much. From Games like Asteroids that was made in 1979. With Asteroids being only a small program with some computations going on. To current games like Half-life 2. With so many physics computations going on. They try to make this game the most realistic game. Out there. The current trend in video games is to make them more and more realistic. The more realistic they make the game. The more equations the program has to do, so the program is a lot bigger and needs a lot more power to do everything the game wants. There is a lot of lines of code in video games. There are teams of people who work on games now. Here is some example of how code is implemented into programs to make it look like you are jumping. I got this example from the web site http://www.gamedev.net/reference/articles/article694.asp this is pseudo-code that can be used for if you were having the character in the game jump straight up. Joe.postion.y = 0; (Or wherever floor is) Joe.velocity.y = 0; Joe.acceleration = 10; Joe.jumping = NO; Loop If (jump key is pressed) { Joe.velocity.y = 100; Joe.jumping = YES; } if (Joe.jumping == YES) /* Move Joe if we are jumping */ { Joe.velocity.y = Joe.velocity.y - Joe.acceleration Joe.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.