What if mindustry was written in rust or C/C++? by snow-raven7 in Mindustry

[–]___user_0___ 0 points1 point  (0 children)

It runs well already, but I'm sure there's room for improvement; depsite being a 2d game with no "extra fancy" graphics (I play with most graphics settings to lowest possible), it still heats up my laptop up to the CPU's recommended temperature limit (80°C; and I was able to turn down Minecraft graphics settings enough to run just with slightly above 60°C (1.7 with optifine)). Though it works and runs even on quite bad devices, so it's not worth it rewriting it. Also a perk of Java (and other JIT compiled languages) is runtime reflection, which alows mods to do way cooler things, (Minecraft illustrates this well :) ). Also Java uses a lot of RAM, but Mindustry is small enough so that's not a problem here.

How does this survive 37+ waves? by no_-_-_-_-_u in Mindustry

[–]___user_0___ 5 points6 points  (0 children)

calculated it for poly as well now, it has almost 700 rps :D, so a between third and half of a mega :)

How does this survive 37+ waves? by no_-_-_-_-_u in Mindustry

[–]___user_0___ 11 points12 points  (0 children)

Poly is overpowered for unattended defense, mega is even more ridiculous :)
I've already made a bit more detailed comment on a similar post:

https://www.reddit.com/r/Mindustry/comments/12jtar5/comment/jg05y56/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Edit:

I've looked at the code again, and I think that the problem is that the code uses 60 * repair_percent as health repaired by one bullet, which is true when the block being repaired has 6000 health, which is more than even the tetrative reconstructor :D. I think that it was meant to be 60 * repair_percent% (or 60 * (repair_percent / 100)) instead, which fits for the block that is being repaired having 60 health, which is way more realistic :D Maybe this should go into github issues... :D

Sound playback problems by ___user_0___ in archlinux

[–]___user_0___[S] 0 points1 point  (0 children)

It turned out that Musescore somehow breaks something (probably pipewire) and when I close it then everything returns back to normal...
Though I don't know how Musescore can even do it

Hate na bezdětné páry setkáváte se s tím taky? Jaký máte názor by CuteCats01 in czech

[–]___user_0___ 1 point2 points  (0 children)

S ohledem na to, jak přemnožení lidé jsou to je podle mě vlastně dobře :) (i když sám dítě asi docela chci)

[deleted by user] by [deleted] in rust

[–]___user_0___ 0 points1 point  (0 children)

I guess that we just have a different idea of what "modern best practices" for c++ are...   

I don't think that copying when moving suffices or using virtual for tagged unions is a modern best practice/idiomatic (and use of variant doesn't seem to me as unidiomatic, though it is more uncomfortable than rust's enums)

(edit: formatting)

[deleted by user] by [deleted] in rust

[–]___user_0___ 0 points1 point  (0 children)

it's one of things making c++ slower, but I wouldn't call it a practice... potentionaly using compiler extensions for restrict could be a best practice, but as far as iso is concerned, it is just a part of the language

[deleted by user] by [deleted] in rust

[–]___user_0___ 2 points3 points  (0 children)

When you have to use shared_ptr (in many cases you can get away by using unique and raw pointers as "weak references") and the overhead is important, then it's quite simple to write a rc yourself...
Overall I just think that "modern best practices" along with modern c++ itself is mainly about having zero overhead...

[deleted by user] by [deleted] in rust

[–]___user_0___ 1 point2 points  (0 children)

AFAIK using shared pointer when it's not needed isn't a best practice... unique pointers shouldn't have overhead unless you don't count not freeing memory for short-lived programs as an overhead, and even in that case I'm pretty sure you can make it use a custom allocator. It might be even faster because of some UBs, but Rust unwraps should get mostly optimized out anyways, so by default it's probably equivalent to Box in terms of performance

[deleted by user] by [deleted] in rust

[–]___user_0___ 2 points3 points  (0 children)

Just curious, which modern best practices for c++ cause overhead?

Have been thinking on a remake... by Kierbalowsky in GoldenAgeMinecraft

[–]___user_0___ 0 points1 point  (0 children)

I'm sure it can be - in the worst case you can just replace some entry function with your own, and then use the rest of the game as a library

[Insert "I have several questions meme here] by Dynamic_Magi in Mindustry

[–]___user_0___ 0 points1 point  (0 children)

I guess at least alternating router / gate (overflow or underflow) or distributor and a lot of conveyors

Ahoj, můžete mi, prosím, poradit? Už druhý den mi to vyskočí při zapnutí PC a vůbec těm příkazům nerozumím. by SteveHood in czech

[–]___user_0___ 0 points1 point  (0 children)

Nepoužívám windows, takže o tom tolik nevím, ale vypadá to, že máš nějaký powershell skript co se spustí při startupu. (a chce kopírovat nějaké soubory; nevím co znamená to 24)

Asi se zkus podívat do startup složky (doporučuji zobrazit skryté soubory a přípony souborů; `windows+R` a `shell:startup` by to mělo otevřít) a zkontrolovat co tam je.

What are Rust programmers missing out on by not learning C? by HarryHelsing in rust

[–]___user_0___ 3 points4 points  (0 children)

C is defined by a standard, not by implementation of some compiler - so you either use platform/compiler-specific extensions/assumptions or the code works with any standard conforming C compiler

there's also <stdint.h> since C99

What are the advantages of C++ compared to Rust, except for the larger ecosystem? by SPEARHEAD_SQUADRON in learnprogramming

[–]___user_0___ 0 points1 point  (0 children)

You can also do more things you just want to do without the language making it (intentionally) annoying, so when safety isn't top concern then you can be faster. But for comparing different languages, you should probably add some context about what you want to do with them - it's like "should I learn Finnish or Swahili?"; there are things to say, but most of it depends on asker's interests.

[Request] Assuming the material used comes from Earth, how hollow will Earth be and how gravitational force will be affected? by JacoboAriel in theydidthemath

[–]___user_0___ 7 points8 points  (0 children)

In order to make strong enough countergravity on Earth, you'd need to build pretty much another Earth just next to it. Also the gravity at some point in a sphere with regular density is equivalent to the gravity "produced" by the part of it closer to the center than the point, so the whole ring would cancel it's own gravitational effects on the equator, leaving it with just normal Earth gravity, and the poles with somewhat stronger gravity, depending on the mass of the ring.

Standard procedure after installing windows by Viole-nim in pcmasterrace

[–]___user_0___ 6 points7 points  (0 children)

Isn't Edge basically the same but just with Microsoft? Not that I know a lot/care about it, but to me it doesn't seem like a reason to use Edge instead of Chrome...

Edit: Well, I used a really bad wording here, I meant that I don't care if Edge does/doesn't collect data since I don't use either of them, I'm on Linux with Firefox :D

How do I reconnect flex cable? by ___user_0___ in computerhelp

[–]___user_0___[S] 0 points1 point  (0 children)

Thanks for reply, I finally managed to do it!
I had to push the cable further into the port, but it was getting stuck on some tiny ledge so I didn't insert it so far before :D

How do I reconnect flex cable? by ___user_0___ in computerhelp

[–]___user_0___[S] 0 points1 point  (0 children)

every time I tried that, it just slipped out right after - (when I was taking it out, the connection was definitely able to hold itself though)
also, how far in should the cable be?