Hi,
I'm making a business sim in Unity3d, with a persistent world that all players are a part of. I'm trying to work out which bits of the game I can do using PlayFab, and open to suggestions on what to use for the things PlayFab can't do.
Specifically, the game has the following requirements:
1. Base Building Anywhere
The game is set in space, with all the basic data about star systems, planets etc stored locally, and this data never changes.
Players can build mines, factories etc on planets, but each planet has a limited number of build positions, and only one player / one building can occupy any one position.
When a player zooms in to view a planet, they need to be able to see what buildings other players have built on that planet (though not the details of the building). So that they know which positions are free to build on.
2. Inventory Anywhere
Players can mine minerals on planets and manufacture consumer goods from those minerals. But the minerals and goods are only available on the planet where they are made. So the player needs to be able to have lots of stockpiles of stuff all over the place.
3. DHL in Space
Players can send their minerals/goods between planets via a NPC courrier service. They say what they want transported and where they want it transported to. Then their stuff takes x days to get delivered, in which time they can't touch it.
4. Want to Buy/Sell
Players can sell their minerals/goods to each other by placing "want to buy" and "want to sell" ads. Or by buying/selling to those ads.
So players need to be able to see others' ads. Plus there needs to be a system to resolve transactions, so the buyer gets their minerals/goods added to their inventory on whatever planet the ad was placed at. And the seller get their money. And finally, the ad needs to be updated, in case it is only partially filled: E.g. "I want to buy 10 crystals". Player B sells 2 crystals. The ad becomes "I want to buy 8 crystals" (Basically the same as Eve-online markets, for anyone who's ever played that game).
5. Running Costs
Player's buildings all have running costs. So every hour, X soft-currency credits are deducted from their balance. If the balance goes negative, they go "bankrupt", meaning all their buildings are disabled and can't be used (but also don't incur costs). Players can scrap (destroy) buildings for credits, and sell minerals/goods to try and get their balance positive. Then spend to unlock remaining buildings.
Players get Y days to get their balance positive, before buildings are automatically scrapped one-by-one until none are left. (So if you don't play for 6 months, when you return, you'll have no buildings left, but you will have a small stack of cash from your scrapped buildings).
Players also get a limited number of "vacation days" per year when they can set all their buildings to be disabled, and so not incur costs.
--
I'd guess 5. can be done using a server side script? My worry is making it efficient / not taking up too many server resources doing it.
I also figure 2. and 3. can be done by simply adding some extra data to the inventory items players own. E.g. a position / address field: "sector7, star1928, planet8". Just need to know if this idea makes sense in the context of how PlayFab stores data and the client accesses it.
For 1. (build anywhere), a building could similarly be in the player's inventory and have an address field. Just a case of how to let other players search by address. Is this possible in PlayFab or if not, open to ideas on what to use instead.
For 4. (buy/sell), I noticed PlayFab has an API to allow players to trade, but seems like it's more based on helping your friend by giving them an item, rather than what I'm after? Again, on the hunt for solutions to use if, as I suspect, PlayFab isn't quite appropriate to use in this case.
As well, if anyone has suggestions on how to reduce traffic/server load with these feature requirements, would be interested to hear. With all of these things, there'd be limits, so players can't just build 10,000 mines or place 5000 want-to-buy ads for 1 crystal each. Equally, I assume PlayFab has some clever caching stuff going on in the background?
Thanks
James Coote