Live data from Hacker News

Core: an experimental new way to write videogames

github.com

131–140 of 224 posts

Re: Core: an experimental new way to write videogames

#131
post #26

Earlier quoted context omitted.

After doing functional programming for a while now (6 years of Elixir) it seems obvious to me that it is possible and no more complex than using imperative logic. In fact I would go so far as to say that managing complexity (i.e. state) is much easier to do in a functional style than imperative. Functional is all about transformation of data structures, and a game is nothing more than a function that takes {state, mo…

Could an expert strong man the argument that functional programming languages like Haskell could in theory be more performant than C because of the nice properties of pure functional languages?

Only in some very specific situations, which amount to an arbitrarily smart compiler and arbitrarily dumb C code. Haskell does provide more opportunities for the code to not do something you tell it do because it can prove you don't use the result, but it is a dumb programmer who is writing code to do those unneeded calculations, and thus a good programmer would eliminate them from C.

A lot of effort has gone into optimizing C compilers, Haskell is easier to optimize in theory, but in practice it isn't enough easier as to overcome the massively larger amount of effort put in C.

In the best case for both the code will be roughly the same speed. However the best case for both can look very different and any comparison is suspect as it is likely that whoever wrote the code wasn't as good at one as the other and so wrote bad code.

Re: Core: an experimental new way to write videogames

#132
post #26

Earlier quoted context omitted.

After doing functional programming for a while now (6 years of Elixir) it seems obvious to me that it is possible and no more complex than using imperative logic. In fact I would go so far as to say that managing complexity (i.e. state) is much easier to do in a functional style than imperative. Functional is all about transformation of data structures, and a game is nothing more than a function that takes {state, mo…

Coming from clojure I'm very wary of any non-mainstream languages like Elixir, Rust, Clojure etc. It's a costly business mistake to build your tech stack using any of the above languages. The trade off simply is not significant enough to matter vs using mainstream languages with 10,000x the number of mindshare.

The cost is not paid today, but in the future when whatever you choose is no longer supported. If you write in something like C++ or Java running on Linux or Windows I'm confident that in 20 years you will find a tool that can build your code for the latest computers (not just the compiler, but the other tools as well). Of course Python 2 is a perfect example of why even the highest confidence choices may be wrong.

Rust is starting to look like it will make the jump to likely to be around for the foreseeable future, but only time will tell.

Of course just because you can build it doesn't mean it will work. I know of an embedded system where the 16 bit CPU went obsolete and they discovered that the C code was not 32 bit safe and worse it relied on the timing of the one CPU it was written for (though not so bad as to have to turn off compiler optimizations). I know of a product written for X11 that is porting to wayland. Keeping code running for decades is a hard problem - and one that many fail to understand. (nor do they need to - the web site you do today will need a major rewrite to fit the latest UI fad no matter what you do)

Re: Core: an experimental new way to write videogames

#133

Earlier quoted context omitted.

It is completely possible and has interesting trade-offs. Here are some of my favorite blog entries related to functional game development: https://prog21.dadgum.com/228.html https://prog21.dadgum.com/23.html https://prog21.dadgum.com/24.html https://prog21.dadgum.com/25.html https://prog21.dadgum.com/26.html

the biggest tradeoff is talent pool you won't be able to find them in enough numbers and it would be tough to gauge their proficiency too unless you are purely interested in it for academic purposes, its best to avoid clojure and any sort of esoteric languages. Even Rust development is riddled with false roads and mirages. i just want to save anyone reading this 5 years of their time. You don't get better when you ar…

I can teach any developer Rust or Clojure in a couple weeks. I've only done a few hours of Rust study myself, and just minutes in Clojure and yet I will say that with confidence. It takes years to master, but the difference between 1 month and 10 years for an otherwise experienced programmer is not very large - either way the hard part is the problem domain, understanding your code, and other such details not related to the language. HR puts far too high a weight on skills in a programming language, in part because they are easy to measure while the ability to write good code is hard to measure.

Re: Core: an experimental new way to write videogames

#134
post #53

Earlier quoted context omitted.

Have you considered googling "clojure X", where X is each of those things in commas? Other than datomics which has some result pollution everything else has great first page results.

I did, found the clojure docs. Now I'm even more confused. What is so special about clojure vectors - as opposed to a python list, or C array? Some uses in the example seem like a better match to python dict, a C array of structs (linked list of structs?), perhaps a C++ std::map. Depending on what your goal is I know of dozens of different data structures and algorithms (they are part of the basic things a CS major c…

The key idea behind Clojure data structures is that they are immutable, but don't require a full copy on update, because an updated version partly reuses the initial version. The data structure that enables this is called HAMT (hash array mapped trie). Clojure's implementation modified the initial Phil Bagwell's implementation of HAMT in a subtle way in order to make performance characteristics not degrade over time.

Re: Core: an experimental new way to write videogames

#135
post #29

It says game development can be made simple and then throws a whole of jargon at you: clojure vectors, datomics, atoms, transactions, malli schemas... Can someone explain?

Copy edited their blurb:

Core is an experimental tool that simplifies the process of creating Action Role-Playing Games (Action-RPGs) by providing a unified set of tools and a streamlined approach to game development. It represents game elements (entities) and their properties (components) as simple data structures, allowing for greater flexibility and easier modification. The entire game state is stored in a single container (app/state), making it easier to manage and update the game's data. Core also provides a graphical user interface (GUI) for editing game content stored in a single file (resources/properties.edn), making the development process more accessible to non-programmers. By using Malli schemas for data validation, Core ensures that the game content is consistent and error-free, reducing development time and improving the overall quality of the game.

Re: Core: an experimental new way to write videogames

#136
post #78

Earlier quoted context omitted.

As a professional game dev who has years of experience producing real products in both Unity and Godot, I am totally not with you about your thoughts on Godot vs unity. Godots signals are such a huge step up over Unity's built in classes having a lack of modularity. How do you even make sense of that? Godot vs Unity basically have the same scene/node/component model except Godot does it better imo. Eg) What is the di…

GDScript sucks big time, it's not even close to C#. They should drop that Python like language and go full in C# integration.

What "sucks" about it? Since they added type checking it's been perfectly fine, besides the notable omission of nullable types (which is... a strange omission, to be sure).

Re: Core: an experimental new way to write videogames

#137
post #29

It says game development can be made simple and then throws a whole of jargon at you: clojure vectors, datomics, atoms, transactions, malli schemas... Can someone explain?

Clojure the language has a built-in state management model, which this project attempts to apply to game development. The best way to learn about this model IMO is to watch the talk 'Are we there yet' by Rich Hickey (author of Clojure).

Re: Core: an experimental new way to write videogames

#138
post #91

Oooh, this is cool. I always like to see different approaches to game dev (despite never having published a game!). So far I've tried - Bevy (Rust ECS engine), which is nice at first but has a lot of problems with its implementation and can become rather messy. I think it's heavily dependent on the game. Part of it will be my own incompetence. - Unity. IMO the system of gameobjects with composed modular components is…

I recently learned that the popular game Balatro was made in LÖVE. I had never heard of it until then. But looks interesting. https://love2d.org

Loved that I could open up balatros game files and examine the source. Pretty cool how far the author took the framework.

Re: Core: an experimental new way to write videogames

#139

As a game dev, this GitHub is comical to me. Bordering on parody of the kind of academic navel gazing that game devs stick their nose up at. Cherry on top is the ugly screenshot.

The screenshot is not "ugly", but I agree that the README is functionally useless -- no documentation, no examples, no indication of why I'd want to use this. Fails on a fundamental level to communicate what it's about.

Re: Core: an experimental new way to write videogames

#140
post #100

Earlier quoted context omitted.

I wish that was true. I just started rewriting my project from C# to GDScript today so it can run on 32 bit ARM android devices. Let's say I'm not a big fan of the language. Why the hell they decided to not implement normal for loops, was just googling how to iterate an array backwards and most people were like "just invert the array and iterate over it, bro" They should have just used Typescript, it's a sweet spot b…

The docs have an example of iterating an array backwards: https://docs.godotengine.org/en/stable/classes/class_@gdscri... var array = [3, 6, 9] for i in range(array.size() - 1, -1, -1): print(array[i]) Admittedly not very pretty but it certainly works.

After reading several posts above yours describing the level of effort and pain trying to use this scripting language and how multiple people in this thread avoid trying to use it as much as they can, then reading your small code sample, it's hard to not describe as a level of perception whiplash.

"why god why can't they just have for loops!?!?" and the problem was just ... knowing how to foreach over a range correctly? the idiom and language syntactical preference that python, a language older than java, has done for decades...?

Really trivializes every complaint and the assumed skill level of every person that I see in this thread complaining about gdscript to the absolute lowest level. Thanks for the post!

Post reply on HN