9 votes

Farmd alpha

3 comments

  1. [3]
    Dotz0cat
    Link
    Farmd is a farm game made in c. It currently is just the backend for the game. Farmc will be made one day. I just moved it to alpha, meaning that it is playable. Not by much, but it could provide...

    Farmd is a farm game made in c. It currently is just the backend for the game. Farmc will be made one day.
    I just moved it to alpha, meaning that it is playable. Not by much, but it could provide a few minutes of fun. Give it a try if you wish. (It should run on anything POSIX, if not let me know)

    How to play

    The simplest way to play is with http only and with the web client of your choice. (All it needs to be able to do is send http GET and POST requests)

    First you need to make a save
    $curl http://localhost:8080/createSave?/path/to/save -X POST

    Next open the save
    $curl http://localhost:8080/openSave?/path/to/save -X POST

    Now it can go however you want (I would suggest buying the skills for fields and planting some crops)
    $curl http://localhost:8080/skill/buy?farming -X POST
    $curl http://localhost:8080/skill/buy?fields -X POST
    $curl http://localhost:8080/skill/buy?wheat -X POST
    $curl http://localhost:8080/skill/field/buy -X POST
    $curl http://localhost:8080/skill/field/plant?wheat -X POST
    $curl http://localhost:8080/skill/field/harvest -X POST

    Technical stuff

    Farmd is made in pure c. It uses libevent for both an event loop and serving the http. It uses sqlite3 for all the save handling. Farmd is released under a GPLv3 license.
    Farmd can also work over https. All that is needed is for https to be enabled in the config and necessary certificates provided.

    http_port = 8080;
    http_enable = TRUE;
    https_port = 8443;
    https_only = FALSE;
    key_location = "path/to/key/certificate";
    priv_key_location = "path/to/private/key";
    

    I would be happy to share more information about farmd, just let me know what you want to know.

    Farnd is currently a work in progress. Sharing it here allows me to reflect on the progress I've made so far.

    3 votes
    1. [2]
      vord
      Link Parent
      I'm curious why the choice of C over C++. It seems a lot of extra pain for little gain. That said, I'm gonna start trying to learn Lisp (again), so I get for learning or just "it's what I know."

      I'm curious why the choice of C over C++. It seems a lot of extra pain for little gain.

      That said, I'm gonna start trying to learn Lisp (again), so I get for learning or just "it's what I know."

      2 votes
      1. Dotz0cat
        Link Parent
        It's mostly just what I know and prefer to use. I do know some basic c++ and could pick up the finer bits quickly. Though I like to stick to c, its fun. There are some parts of c++ that this could...

        It's mostly just what I know and prefer to use. I do know some basic c++ and could pick up the finer bits quickly. Though I like to stick to c, its fun. There are some parts of c++ that this could benefit from such as abstract classes (I think that's what c++ interfaces are called) and other stuff such as maps.

        2 votes