TradeWars / gamemode

A work in progress aggressive economy gamemode...
5 stars 1 forks source link

Vendors and Item Economy #3

Open Southclaws opened 6 years ago

Southclaws commented 6 years ago

Vendors are actor-run shops around the map that provide item trading facilities for players.

There will be Vendor Types which describe high-level information about a vendor such as a name, a skin and a set of item types along with price ranges that the vendor will sell for.

Then there will be individual Vendors which have a world position and a vendor type. Vendors will stock up on goods randomly and the amount of items and price will be dependent on some attribute assigned to the item.

Southclaws commented 6 years ago

There's another detail that should be figured out too: how much of the "business logic" of these AI vendors is going to be in Pawn-space and how much in JVM I've thought of two ways to do this:

Method 1

The NPCs exist on the game server, they do all their transactions with players there and when they want to sell their items (based on some timer or something) they send requests to the Econ server and receive money back.

This bulks network traffic to single points in time, maybe daily.

Method 2

The NPCs barely exist in the game server, merely as interfaces to the Econ server. The rest of their AI exists on the Econ server and when players sell items, they use RPC requests to perform the transaction.

This means when a player trades with an NPC, they are sending requests back and forth during the trade, more like a typical web resource approach.

Resulting discussion:

[8:03 AM] KotlinHipster666: i'd go for two [8:03 AM] KotlinHipster666: as i'd try to keep as mich similar logic as possible in a single context [8:03 AM] Southclaws: yeah I was leaning towards two, it means less code in Pawn and more code in a good language :shades: [8:03 AM] KotlinHipster666: makes deployment, development and debugging easier [8:04 AM] Southclaws: that also means the game server needs a CreateVendor style RPC to signal to the Econ server that it created a vendor [8:04 AM] Southclaws: OR, the Econ server could even store Vendor locations [8:04 AM] Southclaws: so the gameserver boots up and asks Econ "send me all the vendor locations and I will spawn them" [8:04 AM] KotlinHipster666: do locations matter? [8:05 AM] Southclaws: yes, each vendor has a physical location on the map, a name, a preference of items they will buy, etc [8:05 AM] Southclaws: like, Steve only wants industrial items [8:05 AM] Southclaws: Laura only wants food [8:05 AM] Southclaws: etc [8:06 AM] Southclaws: hmm, I didn't think about persisting this data in a database...

Southclaws commented 6 years ago

Here are some notes regarding the requirements for the Econ server interface.

moved to https://github.com/TradeWars/Economy/issues/4