Coder Social home page Coder Social logo

etimo / diamonds2 Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 3.0 251.45 MB

💎Diamonds v2

Home Page: http://diamonds.etimo.se/

License: MIT License

TypeScript 82.40% Python 6.15% Dockerfile 0.06% JavaScript 6.44% HTML 0.16% Shell 2.96% CSS 1.84%
ai bot competition game

diamonds2's People

Contributors

affeproffs avatar dependabot[bot] avatar forsbergphilip avatar h4zze avatar hejsaga avatar indrif avatar jassyrbravo avatar klaradj avatar ljukas avatar niclaslindstedt avatar r0tenur avatar rickardlofberg avatar wadholm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

diamonds2's Issues

Slow bot movement

It seems like bot movement is slowed down when multiple bots are in play on all boards. The more bots, the slower the movement.

Using imports relative project root makes production run break

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";

Host somewhere

We need to host the game somewhere where we can have a persistent state. To prepare for spring competition.

Rate limiter

Limit bot moves so it respects board settings

Tackle bots

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

Ability to switch board in frontend

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?

Docker errors on Windows

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.

Continuous delivery

Add some form of continuous delivery so we get automatic deployments for master

Add new frontend

Add frontend code to this repo. Also take care of merging PR from lukas and adapt the code to the new api structure.

Seasons and Highscores

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.

Dont remove bot until current operation finish

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?

Migrate old data

Migrate some (or all) of the old data to the new database. How it should be done is up for discussion

Docker compose production cannot contact database

  • backend/src/config/config.service.ts IS NOT TRANSCRIBED TO .JS
  • It works in dev, but not in prod.

Production

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)...

Development

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

Fix HTTP errors

The API returns incorrect http errors in some places. These need to be handled so a user don't get unexpected errors.

CI/CD

Auto test, package and deploy to kubernetes

Teleporters should move every now and then

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?

Properly attribute icons

We dont attribute our icons anywhere. Dont know where they come from or if they are free. Perhaps replace icons with properly attributed ones?

Kick out bot when performing move too quick?

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?

Larger board

Should we try having larger boards and possibly add more teleports? Pros/cons?

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.