Giter Site home page Giter Site logo

futurice / space-tyckiting Goto Github PK

View Code? Open in Web Editor NEW
30.0 68.0 21.0 4.54 MB

Futurice Space Tyckiting: Earth Domination Tour

License: MIT License

F# 6.12% Clojure 2.06% Haskell 6.55% Shell 0.40% Makefile 0.18% JavaScript 33.95% Python 3.32% Ruby 3.71% Rust 4.43% Scala 2.20% Swift 23.62% Objective-C 0.13% HTML 0.12% CSS 0.34% Go 2.33% Julia 5.00% D 2.99% Erlang 2.53%

space-tyckiting's Introduction

Space Tyckiting

Space Tyckiting banner

Welcome to Futurice Space Tyckiting!

This repository contains the Space Tyckiting server and client skeletons.

Space Tyckiting server communicates via a JSON-over-TCP protocol, making it possible for the clients to be implemented in any language of your choice.

Ready-made client skeletons, which provide a convenient network communication layer, have been provided for a number of programming languages. You may also wish to create your very own client from scratch — no problem! Take a look at the example clients and documentation and code ahead! If you'd like to share your client skeleton, please issue a Pull Request.

If you discover any bugs or issues with the server or the provided client skeletons, please let us know, and if possible, issue a PR with a fix!

Please see the server README, and the README's of the clients, for details on how to develop your AI and run Space Tyckiting.

Happy Space Tyckiting!

Space Tyckiting

space-tyckiting's People

Contributors

adrogon avatar heppu avatar ksallberg avatar ngc92 avatar okajasto avatar phadej avatar rikukissa avatar seance avatar simonccarter avatar wilzbach avatar

Stargazers

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

Watchers

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

space-tyckiting's Issues

no detected event when bot has been seen

The documentation says that clients receive a detected event when one of their ships has been seen or radared. This is stated in /server/README.md and /server/DETAILS.md. However, there is no detected event when a bot has been seen.

Here is an example from a match between two (Javascript) dummy AIs:

server output:

