Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Iraasta · May 01, 2014 at 02:18 PM · physicsoptimizationserver

Embedding Unity physics on a server.

My team and I are currently developing a flexible multi-use server software for use with Unity. Of course we'll need a server side physics engine.

The question is:
Is there a possibility to use a raw Unity physics engine without starting a whole Unity instance with graphics and unneeded computations? If yes, where should I look? If no, what is the best way to disable all unneeded graphics and computations in Unity's instance to reduce an overhead to a minimum. Also how does it look from the legal side to use a part of Unity for commercial use.

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image _dns_ · May 01, 2014 at 03:33 PM 0
Share

Hi, interesting challenge! If there is nothing in Unity to do this (except having a source license), maybe you can trick the Unity player with a custom made environment. For example, if your server tech can run on Linux, I think you can find source code for the Opengl drivers and then customize your own. This version would just "return" for most calls, same for sound or inputs. This may also allow you to run multiple instances on a machine/V$$anonymous$$ as it's usually done for servers instances. You could also fake other OS calls, for example to have more control on the timer. This would be a big development though, maybe some of this tech already exists in cloud/V$$anonymous$$ related developments.

avatar image Jeff-Kesselman · May 01, 2014 at 05:29 PM 1
Share

Be aware that Unity physics, like all client physics, is designed to make use of the whole machine for processing power. Unless you intend to run one server per session you may have scaling issues. (And consider the cost of one server per session carefully.)

ALSO Unity uses PhysX which pushes the physics down to the GPU if its available. However, a cloud machine is not likely to have a GPU.

There is a lot more to achieving scalable game servers then just running a headless copy of the client code.

avatar image Iraasta · May 02, 2014 at 08:57 AM 0
Share

I didn't know about headless mode. $$anonymous$$aybe it'd do the trick . But I'm a little bit scared that responses would be too long. We already use Erlang for load balancing, java for business logic and if I added a cluster of unity instances it'd go through
client -> load balancer -> logic server -> physics server -> logic server -> load balancer -> client.
I'm afraid that even in case all of the machines are on one local claster it could be a big overhead

avatar image Jeff-Kesselman · May 02, 2014 at 10:40 PM 0
Share

You are smart to be concerned.

The "comma wisdom' on Unity for handling lag really doesn't handle it very well. You can try simple linear prediction but, given the fact that there are forces constantly at work on the object in a Unity world, its likely to go [pretty wrong pretty fast.

The right way would be to be able to run the entire physics simulation backwards and forwards in time based on delayed information and predicted scenario. Unfortunately, that would require much more access to the Physics layer then Unity gives you.

At risk of giving away my expertise for free... I suggest you think not in terms of remote simulation but rather in terms of "consistency checking" that what the client claims is reasonable.

(I actually DO have an idea for a prediction model that might work better. But its just experimental right now and i have not yet gotten to implementing and testing it.)

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by ZenithCode · May 01, 2014 at 03:51 PM

Yes you can. Its call batchmode or Unity headless mode.

https://docs.unity3d.com/Documentation/Manual/CommandLineArguments.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Broadphase CD in Unity - pile of rigid bodies unsolved 0 Answers

Add 2d rigidbodies to moving objects to increase performance or not? 1 Answer

is there a way to run physics on a server? 0 Answers

Help with optimize code 1 Answer

ontriggerenter will not work with !islocalplayyer 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges