News for hackers. Stuff that matters.
Re:I still use Flash in 2022 by dontwearitout on Wednesday December 21, 2022 @09:51AM (#34081402)
Flash was my 2nd programming language (after VB6) back when it was still Macromedia. I had a lot of fun making really crappy minigames and learning the basics of coding. This article brought some good nostalgia and plenty of astonishment at the lengths you went to.

Your writing itself is great. A lot of writing linked by HN seems too verbose because people try to sound smart. Yours is succinct while engaging. Right length, just technical enough, and interesting. I really enjoyed this, thanks for writing it!

Also:

> Object-orientation is not fashionable right now in gamedev circles

Can you elaborate on this?

Re:I still use Flash in 2022 by BlueTemplar on Wednesday December 21, 2022 @10:44AM (#34082130)
Probably how OO teachers and mentors failed horribly (AFAIK we still don't warn new students about the pitfalls of inheritance ?), so ECS got popular as a better alternative to shitty OOP code ?

https://www.gamedev.net/blogs/entry/2265481-oop-is-dead-long...

Re:I still use Flash in 2022 by stelonix on Wednesday December 21, 2022 @12:04PM (#34083283)
Not only that, but due to CPU caches and memory alignment issues, ECS have better performance than inheritance; also because most ECS systems ditch virtual function calls.
Re:I still use Flash in 2022 by cogman10 on Wednesday December 21, 2022 @04:20PM (#34086552)
> ECS have better performance than inheritance

Can have.

Whether or not an ECS will actually be faster depends entirely on the type of game and access patterns of the inheritance structure. Further, it matters how you are doing inheritance (LTO can eliminate a lot of the pitfalls even if you use virtual function calls).

This is nothing against ECS. I just find the current claims of performance dubious and potentially flat out wrong given modern compiler optimizations and changes in CPU caches (mainly that they got a LOT bigger).

Re:I still use Flash in 2022 by stelonix on Tuesday December 27, 2022 @09:37AM (#34149014)
I believe claims of "compilers getting faster/bigger enough" are the exact reason we have ECS now. It surely depends of the kind of game, but games with any kind of entity which isn't unique should feel the performance improvements.

Ideally, compilers should be able to transform classes into ECS layout when generating code. Shouldn't be hard to have a pass before compilation, if we use clang.

Re:I still use Flash in 2022 by japhib on Wednesday December 21, 2022 @01:05PM (#34084136)
Object-orientation is kind of the old-school way of doing things, these days it's all about ECS - entity component system. This is a more data-oriented approach that has the potential for much higher performance when you have thousands of objects that need updating in your game. It's similar to how OO languages like Java/C# are going out of style and more (nominally, at least) data-oriented languages such as Go or Rust are in style.
Re:I still use Flash in 2022 by pjmlp on Thursday December 22, 2022 @04:06AM (#34091306)
Unity isn't going anywhere, and programming to interfaces is just as doable in Java and C#.
Re:I still use Flash in 2022 by whostolemyhat on Thursday December 22, 2022 @05:17AM (#34091851)
Unity's been working on an ECS option for a while now
Re:I still use Flash in 2022 by pjmlp on Thursday December 22, 2022 @06:24AM (#34092283)
Written in C#.
Re:I still use Flash in 2022 by lewispollard on Thursday December 22, 2022 @07:56AM (#34092795)
Yeah, "OO is going out of fashion" is a common phrase in gamedev, but what's actually meant is "deep class hierarchies defining the behaviour of game objects is going out of fashion". Most ECS code is still written in OO languages and makes heavy use of OO features.
Re:I still use Flash in 2022 by throwaway2037 on Thursday December 22, 2022 @10:22AM (#34094190)
Is ECS similar to Data Oriented Programming?

I watched this talk years ago: CppCon 2014: Mike Acton "Data-Oriented Design and C++"

I was very impressed by the ideas presented.

Java/C# can be used to write a program with "just a bunch of structs + static methods". Isn't that data-oriented enough? Ya, I know we can do 72 levels of inheritance also... for ignore that for a moment.