Giter Club home page Giter Club logo

catanlog's People

Contributors

rosshamish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

uikit0

catanlog's Issues

Suggestion: Unifying buy/play patterns

Currently the pattern for buying things and playing development cards look like the following, respectively
player buys item, does_something_with_it
player plays dev card: card_name, does_something_with_it

Concrete examples being:
blue buys settlement, builds at (8 NW)
blue plays dev card: road builder, builds at (9 W) and (10 E)

It might simplify the reading and parsing if they looked more similar.

You might consider:
player action item_name, extra_information

Which would make it read more like:
blue buys road, builds at (8 NW)
blue plays road builder, builds at (9 W) and (10 E)

To a human it reads almost the same, but parsing it can be simplified a little.

Now the simple parser (read: not one using syntax trees and other fanciness) can split on ','. Everything before the comma is what the user did and everything after is information about precisely how they did it.

Before the comma always has three parts.
player is always the player
action is always "buy" or "build" (or other action names as they become necessary)

The action you see informs what you should expect to see in the third slot. If it's "buy" you should expect a settlement, city, road, etc. if it's "plays" you should expect a development card.

Once you know what to expect, you can look at item_name. Once you've seen the item name you will know how to parse what's on the other side of the comma.

Just a thought. If you don't like it, it's not a big deal. It's not as if it's unparseable now. Neat project, though.

Suggestion: Timestamps

You might consider adding optional timestamps to the file. Perhaps [2016-01-01T12:00:00.000Z] or even just the number of seconds since the game started [347].

It won't add much to the human-readable-ness of it. But it will add some more data for machine parsing. In terms of readable-ness the latter is probably a better option.

Why would anyone care about timestamps?

Well, if people start adopting your format there are some interesting possibilities. Having the timestamps will let you get information like average game length, average turn length, average turn length of a winning player, how does closeness to victory affect turn length, and possibly other things.

I think it would be interesting if this project picked up steam and the community generated hundreds or thousands of these files that we could pore over, extract data from, and create interesting analyses. But that requires that the information be captured and at a granular enough level.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.