Round 24
EVENTS [ { event: 'move', botId: 0, pos: { x: 3, y: -5 } },
{ event: 'move', botId: 1, pos: { x: 5, y: -13 } },
{ event: 'move', botId: 2, pos: { x: -6, y: 7 } },
{ event: 'move', botId: 3, pos: { x: -7, y: -7 } },
{ event: 'move', botId: 4, pos: { x: -8, y: 9 } },
{ event: 'move', botId: 5, pos: { x: -13, y: 1 } },
{ event: 'see', source: 2, botId: 4, pos: { x: -8, y: 9 } },
{ event: 'see', source: 4, botId: 2, pos: { x: -6, y: 7 } } ]
Anon.JS: [ { botId: 0, type: 'move', pos: { x: 3, y: -6 } },
[...]

bot 1 output:

RECV <- {"type":"events","roundId":24,"config":{"bots":3,"fieldRadius":14,"move":2,"startHp":10,"cannon":1,"radar":3,"see":2,"maxCount":200,"asteroids":0,"loopTime":1000,"noWait":true},"you":{"name":"Anon.JS","teamId":0,"bots":[{"botId":0,"name":"Anon.JS 1","teamId":0,"alive":true,"pos":{"x":3,"y":-5},"hp":10},{"botId":1,"name":"Anon.JS 2","teamId":0,"alive":true,"pos":{"x":5,"y":-13},"hp":10},{"botId":2,"name":"Anon.JS 3","teamId":0,"alive":true,"pos":{"x":-6,"y":7},"hp":10}]},"otherTeams":[{"name":"Anon.JS","teamId":1,"bots":[{"botId":3,"name":"Anon.JS 1","teamId":1,"alive":true},{"botId":4,"name":"Anon.JS 2","teamId":1,"alive":true},{"botId":5,"name":"Anon.JS 3","teamId":1,"alive":true}]}],"events":[{"event":"move","botId":0,"pos":{"x":3,"y":-5}},{"event":"move","botId":1,"pos":{"x":5,"y":-13}},{"event":"move","botId":2,"pos":{"x":-6,"y":7}},{"event":"see","source":2,"botId":4,"pos":{"x":-8,"y":9}}]}
SEND -> {"type":"actions","roundId":24,"actions":[{"botId":0,"type":"move","pos":{"x":3,"y":-6}},{"botId":1,"type":"move","pos":{"x":5,"y":-12}},{"botId":2,"type":"move","pos":{"x":-6,"y":8}}]}

bot 2 output:

RECV <- {"type":"events","roundId":24,"config":{"bots":3,"fieldRadius":14,"move":2,"startHp":10,"cannon":1,"radar":3,"see":2,"maxCount":200,"asteroids":0,"loopTime":1000,"noWait":true},"you":{"name":"Anon.JS","teamId":1,"bots":[{"botId":3,"name":"Anon.JS 1","teamId":1,"alive":true,"pos":{"x":-7,"y":-7},"hp":10},{"botId":4,"name":"Anon.JS 2","teamId":1,"alive":true,"pos":{"x":-8,"y":9},"hp":10},{"botId":5,"name":"Anon.JS 3","teamId":1,"alive":true,"pos":{"x":-13,"y":1},"hp":10}]},"otherTeams":[{"name":"Anon.JS","teamId":0,"bots":[{"botId":0,"name":"Anon.JS 1","teamId":0,"alive":true},{"botId":1,"name":"Anon.JS 2","teamId":0,"alive":true},{"botId":2,"name":"Anon.JS 3","teamId":0,"alive":true}]}],"events":[{"event":"move","botId":3,"pos":{"x":-7,"y":-7}},{"event":"move","botId":4,"pos":{"x":-8,"y":9}},{"event":"move","botId":5,"pos":{"x":-13,"y":1}},{"event":"see","source":4,"botId":2,"pos":{"x":-6,"y":7}}]}
SEND -> {"type":"actions","roundId":24,"actions":[{"botId":3,"type":"move","pos":{"x":-8,"y":-5}},{"botId":4,"type":"move","pos":{"x":-10,"y":9}},{"botId":5,"type":"move","pos":{"x":-12,"y":0}}]}

Two of the bots see each other, and each AI receives a see event, but there's no detected event anywhere.

Of course it's not necessary to send a detected event when a bot has been seen, because the AI will receive a see event which notifies it that an enemy bot is within range of sight and can then infer that the enemy bot saw one of the own bots as well.

However, the actual behaviour should be reflected in the documentation.

missing typify import in /clients/javascript/position.js

The file /clients/javascript/position.js exports a function named clamp. Using this function leads to an error, because it needs the typify lib, which is not imported in /clients/javascript/position.js.

The error message looks like this:

/home/martin/tyckiting/space-tyckiting/clients/javascript/position.js:86
    typify.assert("position", pos);
    ^

ReferenceError: typify is not defined
    at Object.clamp (/home/martin/tyckiting/space-tyckiting/clients/javascript/position.js:86:5)
    at neighbours (/home/martin/tyckiting/space-tyckiting/clients/javascript/ai/MajorTom/ai.js:207:77)

As a workaround, using /server/server/position.js instead for the bot works (as demonstrated by my bot), because this version contains the needed import and is nearly identical to /clients/javascript/position.js.

Ordering of properties in json lists

Hello!

I have noticed that the ordering of certain JSON objects is not always the same. I have run into the issue that sometimes y comes before x in position tuples. But most often x comes before y. In the erlang client, I assumed that the order is fixed.

I see that this might not be a problem for clients that use object.x, object.y to parse. But when using pattern matching to parse it is a problem.

Should the clients be able to parse JSON objects with any internal order?

It would be helpful if you can explain a bit what guarantees there are for internal ordering of your JSON objects...

For instance, can something like this happen? Order 1 of events type object:

{
    "type": "events",
    "roundId": <the id of round>,
    "config": <configuration object>,
    "you": <team information>,
    "otherTeams": [<array of other teams>],
    "events": <array of events>
}

Order 1 of events type object:

{
    "roundId": <the id of round>,
    "events": <array of events>
    "type": "events",
    "you": <team information>,
    "otherTeams": [<array of other teams>],
    "config": <configuration object>,
}

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.