News for hackers. Stuff that matters.
Re:Ask HN: What are your favorite examples of elegant software? by c7DJTLrn on Monday May 02, 2022 @02:00PM (#31238530)
Not sure if games count as software but if they do - Factorio. I don't play much these days but I'm still utterly stunned how a relatively small, humble team of developers can build something so robust and performant. Granted, I've never really tried pushing the limits, but not once have I felt like the game is even breaking a sweat while processing thousands of machines, belts, and bots. It's a miracle to me.

Their devblogs are really nicely written and you can tell they are extremely passionate about getting things right. In my experience that's a rarity now.

And of course, it's a brilliantly addictive game.

Re:Ask HN: What are your favorite examples of elegant software? by kjeetgill on Monday May 02, 2022 @03:58PM (#31240101)
Similarly, mindustry is written in java by a single developer freshly out of college and is incredibly performant for the amount of moving pieces rendered at a time. Granted I'm not in video games, maybe it's not too hard, but I thought it was really cool.

It's also an incredibly cool, interesting game design. If you like Factorio + Tower Defense you should check it out.

Re:Ask HN: What are your favorite examples of elegant software? by jpeter on Monday May 02, 2022 @07:04PM (#31242278)
Factorio is able to handle insane base sizes https://www.youtube.com/watch?v=3QjAhxxKWIk
Re:Ask HN: What are your favorite examples of elegant software? by SatvikBeri on Monday May 02, 2022 @09:11PM (#31243120)
The developers have a blog post on how their codebase was a mess and difficult to work with, and their process of fixing it: https://www.factorio.com/blog/post/fff-366
Re:Ask HN: What are your favorite examples of elegant software? by AnIdiotOnTheNet on Monday May 02, 2022 @04:53PM (#31240786)
> I'm still utterly stunned how a relatively small, humble team of developers can build something so robust and performant.

I'm not sure that, on the whole, robust and performant software can be put together by teams much larger than that.

Re:Ask HN: What are your favorite examples of elegant software? by ramesh31 on Monday May 02, 2022 @03:42PM (#31239873)
Doubly so that the game is written entirely in native C++ and is fully cross platform compatible (mac/windows/linux) with a tiny binary size. The responsiveness and performance of that game even with thousands of agents onscreen has always impressed me.
Re:Ask HN: What are your favorite examples of elegant software? by ThunderSizzle on Monday May 02, 2022 @06:52PM (#31242143)
I'll also point out that the UI for Factorio is almost among the best.

I'd prefer a factorio over almost another UI.

I'm imagining a port of factorio's UI into most strategy games would be very nice, both from a VERY zoomable map, a clear research/progression tree. A few improvements could be made IMHO, but it's lighyears better than TF, CS, the Chris Sawyer set, etc.

Re:Ask HN: What are your favorite examples of elegant software? by jawarner on Monday May 02, 2022 @07:08PM (#31242316)
What are TF and CS?
Re:Ask HN: What are your favorite examples of elegant software? by momothereal on Monday May 02, 2022 @07:30PM (#31242491)
Team Fortress, Counter Strike, and Tycoon games.
Re:Ask HN: What are your favorite examples of elegant software? by ThunderSizzle on Tuesday May 03, 2022 @09:50AM (#31248283)
Train/Transport Fever (1/2), Cities: Skylines
Re:Ask HN: What are your favorite examples of elegant software? by momothereal on Thursday May 05, 2022 @12:19AM (#31269417)
Damn, I was completely off!
Re:Ask HN: What are your favorite examples of elegant software? by tomc1985 on Monday May 02, 2022 @09:24PM (#31243227)
There's a series of space strategy/4x/combat sims called X where the latest entry seems to simulate entire economies and individual ships in real time. Dozens of sectors with hundreds of ships and dozens of space stations all humming along at 30-60 FPS.

Like Factorio it's incredible and makes me wonder wtf I was doing chaining together bullshit service APIs in my day job.

Re:Ask HN: What are your favorite examples of elegant software? by cmeacham98 on Monday May 02, 2022 @09:36PM (#31243338)
This game sounds really cool, but I can't find it when I lookup "X game" or "X 4x game". Can you link it to me please?
Re:Ask HN: What are your favorite examples of elegant software? by tomc1985 on Monday May 02, 2022 @09:41PM (#31243383)
X4 Foundations is its name

https://store.steampowered.com/app/392160/X4_Foundations/

The expansion packs have expanded the size of the game world considerably, making the whole thing even more amazing

Re:Ask HN: What are your favorite examples of elegant software? by cmeacham98 on Monday May 02, 2022 @09:52PM (#31243486)
Thanks!
Re:Ask HN: What are your favorite examples of elegant software? by tomc1985 on Tuesday May 03, 2022 @01:33AM (#31245003)
It's a little quirky (ok, very quirky) but one of my favorite games ever!
Re:Ask HN: What are your favorite examples of elegant software? by gitgud on Monday May 02, 2022 @08:25PM (#31242839)
Another elegant game is [1] City Skylines. It's amazing how they can create such a huge virtual world with millions of simulated individuals that roam around and have complex lives in your city.

[1] https://store.steampowered.com/app/255710/Cities_Skylines/

Re:Ask HN: What are your favorite examples of elegant software? by YesBox on Monday May 02, 2022 @08:35PM (#31242902)
Err, have you played the game? I cant get past 100,000 without the game beginning to slow down. I have a decent computer too.

I was bothered by this problem so I solved it for my own city builder game, Archapolis (still very early development):

https://www.youtube.com/watch?v=7q0l87hwmkI

I can path 200,000 to 300,000+ units simultaneously to random destinations, with a bonus of utilizing all shortest paths between two points.

The paths are all cached for constant time path finding, but I figured out how to do so efficiently (both building and storing tree/graph)

I wrote a non-technical article here:

https://www.yesboxstudios.com/2022/04/27/all-nck-shortest-pa...

Re:Ask HN: What are your favorite examples of elegant software? by synicalx on Monday May 02, 2022 @07:32PM (#31242501)
Factorio really is a bit of a modern marvel, even HUGE factories don't seem to run poorly at all and I genuinely have no idea how. Other similar games made since (Satisfactory comes to mind) seem to struggle with things like keeping track of resources on belts at scale, which IMO is a perfectly understandable problem to have but still makes factorio that much more impressive.
Re:Ask HN: What are your favorite examples of elegant software? by waste_monk on Tuesday May 03, 2022 @12:36AM (#31244670)
They have some fantastic dev blogs, such as this one on belt optimisations

https://www.factorio.com/blog/post/fff-176

Re:Ask HN: What are your favorite examples of elegant software? by kevmo314 on Tuesday May 03, 2022 @12:25AM (#31244604)
You can definitely hit the limits of Factorio. My largest base runs at ~10fps which is how I know it's time to start a new game. Egregious use of copy/pasting and an automated robot production will get you there.

It's still leagues ahead of any other game I've played though.

Re:Ask HN: What are your favorite examples of elegant software? by ibejoeb on Monday May 02, 2022 @02:25PM (#31238861)
If they're made of software, they count
Re:Ask HN: What are your favorite examples of elegant software? by Aardwolf on Monday May 02, 2022 @06:01PM (#31241553)
I've definitely pushed the limits of performance with way too upgraded huge range artillery turrets hitting all the biter bases, but yes, very performant with large factories otherwise :)
Re:Ask HN: What are your favorite examples of elegant software? by Gigachad on Monday May 02, 2022 @07:31PM (#31242492)
Factorio is apparently one of the very few games with CI / automated testing.
Re:Ask HN: What are your favorite examples of elegant software? by joshbochu on Monday May 02, 2022 @02:01PM (#31238548)
great example!