Live data from Hacker News

Setris – Tetris with Sand Physics

mslivo.itch.io

101–110 of 191 posts

Re: Setris – Tetris with Sand Physics

#102

Earlier quoted context omitted.

I didn’t say faster, I said more efficient. They are two wildly different things.

This seems to be such a pedantic discussion all around. Well, what did you mean by more efficient if not more performant, the usual metric? More efficient to develope? Possible, depending on the devs skill set, but hardly relevant for the end user who want to play the game on possible low performant hardware? Oh and I think wasm can beat java in several cases.

> This seems to be such a pedantic discussion all around.

No, as a high performance software developer, my aim was not to devolve the discussion into a pedantic "stone throw".

> Well, what did you mean by more efficient if not more performant, the usual metric?

Watt per instruction. IOW, power consumption. As a person who lives in HPC world, inefficiency is bane of my existence. Two software can be equally performant while having different power profiles. I'm focusing on power.

What does this brings, you may say. Throttling is the simple answer. If you waste more power, you'll hit the throttling wall faster, use more battery, and will lower the quality of the experience. From your phone to biggest supercomputers have thermal budgets, and none of them are unhittable.

> but hardly relevant for the end user who want to play the game on possible low performant hardware?

Not all of us have latest processors, tons of RAM, and JS microbenchmarks show that browser JS engines have wildly different performance characteristics for some loads. Using a native platform pushes these concerns out of the picture.

> Oh and I think wasm can beat java in several cases.

Have no experience with that, need to test and see.

Re: Setris – Tetris with Sand Physics

#103

Earlier quoted context omitted.

There’s also Not Tetris https://stabyourself.net/nottetris2/

Also related, Hatetris which always gives you the worst piece: https://qntm.org/files/hatetris/hatetris.html

I just went down a rabbit hole with this excellent blog post on using data structures, search algorithms, and maybe some machine learning to try to beat the previous world record of 66 lines: https://hallofdreams.org/posts/hatetris/

Re: Setris – Tetris with Sand Physics

#104

Earlier quoted context omitted.

I didn’t say faster, I said more efficient. They are two wildly different things.

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 vers…

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

Re: Setris – Tetris with Sand Physics

#105
post #75

Earlier quoted context omitted.

Java 10x faster than JavaScript, in 2023? No.

I didn’t say faster, I said more efficient. They are two wildly different things.

10× more computationally/power efficient while running? Not a chance. Assuming similar care put into the two, the two will probably be much of a muchness.

Re: Setris – Tetris with Sand Physics

#106
post #83
post #39

Earlier quoted context omitted.

`java -XstartOnFirstThread -jar setris-desktop-1.0-SNAPSHOT-jar-with-dependencies.jar` I had to add the start on first thread flag to prevent errors and start a launch. I do get stuck after `Starting UI Subsystem` gets logged but I havent put any real effort into trying to debug that yet.

I get this when run with homebrew's openjdk (which is JDK 20, I think): mikaeleiman@iMac ~/D/Setris-1.2_LINUX> java -XstartOnFirstThread -jar setris-desktop-1.0-SNAPSHOT-jar-with-dependencies.jar [LWJGL] [ThreadLocalUtil] Unsupported JNI version detected, this may result in a crash. Please inform LWJGL developers. [30.05.23][11:52:12] Loading Assets [30.05.23][11:52:12] Done. [30.05.23][11:52:12] Starting UI Subsyste…

I know little of how Java works, and especially how to override libs, but I did try downloading lwjgl's latest release and put all its jars in the classpath:

  CLASSPATH=(string join ':' (find . | grep jar | grep lwjgl)) java  -XstartOnFirstThread -Xmx4G -jar setris-desktop-1.0-SNAPSHOT-jar-with-dependencies.jar
(fish instead of bash; the "string join" part takes all the jar paths and joins them on a single line with colon separators)

Same output and behavior, though.

Also tried with an older JDK (version 17), but that fails to even open a window.

Re: Setris – Tetris with Sand Physics

#107
post #60
post #4

This is nutty, I love it. One word of caution, I wouldn't mention the word Tetris anywhere, just use "falling block classic game" or whatever else, as it's one of the most trigger happy IP I know of after Nintendo. That said it's so far detached from the original you might be fine.

so your advice is basically, go ahead and make your derivative tetris game but just call it something else?

Yes, that was clearly stated. Are you trying to insinuate something?

Re: Setris – Tetris with Sand Physics

#108

Earlier quoted context omitted.

This seems to be such a pedantic discussion all around. Well, what did you mean by more efficient if not more performant, the usual metric? More efficient to develope? Possible, depending on the devs skill set, but hardly relevant for the end user who want to play the game on possible low performant hardware? Oh and I think wasm can beat java in several cases.

> This seems to be such a pedantic discussion all around. No, as a high performance software developer, my aim was not to devolve the discussion into a pedantic "stone throw". > Well, what did you mean by more efficient if not more performant, the usual metric? Watt per instruction. IOW, power consumption. As a person who lives in HPC world, inefficiency is bane of my existence. Two software can be equally performant…

"Using a native platform pushes these concerns out of the picture."

Well yes, but this project was made with java. And by now I don't think java is more performant or efficient than the browser. In general, as you are surely aware, if you are looking for the most efficient solution, than obviously neither java nor the web is the right plattform. But for a casual game, both is fine.

Re: Setris – Tetris with Sand Physics

#109
post #75

Earlier quoted context omitted.

Because the developer didn't want to. Instead they coded it in Java and ran with it. Personally, I love it. It's probably 10x more efficient than a possible JS implementation, tho.

Java 10x faster than JavaScript, in 2023? No.

Heh? What world are we living in that Javascript is faster than Java?

Re: Setris – Tetris with Sand Physics

#110

Earlier quoted context omitted.

Also... 61MB download!

x1270 of original NES Tetris! (32kb of code & 16kb of graphics)

The original wasn't built to have sand physics and to be portable on most major platforms, displaying at high resolutions...

What's your point?

Post reply on HN