Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Do i need to know physics before using Unity3D?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 12 August 2014 - 04:53 PM

Along with programming, do you have to understand a good amount of physics such as velocity,friction and etc. to make a 2D game with it?

 

EDIT for mods: Sorry can you move this to the API section please thanks.


Edited by Zero_Breaker, 12 August 2014 - 04:55 PM.


Sponsor:

#2 Navyman   Crossbones+   -  Reputation: 4049

Like
1Likes
Like

Posted 12 August 2014 - 05:10 PM

Technically no. However, that is hinged on the fact you do not use physics in your game. You may want to understand frame per second and a few other timing items.


Developer with a bit of Kickstarter and business experience.

34410.png

#3 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 12 August 2014 - 05:40 PM

I see, but where would i find those? Because i am very confused on how you would program a game's movement.


Edited by Zero_Breaker, 12 August 2014 - 05:41 PM.


#4 Lactose!   GDNet+   -  Reputation: 3582

Like
1Likes
Like

Posted 12 August 2014 - 05:44 PM

I would suggest taking a look at some Unity tutorials. It's been a while since I checked personally, but I seem to remember Unity's official tutorials being fairly decent at introducing basic concepts like this.



#5 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 12 August 2014 - 06:35 PM

Thanks! I was really confused on where to learn about stuff like that. I saw a book called game coding complete. Does it contain the information about timing and etc.?


Edited by Zero_Breaker, 12 August 2014 - 06:35 PM.


#6 TokyoDan   Members   -  Reputation: 160

Like
0Likes
Like

Posted 12 August 2014 - 06:46 PM

Nope. I've been using Unity for a year and a half now and created a 2D board game with 3D objects and I barely graduated from high school. I lost interest in math after the 4th grade of elementary school. Too bad there weren't video games in those days. I would have been inspired to study math in spite of the boring teachers.

#7 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 12 August 2014 - 07:19 PM

Thanks Dan! Would you say the Unity tutorials are sufficient enough to get you started with it.



#8 Gian-Reto   Members   -  Reputation: 1314

Like
3Likes
Like

Posted 13 August 2014 - 08:19 AM

Well.... this is a tricky question. As a longtime Unity user that is developing a 3D game making a lot of use of PhysX, I would say its a clear "yes and no".

 

You do not need to know anything about physics when you start using the integrated physics engine, PhysX. One of the reasons for using a physics engine (besides not needing to rewrite boring physics formulas all the time) is to give physics noobs a chance of developing a game with faintly realistic looking physics in it. 

 

 

Now, PhysX (and I guess all physic engines) has its limits. When you start doing easy things like chucking stuff up in the air and seeing it fall down, it all look realistic and cool. But you have to beware: the physics engine is very limited in what it will calculate, and it cheats often. You will find that you can select a "iteration count" for the physics. Why should a physic engine need to iterate? Well, I am no expert, but I guess what the engine does is skip the complex formulas and use simpler ones multiple times to come near the realistic result.

 

 

What this all means is:

 

At one point, you will reach the limit of what the PhysX system can handle. A good example are Wheel Colliders and Slopes. Depending on your settings, Wheel colliders will never really behave correct on steep slopes as the friction model of the wheel colliders is too simple for that.

This is where you need to step in and "extend" the physics engine by hacking (In this example I did that by measuring if the car is going uphill and increase air drag / decrease the grip of the wheel if the slope gets too steep).

 

 

So while you do not need to know exact formulas (its a game, not a physics simulation), in a physics heavy game you will have to know some "lay stuff" of physics so you can more or less accurately simulate the additional physical effects the physics engine skips.

 

 

If you just want to do a game with very simple physics or where the physics can be way off from real world physics, you will need zero physics knowledge.

The more you get into an accurate physical simulation, the more you need to know about physical RL effects. But don't dust off your physics book. In 90% of the cases, watching some youtube vids on the topic (watching rally cars fighting with a muddy slope for example smile.png ) will tell you how your objects should behave. And unless you are a physics expert and master programmer, its trial-and-error from there on anyway.

 

 

 

About the tutorials:

 

 

