Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Taxel · Dec 15, 2015 at 11:02 PM · iosserversimulationturn-based

Business simulation in Unity

Hey guys,

I want to create a business simulation / planning game with a Unity frontend. It will run on iOS, and should allow multiple players and rudimentary AI (for testing and demo purposes) to play against each other. After each player has entered data like sale prices etc. the server should calculate the actual sales of each product for each player. Now here's my question: Does anyone of you have recommendations for the server backend? I am quite good at C#, but I am sure I would also be able to use PHP or JavaScript for the server. Any comments are welcome!

Taxel

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
0

Answer by phil_me_up · Dec 15, 2015 at 11:10 PM

It depends a little on what you want, but I'd suggest Parse.com as a starting point for both database and web service provision.

If you want to go custom then there are a lot of database options available (AWS DynamoDB / RDS, Azure, MongoDB, CouchDB ). You can also use more traditional systems like MySQL which may be appropriate depending on the data you're processing / load etc.

For servers, PHP will be fine. You might want to consider something like NodeJS but again, it really depends on what you're after.

Comment
Add comment · Show 2 · 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
avatar image Taxel · Dec 15, 2015 at 11:28 PM 0
Share

Hey phil,

thanks, but I already got a server (with root rights, so I can really just do anything I want). Let's just assume I use PHP, could I also send data to the players (like "the current turn is over, here is what changed") or would I have to rely on the clients regularly checking in with the server if something changed? $$anonymous$$y PHP experience is limited to having created a few websites, but there I didn't have to update anything without someone requesting it. I think my question is this: How would you go about having a program on the server that runs in the background, plays for the AI, checks if every player has made a turn or if the time limit for this turn is up and then initiates the calculation of all the values in PHP? Are cronjobs a way to go there?

avatar image phil_me_up Taxel · Dec 15, 2015 at 11:49 PM 0
Share

It's good you've got a server, but don't underestimate the maintenance required to run these. Should you have sudden load increases, or just s$$anonymous$$dy, heavy traffic then keeping the server responsive can be challenging. Simple things like a large number of simultaneous connections can cause havoc if not setup correctly. The same is true of Database technology and whilst things like $$anonymous$$ySQL are great, they are not necessarily the best tool for availability systems.

Actually addressing your question is a little tough without knowing all the details of the application, but, I would have a database which keeps a track of the players in the session, the data of those players and the responses of the AI. The client app can make requests to the server (or listen for notifications) to find the current status of play.

The AI I'd probably keep as a very simple simulations running as a webservice which you talk to via an API (PHP, NodeJS or otherwise). You'd be able to pass in some information (either from a client or another webservice acting as a layer between the client and DB) and have it return a response. Think of it like loading a web-page, when it only processes the data when it's requested rather than permanently or on a schedule.

You could also consider running the AI on one of the clients in the background and have that communicate the data to the server for collection / distribution to the other players. If this sounds like a good idea, you could actually consider using the GameCenter multiplayer systems to do all or part of this (again, depending on what you actually need).

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

33 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Server software for multiplayer turn-based RPG like Pokemon 1 Answer

Turn-based small scale multiplayer: server-only-logic possible? 2 Answers

Purchasing seats of Unity Pro, iOS Pro, and Asset Server 1 Answer

Build Server, both Android and iOS 0 Answers

Run a script in background when the app is open or closed 5 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