3 ms·
Right, but efficient can mean a lot of things. Though Java was used, this game is inaccessible to Mac, iPhone, and Android users. Porting to all these platform
by chrisco255 3y ago
Right, but efficient can mean a lot of things.
Though Java was used, this game is inaccessible to Mac, iPhone, and Android users. Porting to all these platforms is inefficient compared to just using the web.
It also requires a 60MB download, which is not very space efficient for a relatively simple 2D game (NES Tetris fit on a 24KB ROM). People have implemented Tetris in as little as 446 bytes [1]. Full color JS versions have been done at 16KB or less [2][3]. A JS version from 2004 came in at 1.5kb [4].
Haven't done memory efficiency analysis, but willing to bet the average JS Tetris implementation has dramatically better memory efficiency as well.
[1] https://hackaday.com/2016/10/06/tetris-in-446-bytes/ https://hackaday.com/2016/10/06/tetris-in-446-bytes/
[2] https://github.com/cztomczak/jstetris https://github.com/cztomczak/jstetris
[3] https://codeincomplete.com/articles/javascript-tetris/ https://codeincomplete.com/articles/javascript-tetris/
[4] https://joriszwart.nl/games/javascript-tetris-1.5kb https://joriszwart.nl/games/javascript-tetris-1.5kb
- bayindirh 3y agoMacOS has official Oracle and OpenJDK distributions. The author just didn't compile an executable for them, that's all. At least, I run Eclipse on macOS, which in turn uses platform Java. It's funny that when people say that hardware is cheap, but frown on a 60MB explicit download. Our browsers spend several 60MBs per day to show us ads, and we don't tell a word, but "a 60 MB game. Heresy!", we cry. I'm no stranger to hyper-efficient implementations as a demo scene enthusiast, yet this is no demo, and is a cross platform game, where the author decided to code in Java. I don't understand the criticism, because I'm aware of no rule that any software we develop shall run on Big5 (iOS/macOS/Android/Linux/Windows), plus web browser and my car key fob. Actually, when I look the files, the game is 20MB assets + 110K executable + 40MB JRE. So the developer decided to bundle the JRE to make sure it runs. That's a fair (even small) size given today's lassiez faire attitude where people chant "Hardware is cheap, network is reliable". Yes, one might do this in 100K altogether, but, personally, I'm no judge. It's a good game, runs on my favorite OS, and enjoyable. That's enough for me. If the idea is that good, let Setris clones show us the way.
- mslivo 3y agoThe assets are 13MB sound effects + 400kb png image files, the rest of the file size is due to platform natives and the bundled JRE. I know it's a lot of overhead but its java.
- chrisco255 3y ago> The author just didn't compile an executable for them, that's all Would love to see the author's actual comment on this rather than your presumptions about it. If it's trivial to compile and run, why leave out a huge market for what you make out to be minutes of effort? > Our browsers spend several 60MBs per day to show us ads When I'm browsing, I run an ad blocker. As a digital nomad, I'm also regularly on 4G and hit my data caps often. I would never wait for 60MB of download for a simple game. > yet this is no demo, and is a cross platform game Right, I just used some examples to show how little memory a game like Tetris needs, including high quality production implementations, like the original NES version, as well as most major Tetris PC, console and handheld releases in the last 30 years. The JS examples above are inherently cross platform. A browser based game will run on every single consumer grade device that has access to the internet. Higher quality JS versions can be found, including the official version: https://tetris.com/play-tetris https://tetris.com/play-tetris That version is 4.9MB, 2.5MB of which are MP3 files, much of the rest of it is high-quality full-color PNG assets. Clearly the assets should be reduced in size. No need to ship a runtime if you use JS. Another benefit is it runs in a sandboxed browser environment and I don't have to worry about running an executable locally. Again, all this is a response to your assertion that "It's probably 10x more efficient than a possible JS implementation, tho." It doesn't run on my OS, and that's part of the reason I'm complaining about it.