You will find all you need to start in the Unity documentation.Just search for the keywords below:

 

- What you need to first is add Rigidbodies to all objects that should be movable by the physics system. These objects will also need Colliders so the Physic system will recognize collisions with other objects or the ground.

- All static objects just need Colliders so the physics system can handle collisions with dynamic and static objects.

- You now need to start adding Forces to you objects, attach Wheel colliders or similar means of propelling them forward.

 

 

Be aware, as soon as you start using physics, moving your objects by script (like setting a new position directly) while still possible, can interfere with your physics simulation a lot (as the objects moved by script do not behave physically fo the physics engine, collisions between objects controlled by the physics engine and objects controlled by you will usually end with the physical objects being "blasted into orbit" (a impossibly high force is imparted on the physical objects by the non-physical ones))


Edited by Gian-Reto, 13 August 2014 - 08:35 AM.


#9 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 13 August 2014 - 11:10 AM

Thanks a lot Gian-Reto! Your post was very informative and helps me understand Unity a little bit more. For now i just want to experiment with things 2D game related and create a 2D game. Later on i would love to create a 3D Stealth game so i think i would have to learn some physics.



#10 Gian-Reto   Members   -  Reputation: 1314

Like
0Likes
Like

Posted 13 August 2014 - 11:18 AM

Thanks a lot Gian-Reto! Your post was very informative and helps me understand Unity a little bit more. For now i just want to experiment with things 2D game related and create a 2D game. Later on i would love to create a 3D Stealth game so i think i would have to learn some physics.

 

AFAIK in Unity 2D Physics is just a special case of 3D Physics (PhysX constrained to two dimensions), so whatever you learn creating your 2D game will translate to later 3D undertakings.

 

However, as I never dabbled in 2D until now, I am not sure that is true now with all the new 2D Systems that came out with Unity 4.X ... so make sure you first check out the 2D Unity Tutorials and look there for instructions on doing the physics, before you head into the general physics documentation.

 

If you mix a 2D Scene with 3D Physics without constraints, the results might be hilarious (like an object getting lost in the third dimension :) )



#11 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 13 August 2014 - 11:51 AM

Thanks I will definitely check them out and would you say that the Unity tutorials are sufficient enough to learn Unity 3D?



#12 Gian-Reto   Members   -  Reputation: 1314

Like
0Likes
Like

Posted 14 August 2014 - 01:45 AM

Thanks I will definitely check them out and would you say that the Unity tutorials are sufficient enough to learn Unity 3D?

 

Actually I never REALLY tried doing the tutorials from start to end. It's just not how I do things (yes, I am very impatient at times smile.png )

 

I DO say however the Unity documentation is vast and contains ALMOST all you will ever need to develop in Unity. The information sometimes is a little bit scattered, but you will find your way around in a short while.

 

 

I'd say wet your feet with the tutorials, start with your own project as soon as you feel confident enough, and never hesitate to ask question either in the Unity forums, the Unity answers page or here... there is a vast community so tap into the combined knowledge of it. Just be aware: most question have already been asked. Do a quick google search first.

 

If the tutorials will not teach you 100% of what you need to know, they will at least get you started on your journey.


Edited by Gian-Reto, 14 August 2014 - 01:45 AM.


#13 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 14 August 2014 - 07:37 AM

Yes i know what you mean i like being able to start with my project as soon as possible because ever since i've relearned C# i became very impatient and just wanted to mess around with Unity.

 

Than you very much for your help Gian-Reto!



#14 Khatharr   Crossbones+   -  Reputation: 3030

Like
0Likes
Like

Posted 14 August 2014 - 08:11 AM

You may want to start casually studying basic physics in any case at Khan Academy or some similar source. The fundamentals are really not difficult, and are often very interesting. You only need to learn a couple basic concepts of Newtonian physics (force, inertia, and acceleration) in order to make something like Super Mario Bros.

 

Do yourself a favor and take a look. You may like it.

 

https://www.khanacademy.org/science/physics


void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

#15 Zero_Breaker   Members   -  Reputation: 367

Like
0Likes
Like

Posted 14 August 2014 - 12:23 PM

Thanks I will check those out!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS