Live data from Hacker News

What's new in C# for Godot 4.0

godotengine.org

71–80 of 112 posts

Re: What's new in C# for Godot 4.0

#71

It’s surprising to me that javascript wasn’t chosen as the scripting language for all these gaming engines. Though I do see the benefit of C# being typed and compiled.

Unity used to have a JS interface, where one could either write their game object components in JS or C#. They deprecated the JS interface. I imagine it was too much work to support two languages? As a dev reading docs, I used to have to deconflict the parts of the docs talking about JS from C# (not difficult as an experienced dev -- I wonder how the first timers fared). I'd also have to translate advice from JS Unit…

UnityScript wasn't actually JavaScript, but a custom .NET language with a JS-like syntax, largely incompatible of course. Naturally people wanted to use C# instead.

Re: What's new in C# for Godot 4.0

#72

Any godot programmers here. How is godot's support of games in the browser? 4 years ago I was deciding on a game engine to use. I considered it to unreal, Unity, and godot. I want to be able to build games that can be played on the web. I have many fond memories of the Flash game days. Distributing games over the web allows me to share games with people without the friction of installers, or App Store gate keepers, w…

The binaries produced just for the engine itself (so exluding the game code and assets) is already several MB large when compressed with brotly or gzip [1]. So it works, but it's too large to be competitive enough on web games portals. Most players will just go play another game if it takes too long to load (download). Only JS based game engines and to some extend Defold are good enough in this regard.

[1] https://github.com/godotengine/godot/issues/68647

Re: What's new in C# for Godot 4.0

#73
post #57

Earlier quoted context omitted.

I would imagine operator overloading helps with vectors so you can do things like: public static Vector operator -(Vector a, Vector b) { Vector v = new Vector(); v.X = a.X - b.X; v.Y = a.Y - b.Y; return v; } So then you can just write: Vector result = myVector1 - myVector2;

Also if you wrote the JS equivalent of that, each vector would be 3-4 individually heap-allocated doubles in v8, because they aren't able to allocate floating-point values inline. There would also be a new heap allocation for the result vector itself when performing each operation. The overhead really adds up. :/ At one point Mozilla had a prototype implementation of strongly-typed value types in JavaScript, but it f…

You can use an array to keep the doubles together. V8 has something like half a dozen different array types, depending on what is inside and how it's used.

Re: What's new in C# for Godot 4.0

#74
post #34

Earlier quoted context omitted.

It has been excellent, best browser game engine imo - however as of Godot 4, the web export is completely broken, unfortunately. Godot with C# straight up has no web export and no mobile export atm, just desktop.

> best browser game engine > web export is completely broken > Godot with C# straight up has no web export Hmm, something is amiss here... They're already on RC5 and web export not working doesn't sound like the web platform is a focus of theirs. AFAIK, the web export being broken is not mentioned in "Known Issues" about V4 either.

Web Export for 4 is fine, just not with C#. That may be the same thing to some people, but there is a distinction.

Re: What's new in C# for Godot 4.0

#75
post #34

Earlier quoted context omitted.

It has been excellent, best browser game engine imo - however as of Godot 4, the web export is completely broken, unfortunately. Godot with C# straight up has no web export and no mobile export atm, just desktop.

> best browser game engine > web export is completely broken > Godot with C# straight up has no web export Hmm, something is amiss here... They're already on RC5 and web export not working doesn't sound like the web platform is a focus of theirs. AFAIK, the web export being broken is not mentioned in "Known Issues" about V4 either.

> AFAIK, the web export being broken is not mentioned in "Known Issues" about V4 either.

It may be outdated since the reason it no longer works is because of these C# changes, as mentioned in the article.

Re: What's new in C# for Godot 4.0

#76
post #69
post #59

Earlier quoted context omitted.

Does anyone actually play games in the browser? I mean, there is no technical reason not to, but I kinda find it strange.

Sorry if my question was worded badly. Obviously, some people are playing games in the browser - perhaps I should have asked more specifically what the appeal is, e.g. is it mostly small casual games like what Flash used to be used for, or do people actually play more invested games? And sorry again if the answer to these questions is so obvious to some of you that the question itself sounds dumb, but I'm simply not…

Running games in the browser provides a bit of convenience of not having to download and run a platform-specific executable. There might be some security benefits too.

Depends on the nature of the game though. It works best for games that are lightweight and stateless.

Re: What's new in C# for Godot 4.0

#77
post #31
post #5

Earlier quoted context omitted.

Unity is still using Mono? The CoreCLR should easily perform twice as good as Mono in many cases.

They use their own heavily optimized Mono runtime that is .Net Standard 2.1 compliant and supports all C# 8 and many C# 9 features. As a C#/.Net developer I'm satisfied with the C# and .Net support in Unity. The pain points are elsewhere. https://docs.unity3d.com/Manual/dotnetProfileSupport.html https://docs.unity3d.com/Manual/CSharpCompiler.html

As a developer on one of larger Unity games - yes, there are paint points elsewhere. There are many pain points. The poor performance of Mono/IL2CPP is a significant one for us. We have a different game built on .NET (Core) and performance is significantly better.

I also wouldn't call Unity's Mono 'heavily optimized' because they definitely trail behind standard Mono. Unity doesn't even support Mono's generational garbage collector but it has been the default in Mono since 2016.

Re: What's new in C# for Godot 4.0

#78
post #69
post #59

Earlier quoted context omitted.

Does anyone actually play games in the browser? I mean, there is no technical reason not to, but I kinda find it strange.

Sorry if my question was worded badly. Obviously, some people are playing games in the browser - perhaps I should have asked more specifically what the appeal is, e.g. is it mostly small casual games like what Flash used to be used for, or do people actually play more invested games? And sorry again if the answer to these questions is so obvious to some of you that the question itself sounds dumb, but I'm simply not…

Browser based games are huge (often with kids). A lot of of popular games cluster on .io domain names. Shell Shockers has been a big FPS:

https://shellshock.io/

And there is a whole genre of multiplayer things eating things to get bigger:

https://agar.io/

http://slither.io/

Re: What's new in C# for Godot 4.0

#79

It’s surprising to me that javascript wasn’t chosen as the scripting language for all these gaming engines. Though I do see the benefit of C# being typed and compiled.

It's mostly a historical accident, like Python ending up as the data science language. Microsoft XNA used to be a popular indie game framework that used C#. Stardew Valley, Celeste and Terraria run on XNA. Mono used C#. Xamarin used Mono to create a cross-platform application framework that worked on mobile. Unity leveraged Xamarin to create a cross-platform game engine that worked on mobile, ending up using C#. Thus…

I don't see this at all. game devs on average want to be closer to the hardware and JS is even farther from it than c# (and c# has added more ways to do things like traditional pointers when you need to squeeze even more performance out). Lua you can certainly make an argument for because LuaJIT is insanely fast.

Re: What's new in C# for Godot 4.0

#80
post #72

Any godot programmers here. How is godot's support of games in the browser? 4 years ago I was deciding on a game engine to use. I considered it to unreal, Unity, and godot. I want to be able to build games that can be played on the web. I have many fond memories of the Flash game days. Distributing games over the web allows me to share games with people without the friction of installers, or App Store gate keepers, w…

The binaries produced just for the engine itself (so exluding the game code and assets) is already several MB large when compressed with brotly or gzip [1]. So it works, but it's too large to be competitive enough on web games portals. Most players will just go play another game if it takes too long to load (download). Only JS based game engines and to some extend Defold are good enough in this regard. [1] https://gi…

Note that the article mentions ahead-of-time compilation and binary size trimming as one of the explicit goals of this version.
Post reply on HN