etimo / diamonds2 Goto Github PK
View Code? Open in Web Editor NEW💎Diamonds v2
Home Page: http://diamonds.etimo.se/
License: MIT License
💎Diamonds v2
Home Page: http://diamonds.etimo.se/
License: MIT License
If (when) we have more than 1 board it would be nice to have some kind of way of switching board in the frontend. Perhaps query the number of boards and links to switch current board?
The API returns incorrect http errors in some places. These need to be handled so a user don't get unexpected errors.
Async queue:
http://caolan.github.io/async/v3/docs.html#queue
backend_1 | [2020-02-07T17:12:13.918Z] DEBUG AppModule dependencies initialized
backend_1 | [2020-02-07T17:12:15.577Z] ERROR Unable to connect to the database. Retrying (1)...
backend_1 | [2020-02-07T17:12:20.140Z] ERROR Unable to connect to the database. Retrying (2)...
backend_1 | [2020-02-07T17:12:24.738Z] ERROR Unable to connect to the database. Retrying (3)...
backend_1 | [2020-02-07T17:12:29.357Z] ERROR Unable to connect to the database. Retrying (4)...
backend_1 | [2020-02-07T17:12:33.986Z] ERROR Unable to connect to the database. Retrying (5)...
backend_1 | [2020-02-07T17:12:38.609Z] ERROR Unable to connect to the database. Retrying (6)...
backend_1 | [2020-02-07T17:17:15.834Z] DEBUG AppModule dependencies initialized
backend_1 | [2020-02-07T17:17:18.466Z] DEBUG TypeOrmCoreModule dependencies initialized
backend_1 | [2020-02-07T17:17:18.527Z] DEBUG Starting application on 5000
backend_1 | [2020-02-07T17:17:18.531Z] DEBUG BotsController {/api/bots}:
backend_1 | [2020-02-07T17:17:18.533Z] DEBUG Mapped {/, POST} route
backend_1 | [2020-02-07T17:17:18.534Z] DEBUG Mapped {/:token, GET} route
backend_1 | [2020-02-07T17:17:18.534Z] DEBUG BoardsController {/api/boards}:
backend_1 | [2020-02-07T17:17:18.534Z] DEBUG Mapped {/, GET} route
backend_1 | [2020-02-07T17:17:18.535Z] DEBUG Mapped {/:id, GET} route
backend_1 | [2020-02-07T17:17:18.535Z] DEBUG Mapped {/:id/join, POST} route
backend_1 | [2020-02-07T17:17:18.536Z] DEBUG Mapped {/:id/move, POST} route
backend_1 | [2020-02-07T17:17:18.536Z] DEBUG HighscoresController {/api/highscores}:
backend_1 | [2020-02-07T17:17:18.536Z] DEBUG Mapped {/, GET} route
Gameobjects DiamondGameObject and DiamondButtonGameObject should be removed if bot interacts with DiamondButtonGameObject.
It seems like bot movement is slowed down when multiple bots are in play on all boards. The more bots, the slower the movement.
Add frontend code to this repo. Also take care of merging PR from lukas and adapt the code to the new api structure.
Limit bot moves so it respects board settings
This is running on a pretty fresh Windows host (with Linux containers):
Running development gives me:
backend_1 | yarn run v1.21.1
frontend_1 | yarn run v1.21.1
frontend_1 | $ react-scripts start
backend_1 | $ nodemon --config nodemon.json
frontend_1 | /bin/sh: react-scripts: not found
backend_1 | /bin/sh: nodemon: not found
backend_1 | error Command failed with exit code 127.
backend_1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
frontend_1 | error Command failed with exit code 127.
frontend_1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
diamonds2_backend_1 exited with code 127
diamonds2_frontend_1 exited with code 127
Running production gives me:
backend_1 | yarn run v1.21.1
backend_1 | $ yarn run typeorm migration:run
backend_1 | $ (rm ormconfig.json || :) && ts-node -r tsconfig-paths/register src/scripts/write-type-orm-config.ts
backend_1 | /bin/sh: ts-node: not found
backend_1 | error Command failed with exit code 127.
backend_1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
backend_1 | error Command failed with exit code 127.
backend_1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
So less errors from frontend (due to it running nginx), and another error from backend.
Fix python example bot so it works with the new api.
Ongoing task to further improve all jsdocs in code.
We should have a place where we write about the rules so contenders can get started easily.
In the previous version the teleporters moved every time the diamonds respawned. Which admittedly is not very good when the button to repspawn diamonds exists.
However maybe we could move them every 30, 60, 90 sec or something similar?
Now we answer with a forbidden/rate limit when a move is performed too early (not letting a total of minimum required time pass). Before we kicked out the bot from the game in this case.
The difference is that if we kick out the bot they can't "try" and just hammer the api with requests until one succeeds, thus optimizing the latency handling more. Instead they have to work out when they can perform the move.
Discussions, suggestions?
Instead of showing all previous highscores in an all-time list sorted by the amount of diamonds, they could be split up into their individual seasons. They could also not show the amount of diamonds collected, instead just showing them in the correct order, and maybe only show the top 5 contestants. This would not scare away new people when they see very high scores from seasons that were very different than the one currently running.
Nice to have both in-memory storage and persistent storage. Should be able to start app with either of the implementations.
We need to host the game somewhere where we can have a persistent state. To prepare for spring competition.
Auto test, package and deploy to kubernetes
To prevent disk space from being eaten a lot when deploying.
Split board config into:
As before, run two etimo bots that constantly play the game while no one else is playing.
It is currently possible to move outside of the board.
We don't need to lock simulatenous operations to different boards.
Perhaps wrap the board in a new class?
Should we try having larger boards and possibly add more teleports? Pros/cons?
String -> number
Migrate some (or all) of the old data to the new database. How it should be done is up for discussion
It looks like the bots can enter a position where another bot is located.
To prevent people from hogging bases and buttons
Add some form of continuous delivery so we get automatic deployments for master
First I join a board with email/name and play. Afterwards I join with my received token but receive 409 Bot already on board.
If a bot is currently performing an operation on the board it should not be removed during the operation. Perhaps this could also be a problem during another bot's operation as well?
Should delete operation also be performed using the operation queue?
Explaining config, functionality etc
Currently causes max callstack exceeded.
When the files are moved the import paths not working if it´s imported relative project root.
Breaks:
import { IPosition } from "src/common/interfaces/position.interface";
Works:
import { IPosition } from "../common/interfaces/position.interface";
We dont attribute our icons anywhere. Dont know where they come from or if they are free. Perhaps replace icons with properly attributed ones?
Calls to /boards could also return an list of enabled game features
We have discussed this feature before but were unable to implement in old version due to race conditions. Lets continue discussing this feature here.
Proposed change:
If you move into another bot you take their diamonds and push them back to their base. This could also help bots from being stuck and blocked by other bots
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.