Giter Site home page Giter Site logo

snakebot's People

Stargazers

 avatar  avatar

Watchers

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

snakebot's Issues

Gameplay: Fixed starting positions

Currently starting positions for snakes are random. One snake can get an advantage by getting a favourable starting position. For instance if no other snakes are near by.

Suggested solution:
Create a fix set of starting positions on the map. Randomly assign bots to these positions.

Statistics

of:

  • number of served players
  • spread of client types (computer language)
  • spread of operating systems
  • wins per player name

Authentication system

  • Invalidate the login token after xx minutes of inactivity
  • ability to add users via docker environment variables
  • ability to add users via configuration file

Analyze GC settings

It seems that sometimes the whole server stops. This might be because of some stop-the-world GC happening. Also, clients are being defaulted to last direction move because responses are not being accepted in time. Could be GC-related as well.

Hack and resilience testing

There may be issues regarding misbehaving clients.
We need to test what happens when clients behave in a bad manner.

Example of things to test:

  • A client sends a RegisterMove before the game has started
  • A client sends a stream of constant RegisterMoves
  • A client tries to register twice under different names
  • A client changes the parameter receivingPlayerId in the message
  • Is it possible to DDOS the server and cause all other clients to default moves?
  • A client sends RegisterPlayer in the middle of the game
  • A client sends garbage
  • ... and whatever crazy stuff that might happen

Please create issues for whatever crashes you see. If possible attach server logs and client logs.

GameHistorySearchItem

Add number of gameticks in game.
Add list of interesting events during the game (tail-nibble, head-to-head-crash, head-to-body-crash, head-to-wall, head-to-obstacle etc).

Implement tournament mode

  • Add request/response classes for webclient to administer tournaments.
  • Implement TournamentManager

Logging

Enable some suitable logging that doesn't disappear when the docker container restarts.

New scheme for winner

  • Let the last snake alive win, regardless of points accumulated
  • The other positions are calculated by points
  • If two or more snakes have the same amount of points let the one with the most of:
    PointReason.GROWTH,
    PointReason.NIBBLE,
    PointReason.CAUSED_SNAKE_DEATH,
    PointReason.FOOD,
    win in the order described above.

C# - ClientInfo Call

Version 0.0.10 of the server introduces a call to allow collection of usage stats ( #38 ).
The Java client has embedded this call in the BaseSnakeClient class. The call is made when a player successfully registers.
We need the C# client to do something similar.

Obstacles fixed at start of game

Place the obstacles randomly at the start of the game and don't remove or add new ones during game play.

This means:

  • Remove options for likelihood of obstacle being removed in gameoptions
  • Remove/disable logic for removing/adding new obstacles
  • Update the GameAPI

Can't connect with browser WebSocket

When attempting to connect via a browser WebSocket, the connection fails with the following error:

WebSocket connection to 'ws://snake.cygni.se/training' failed: Error during WebSocket handshake: Unexpected response code: 403

This happens in all browsers (Safari, Chrome, Firefox), but not in Node. CORS issue perhaps?

Implement ClientInfo message

For statistics it is interesting to know what language, operating system etc a client is using. This is especially good to know the days before a student och client event so we can prepare guides and the correct responsiveness to questions.

I suggest we let clients, at any time, send a ClientInfo message over the WebSocket. This would only be needed once per session and could come at any time but perhaps a good time would be just before a "RegisterForPlay" message.

ClientInfo {
   programingLanguage: "JavaScript",
   OS: "Linux",
   IP: "xxx.xxx.xxx.xxx",
   baseClientVersion: "0.0.8"
}

Javadoc for API classes

It's important to be able to understand what messages from the server (and to the server) contain. A javadoc site for these classes should be a good start.

Arenas where real players can meet and play

Bots in training quickly get tired of the server bots and want to meet other real players (or several incarnations of itself).

Add a new type of play, called Arena, FightClub or Freeplay, where any players can meet and battle.

  • Any player in the same arena should have the possibility to start a game
  • Arenas may be given names so that other players can find each other

Save/search/fetch games

Save all game states (per gameID) in a mongoDB.
Ability to search by gameID, participating player(s) and date
Ability to stream a whole game by gameID

Preset boardsize

For simplicity we have decided to use only one size for the game world.

46x34

This means:

  • remove world size from all API:s
  • preferably we want the service to function even though a user uses the old API.

Game map dimensions should be enumerated or represent units of 25

Given the decision that a map dimension only can be a multiple of 25, this should be more obviously reflected in the client code. E.g. instead of integer-input, enumerate like for example:

small(25)
medium(50)
large(75)
x-large(100)

If we don't want to limit ourselves like this (e.g. it should be possible to have a 475x650 board) another option is to work with size units (integers). 1x1 would be like 25x25 works now, 4x4 would make it 100x100, 2x5 is 50x125 etc...

Send GameFeatures at GameStartingEvent

Now the GameFeatures are sent to the clients with the PlayerRegistered event. Better to send the GameFeatures on every start of a game. This is so that we have the opportunity to change settings between games.

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.