There’s no such thing as a FreeCiv Marc Friedman Ed Hong Jon Nowitz Steve Wolfman.
-
Upload
suzan-horton -
Category
Documents
-
view
214 -
download
0
Transcript of There’s no such thing as a FreeCiv Marc Friedman Ed Hong Jon Nowitz Steve Wolfman.
There’s no such thing as aFreeCiv
Marc Friedman
Ed Hong
Jon Nowitz
Steve Wolfman
BIDDY: the Auction DAI• Goals
– agents compete for resources– agents control their resources independently– mediation is simple, extensible, lightweight– simple way of distributing competitive power– agents don’t reason about other agents
• Vision– income controls power of agents– resource conflicts settled through auction– maintenance costs promote sales
Philosophy: Steal, steal, steal!
• Steal the map from the client (done!)– Their client and server have almost identical
models of the world– Use their client’s data structures directly– Use their mutators to keep up-to-date
• Steal the UI from the client (done!)– Run CIVY as a separate executable– Do NO UI work in BIDDY
• Steal the logic from the AI– How much we can use remains to be seen
BIDDY Nitty-gritty
• Language - C/C++ with LEDA libraries– Agents in C++– Stolen stuff (like map) in C
• Platform - platform independent– eXcised X from client -- just uses sockets– CivY runs separately
• Visualization - no direct visualization for client, view actions with CivY
Architecture of BIDDY
• Agents control some behavior independently• Factories (city production) and units are resources• Bidders (a subset of agents) can own resources• Each new year,
– Resources are bought and sold at auction– Agents GO in random order, controlling their
resources, spawning child agents, and disappearing– Agents can register handlers for asynchronous
events they are interested in• Use OLD BIDDY for behaviors that don’t fit
Agents and Bidders
• PLAYER -- divvies up currency, manages new and unwanted resources
• GROWTH -- settlement & improvement• OFFENCE -- conquest• DEFENCE -- garrisons, forts, roads• EXPLORE -- map territory by land and sea • GOVERNMENT, SCIENCE, POPULACE• ONE FOR EACH CITY - to buy their own
production
Division of Labor
• Jon -- PLAYER module, AUCTIONEER• Marc -- agent/client interface, interagent com
protocols, shared data structures, GROWTH module
• Steve -- CivY, OLD BIDDY, EXPLORER, POPULACE
• Ed -- CITIES, DEFENCE• Nobody yet -- OFFENCE
Old Biddy: the FreeCiv AI
• Port of server-side FreeCiv AI into client
• Main fixes– handle unknown territory (explore and reason
about danger/value)– understand penalties for build changes– support server-side data-structures (e.g., settler
minimap)– stop cheating in various other ways
Old Biddy: performance• Reasonably fast
– large civ handled in a few seconds (10-15)
• Reasonably effective – explores, settles, researches, builds wonders (oops),
defends cities, …
• Worse than built-in AI– consistently near the bottom of games– primarily too chicken of unexplored territory
compared to all-knowing enemies
Broker & Banker
• Distributes income based on events & heuristics TBA– exploration agent receives income based on #
of unexplored tiles– defense agent receives income based on phase
of game?
• Controls player bank accounts– no cheating (overbidding) allowed
Auctioneer• Collects resources for auction
– all unallocated units– city production which has just completed– new resources and leftovers from last year– agent-owned resources put up for sale
• Collects bids– bidders view the auction block– bidders submit one or more bids– each bid is just an amount of ogrocs
• Auctions resources– highest bidder chooses first, and so forth– agent may refuse choice for refund– may choose any available resource
Cheese
• Handles portions not (yet) allocated as resources– tax rates– science– city workers– government
• Based on Old Biddy components (cheesy heuristics)
Auctions -- discussion
• Advantages– solves competition problem– simple communication– can do it without reasoning about other agents
• Disadvantages– optimizes the wrong thing (can an auction
maximize global utility?)– no notion of per-agent utility to learn by– ‘good’ income and maintenance costs unknown