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 AmbushSky · May 24, 2017 at 07:41 AM · databaseefficiencyquery

Are WWW and WWWForms efficient at large scale?

So I want to preface this by saying I would only consider myself an intermediate coder, but would be able to be productive even with no access to any help resources, using what I know. I only preface by saying this, because I fear doing most things "on my own" (I learn better figuring things out along the way) may hurt me in the long run.

I am working on an online 2D social avatar based game, and as it currently stands, I have a MySQL database that houses all player data (user ID, all stats, item information, where the item is located in a players inventory, how many and what type of upgrades the item has) and because of this and my level of knowledge in getting to and updating that data, I have many different PHP scripts that run queries at real time using WWW and WWWForms.

As an example of a typical sign on, it would look something like this.

User logs in - Query(1) is run to populate the singleton containing all user stats. User loads directly into their inventory and a method is run to populate the inventory, in this method runs another query(2) to load in what the user has stored on their account. The user at that point can move items around, each time running a query(3*) to update the position of that item within the database. User goes into play mode where they then begin killing monsters, each time a monster is killed and an item is dropped a query(4*) runs to update the players items in the database, as well as a query(5*) running every 5 seconds to maintain accurate user information in the database and to prevent progress loss in the event of a crash. And finally a query(6) that runs in the event that the game is closed to save all necessary data to prevent progress loss. These are just a few of what I expect to be many database calls in the future, being an online game, a lot of this can not exist client side for the potential of manipulation.

I will add though that so far none of the queries are complex with 0 joins, and no sub queries. As an example adding a dropped item is:

 $sql = "INSERT INTO `items`(`id`, `SItemID`, `Slot`) 
         VALUES (".$userID.",".$itemID.",".$slot.")";

For some reason I feel like, while this works now, that at a larger scale this will become very inefficient, and potentially require major overhaul of the mechanics.

Any help or insight to my specific case would be greatly appreciated, as almost everything else I have found contains so much information that is more or less specific to another situation or circumstance. This is also a reason why I feel in my gut this may be the wrong way to go, because it is not something that is talked about too much.

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

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Linq Query - Strange Outcome 1 Answer

Generic sqlite query method 0 Answers

problem retrieving data from SQLite to Android 2 Answers

Problem with SQLite unity Database 0 Answers

get_version can only be called from the main thread. 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