Coder Social home page Coder Social logo

tetristrainer's People

Contributors

dependabot[bot] avatar georgpukk avatar gregorycannon avatar wikedawsom 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tetristrainer's Issues

60Hz Das on Firefox

Recently, the Tetris pieces have been moving significantly faster than normal. After a bit of testing, it seems that the pieces are moving at roughly 60Hz, or twice the maximum possible rolling speed. While fun, that's not exactly a realistic setting.

I don't recall exactly when I noticed this, but it was no more than a few days ago. This suggests the bug was either caused by your latest batch of commits, or by upgrading Firefox to version 122.0.

I play on Firefox. When I tried it on Chrome, the pieces moved at normal speed. I suppose it's possible that one of my browser settings is relevant, but I don't know how to test that.

Steps to reproduce:

  • Open the Tetris trainer in Firefox 122.0
  • Set piece sequence to "IIIIIIIIIIIIIIIIIIII"
  • Choose level 29
  • Hold left
  • The I pieces will stack up to the 16th or 17th row before they stop reaching the edge of the screen.

As a side note, I notice that the piece movement is slightly inconsistent. In the testing strategy above, sometimes the seventeenth I reaches the left, and sometimes it doesn't. I suspect this inconsistency is also a bug, but I don't know if it's part of the same bug, or an unrelated bug that I only noticed because I was testing this one.

Arrow keys scroll the web page

When a game control key is an arrow key, pressing the key will scroll the webpage too.

For now I can zoom out the web page so that there is no scrolling possible, but wonder if there can be improvement in the code that can help with that.

10-30fps Performance in Chrome

Thanks for making this - I think this might be a really handy tool for practicing maintaining DAS for me!

Although it's actually nice for some practice to be slowing things down I do wonder if there's a performance issue that I'm seeing or maybe this implementation doesn't currently support real-time simulation?

I currently only get about 10-30fps with the default settings. I have i7-67k 4GHz Skylake PC, 32GB RAM plus an GTX 970 GPU. The GPU isn't that high-end but overall the system is reasonably decent, so I'd guess it should be able to easily simulate at 60fps to match the original NTSC NES fps.

A quick profiler recording in Chrome shows frames e.g. taking ~100ms
From there the gpu work looks like it's taking trivial amounts of time like 0.2ms
Looking at the stack traces on the main thread it looks like multiple frames are being processed in javascript for each frame presented - I'm not entirely sure why that would be the case but in general it looks like the javascript execution is also only taking a trivial amount of time.
The rasterizer thread looks like it's saturated so I suppose the issue with the canvas rendering the playfield on the cpu.

Since I have a 4k monitor so I guessed it might just be too high of a resolution and I tried dropping my monitor's resolution right down to 1024x768 just to experiment but was still seeing the same kind of performance.

I wonder if this is currently expected, or if not I wonder if there might be any known tricks for getting things running at a smooth 60fps?

image

Unexpected behavior: Unhelpful error messages when requesting JSON for levels not supported by the backend

Recreation:

  1. Set level as 15 at beginning screen
  2. Start the game
  3. Click "Calculate"

Expected:

The game should let one know the level they have chosen is not supported by the back end.

Actual:

The game returns a cryptic error message

Potential Fix:

A helpful error message exists in the json request response, displayed below.
If the json parse fails, then the error could be set to the plain text of the response.

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.