cygni / snakebot Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://snake.cygni.se
License: MIT License
Home Page: http://snake.cygni.se
License: MIT License
Implement support for cors in login service.
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.
Send a link to the web gui to all clients when a game starts (only training mode) so that the game can be started and viewed there.
If two snakes eat each other's tails it seems the both die. Reported by David Schlyter.
Let all clients send a ping over the websocket every 30 secs. The server replies with a pong and thus keeping the socket alive.
of:
If a game area is rectangular (e.g. 50x25 as currently is checked in in the JS-client), a game can be started but the game area won't be drawn.
Create a loginpage to access tournament 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.
Now the adress to the websocket is hard coded in TournamentStore.js and GameStore.js. For deployment we need this adress to either be specified as an environment variable or a configuration file.
It would be great if the snakes presented in the highscore list was color coded in the same color as the snakes are drawn!
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:
Please create issues for whatever crashes you see. If possible attach server logs and client logs.
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).
The implementation now puts the MapUpdateEvent on the outgoing eventbus to each client and then directly starts the countdown.
Better to start the countdown till after we have confirmation that the messages has at least been sent. But to wait for a real ACK from all clients might be too much (and also difficult, and could be misused)
Enable some suitable logging that doesn't disappear when the docker container restarts.
When a snake kills itself by hitting a wall or itself a configurable penalty is rewarded.
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.
If a player's RegisterMove comes after the specified time limit respond with a RegisterMoveTooLate response.
Place the obstacles randomly at the start of the game and don't remove or add new ones during game play.
This means:
Add obstacles in clusters of 1x1, 2x2 or 3x3 tiles (square formation).
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?
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"
}
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.
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.
The random obstacles adds a measure of randomness that could kill a snake if unlucky. This happens for example if an obstacle is spawned so that a snake becomes locked in.
Better to add a random amount of obstacles at game start that stay there for the rest of the game.
Increase available info at http://snake.cygni.se/info to include:
git hash
version
build number
build date
You enter the number of rounds you want to play in the tournament and get a summary of the score after the last round. This is needed when there are not enough players for a full tournament.
There are a lot of messages going back and forth during a game/tournament. It would be good to document this flow, especially for someone wanting to write a client in an new language.
There are several transformation classes not under test right now. See module domain and in package se.cygni.game.transformation.
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
For simplicity we have decided to use only one size for the game world.
46x34
This means:
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...
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.
This setting is not applicable when the last living snake wins.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.