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
3
Question by Kruga · Aug 06, 2010 at 05:27 AM · serverdatabasesqlactivexdedicated

Web-Client / Dedicated Console Server?

I'm trying to get my head around the Unity structure a little bit here.

I understand that you can NOT create a Native .NET 2.0 Dedicated Server for Unity3d.

So what would be a good strategy for doing this:

  • Client Web game
  • Dedicated Server
  • SQL Database

Three tier structure. I don't want all the code sitting in the Client side. For Size and Hacking reasons. I basically just want the Client to download models and request there actions from the server. So the Server dose all the game logic. and just tells the client, what to load and, where to place it. and what effects to run at what location.. so on...

Then the Server Accesses a Database Via Linq. Which will require .Net 3.5+ basically.

So if I was to reference the Network side of Unity somehow that would probably be ok.

I noticed that there is -batchmode command line argument. But this still means that I have to code all the game logic into the client unity3d game. Which means that the download would be far too large for the web, plus open the door to sniffers and hackers playing with the game. I Also noticed that you can use a activeX in a windows forms project. Would that be the way to go?

Just after Ideas and Guidance.

Thanks

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by jashan · Aug 06, 2010 at 05:50 AM

It actually is quite possible to have a .NET 2.0 dedicated server for Unity 3D. If you use Photon as networking middleware, that's actually even what you'd usually have.

Obviously, what you'll be missing with that approach as the scene hierarchy and PhysX and a couple of other really nice features that a game server implemented as a Unity project has. But whether you need that or even want to have that or not depends heavily on the type of game you're trying to create. In many cases, creating the server in Unity won't even be a good idea.

If you decide to do a pure .NET 2.0 server, you could still have some server features implemented as Unity game server by having those run as a service. See Porting Unity Networking to Photon for a discussion of a potential approach for this.

If you wait for Unity 3 - which shouldn't take too long to be released (it's currently in beta and if you preordered you might even have access to the beta builds), you should be able to use Linq inside a Unity game server.

Personally, I'd avoid access a SQL database directly from Unity ... but that's mainly due to my experiences with Unity 2.x (of which the Mono version has a couple of unpleasant bugs in the SQL Server drivers). So I'll probably switch over my database handling and "simple game logics" to a pure .NET server and handle some of the more complex stuff like physics in a separate Unity game server which acts as a service to the pure .NET game server. This also gives me some nice flexibility in regards to scaling which Unity networking wouldn't give me (e.g. connecting to multiple game servers).

Regarding keeping server-only code out of the client: I'm using compiler directives for that. Unfortunately, Unity doesn't properly support those, yet (and won't in Unity 3.0 - but I hope they'll get that in there for Unity 3.1). What I do as a workaround is have a script that replaces

#define SERVER //A

with

//#define SERVER //I

in all my code files via an editor script. That way, I can easily switch between "server-mode" and "client-mode". It's a bit hacky but it works and isn't too hard to implement.

And yes, you can use -batchmode for a standalone Unity game server (I'm doing that ;-) ).

If having this as a feature in Unity would be useful to you, consider voting up: Editor: Interface for listing preprocessor macros (#define) in build settings

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

No one has followed this question yet.

Related Questions

Server Side Highscore "There was an error getting the high score: 404 not found" 3 Answers

Microsoft SQL Server error. 0 Answers

Hosted Database for Mobile Game 0 Answers

php, sql security 3 Answers

Best way to connect to database for my mobile game? 3 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