Idea

timotholt@yahoo.com avatar image
timotholt@yahoo.com suggested

Advanced Currency Model . . .

Hiya ...

I'm in the brainstorming phase of a PERSISTENT RTS that needs a virtual currency model that:

1) the limit can start off low and be raised with every factory the player builds and every factory the player level ups

(i.e. 2 level 5 factories contribute = 2x500/day, 3 level 2 factories contribute 3x200 for a total of 1600 energy/day)

2) factories stop for a few hours each day and restart . . . "factory is open" and "factory is closed" for part of the day

Is this something that is so far fetched it's not possible?

Thanks!

Tim

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

3 Comments

·
brendan avatar image
brendan commented

it sounds like, rather than a normal currency or energy model, you have one where the rate of currency generation is tied to the specific inventory items in the player account. This isn't far-fetched, but it is very game specific, and it's something you'll want to tune the values on post-launch, as you see how it's used. So here's what I'd do: Create your currencies and items, and then make some Cloud Scripts which the player calls periodically to sync with the service on the last sync time and the amount of currency earned based upon a) the items in the player's inventory and b) the regeneration values for those items, which you'll store in Title Data. You won't even need to call this very often - just call it on player sign-in, to get an initial sync of the info, then again when the player does something that requires the currency values to be authoritative, like spending any currency. That way, you can block any cheating, since all the important calculations will be on the server side.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

timotholt@yahoo.com avatar image
timotholt@yahoo.com commented

Ok, if my server or my cloud script is managing currencies, is there transaction support with rollback possible?

My update currency model would batch all the changes into a block and send the block to update all the currency if the currency needs to get bumped. . .

or should i keep a last sync value per currency . . .

or is this not necessary?

 

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan commented

Yes, if you're using the Server/AddUserVirtualCurrency in Cloud Script (or your own custom server), you'll be adding the currency to the player account, and it can then be used via PurchaseItem to buy things from your catalog. For rollback, you have the option of revoking items and re-adding the currency (either/or) via API calls or the Game Manager.

The way to manage the currencies would be:

  • On sign in, calculate the current amount for the player, based upon the last value and timestamp you recorded in User Read Only Data (so that the user can't cheat it from a hacked client).
  • Show the player a continually updated balance locally, since you're constantly recalculating. Don't write this to the account online, as it's not needed.
  • When the player takes an action that should have an authoritative check, like making a new building, use Cloud Script to ensure you have a server-authoritative way to do this (again, to prevent cheating).
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write a Comment

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas