Live data from Hacker News

Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

gist.github.com

61–70 of 83 posts

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#61
post #43

Earlier quoted context omitted.

> The elephant in the room, Unity, cross compiles the C# to C++ which makes this blanket statement about all games even more confusing to me. As a game developer you do not have access to Unity's C++ code so to maintain some performance Unity needs to do that. But this is not the case with Godot or even Unreal where any intensive code should be written (or at least, rewritten) in C++ and use the scripts only to drive…

This seems inaccurate. You can certainly write C++ for Unity. People usually don't. Its a pain and C# performance is good. IL2CPP allows the compiler to optimize across game and engine code so its rare to write C++ plugins. Unreal also supports generating C++ from blueprints. But saying 'oh you shouldn't use the nice language anyway' is just making excuses. Obviously they're meant to be used to call engine code.

It's such a bizarro world after a bunch of UE discussions to suddenly see people dismiss scripting concerns with "well just write that code in C++. Blueprints is slow". I'm usually the one saying that, but that's as a professional developer who needs to optimize all that stuff (and TBH the blueprint code tends to have some bad performance choices even before discussing the BP perf loss).

Hearing people dismiss the performance of something as basic as a raycast with "well just code in C++", while many people (including this founder) say that Godot focuses on simplicity sounds counter-intuitive. So is GDScript a lie for anything slightly intensive (and again, raycast. I'm using "intense" in the loosest of words) and I should simply make my whole game an engine module? But I keep hearing that "I should just try GDScript it's really easy and you come around to it!"

Feels like a motte and bailey.

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#62
The killer feature of whatever game engine replaces Unity in developers' hearts and minds is going to be the platform delivery aspect.

Once you can press a button and get Win/Mac/Linux/Android/iOS/etc versions of your game built, you're in business.

All the higher-level features (3D, ray casting, etc) will be contributed by the community over time.

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#63
post #58

Earlier quoted context omitted.

It's possible that they are building a game in which players can program bots that only know the state of the world by performing raycasts, as if it were a sensor of sorts. That would be a valid reason to require such an amount of raycasts per bot - although I probably would not run them every frame, but rather spread the load throughout multiple frames.

Yes exactly. But the projectiles are moving every tick, so the evading logic wants to run every tick as well. But optimizing that will be up to the player..

I’d recommend cheating! It only has to appear to the user that the bot is scanning the world. For example in this specific case you could find all the projectiles close enough to the bot to be detected and do one raycast per projectile to determine visibility. This is functionally the same result as many dense raycasts but at a fraction of the computational cost because you have all the information already in the simulation.

Although I really like the idea of giving the player control over how the bot raycasts and letting them optimise that. Lots of fun strategies to find there! I’d even bound it so they can’t afford to do too many raycasts so they have to get creative.

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#64
post #19

Somehow, I feel like reading that article diminished the original critique, however, inefficient raycasts aren't some sort of pathological edge case. Raycasts are the most commonly used spatial queries in a 3d game. Hopefully this discussion will lead towards this issue being resolved. I actually found Sam Pruden's complaint a bit odd since it sounds like he's developing a 2d game. If you're spamming 1000s of raycast…

If you’re doing thousands of raycasts per frame in any game, 2D or 3D, then something has gone wrong. Raycasts are very general, and there is often a more specialized way to get the same information that won’t require as much work.

I learned to code in the 8-bit days where you'd count to 1000 in a BASIC for loop to create a significant delay. I guess I've not got out of the mindset that doing anything 1000x is quite a lot (particularly when you're aiming to do it 60 or more times per second).

But as somebody working in Unity (and often on mobile), there's still many cases where 1000 of something is a lot, and should perhaps be cause to rethink your approach. For example 1000 draw calls, 1000 UI elements, 1000 instances of even the most simple prefab.

1000 raycasts per frame is also something that I'd try to avoid. But if they seemed important, you've just got to try it and profile it. Nobody can answer 'what is the cost of 1000 raycasts?' without a fair bit more information.

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#65
>Additionally, modern processors all have at minimum 64 bit buses, so exposing anything other than 64 bit scalar types makes no sense.

I believe the issue was less with the sizes of items being passed in and more with the API conforming to work with GDScript first and formost. Returning a dictionary for an operation that has a few float64's feels overkill and doesn't make sense even with an explanation of the available datatypes.

>Only a pathological use case is shown, the rest of the API is fine.

I wouldn't call raycasting in a full blown engine "pathological". Especially one that touts 3D

Secondly, that doesn't inspire confidence. "Don't mind the room on fire, the rest of the house is fine!". The onus is on the engine to prove that, and numbers prevail over words. So far only one part of the conversation has shown that.

Even in the next sentence it sounds like they focus on a simple API over performance, and that doesn't fill me with confidence. If Godot isn't focusing on 3D, that is fine but there's so much noise trying to to say otherwise

> Eventually, C# will be moved to the universal extension system and this will allow the unifying of the default and .net editors, it is just not the case yet, but its top in the list of priorities

I hope so, but there seems to be a trend of various "top priorities" from Godot that have trouble crossing the finish line. That's a reocurring issue even in this response alone: I'm not convinced that performance is a top priority for Godot. And that confidence means everything if the "BDFL" controls what gets into the project proper.

>The problem is that, at the C++ level, this function takes a struct pointer for performance. But at the language binding API this is difficult to expose properly. This is very old code (dating to the opensourcing of Godot) and a Dictionary was hacked-in to use temporarily until something better is found

Yup... so 10 years later that hack stays in and modern programmers come cross it.

This isn't even a critique, that's simply the nature of legacy code. Unreal has an entire part of a forced namimg scheme (the compiler won't let you run the game without conforming) that can only be explained as "well we wanted to do this in the 90's but we slowly took it out sp it's not relevant today". But if it took 10 years for someone to do more than a few dozen raycasts a frame, it says more about the battletesting than any deep dive. It goes back to my confidence above.

>, you need to create a C# version of a C++ instance as an adapter... Why is it troublesome? because C# has a garbage collector and C++ does not.

slight nitpick: while garbage collection is annoying, you technically do have a built in way to disable it in certain regions, as well as the option in later versions to have unmanaged blocks of code. I'm not saying this is easy to do, but it is something that developers much smarter than me in c# have gotten around. I know c# bindings was a relatively recent endeavor so I'm not going to give it too much flak

> Godot containers don't work like STL containers. Because they are used mainly to pass data around, they are allocated once and then kept via reference counting.

1) reference counting implies some sort of automated memory free-ing scheme. 2) That doesn't necessarily address potential issues of inefficiently allocating memory and keeping it contiguous. But I won't talk much on that because I'd need to first read more on the engine's memory allocating schemes first.

> Godot uses far more optimized containers that are not directly exposed to the binder API.

Okay, but why? Someone wanting to use C# or c++ or whatever script extension that isn't GDScript wants those optimized containers. Does it go back to the earlier quote of "it's difficult to get right and no one wanted it"?

>As a result, we created a special path for GDScript to call more efficiently.

okay, and the link is... an open issue on Github made 2 months ago, with no additional comments or discussions. Simply a request from a code owner.

I don't know if this conversation is simply happening in IRC/chat, but it's unusual given how much other activity I have seen in other PR's/proposals (recent and from years prior). Was this the best reassurance that they are addressing performance?

---------

I don't mean to sound like a downer, but I feel the article is overall missing the forest for the trees. I've read about several different kinds of devs from years prior talk about how they passed on Godot because they hit hitch after hitch once they were doing something slightly advanced. a dismissal of "this is a pathological use case" sounds fine in a vacuum, but it sounds like this has been a long standing issue, and priorities simply weren't on smoothing out such hitches.

I'm not saying they should have listened to those devs, but I think the most frustrating thing is that I don't know what or who Godot wants to service. So far it sounds like they want to have all the cake, but currently are also low-key fine being a hobbyist 2D engine that can maybe do some simple 3D stuff. Which again, is fine. But that's not what it sounds like Godot is selling. It unfortunately reminds me a lot of Unity, both on the outside (yeah, having 2 unsupported netcode solutions with a 3rd in pre-alpha isn't a good look) and within the company itself. I'll quote some part of a post from the creator of Rimworld, who had similar evaluation and conclusions over 5 years ago:

>There's obviously a tremendous amount of technical talent going into Godot, but from what I can tell there's no strategic thought about market positioning or success pathways or goal pillars at all. It basically comes down to "make a good game engine", with all the lack of boundaries and lack of focus that implies.

>My initial thought: Be best at one valuable thing first, then expand out from there into adjacent domains, using the momentum accrued from the initial success. (e.g. If you want to build a restaurant empire, you start with one restaurant to dominate one neighborhood and then expand from there - you don't try to build 100 restaurants at once).

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#66
post #25
post #9

Strong response. I'm not sure I would have been so generous to the author of the article this is in reply to. But I suppose that's a skill of a successful open source leader -- to turn interactions with critics into productive discussions rather than arguments, and perhaps even turn the critics into supporters. It seems to have been that author who chose the FUD-ful title "Godot is not the new Unity". I guess there a…

Common now, the original article is perfectly reasonable one, and that includes its title as well. For the past few days everyone is talking about Unity, and I don't think it's exaggeration to say that Godot has become the de facto alternative in low to mid level game development. Godot itself will (if not already is) benefit from that status a lot. Article that brings highlights parts well Godot is lacking compared…

Agree 100%. The conversations sparked from this article are how the project improves. The maintainers seem very appreciative of it.

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#67

Earlier quoted context omitted.

(Roughly, glossing over ‘linear in what?’) Good bfs gets close to linear, good raycasting should be way, way sublinear

"Good raycasting should be sublinear" yes, but some folks like to stick 100 raycasts on every character which will kill the performance regardless of what engine your making your game in.

We now have games which rely on shooting millions of rays per frame for rendering.

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#68

Earlier quoted context omitted.

Yes exactly. But the projectiles are moving every tick, so the evading logic wants to run every tick as well. But optimizing that will be up to the player..

I’d recommend cheating! It only has to appear to the user that the bot is scanning the world. For example in this specific case you could find all the projectiles close enough to the bot to be detected and do one raycast per projectile to determine visibility. This is functionally the same result as many dense raycasts but at a fraction of the computational cost because you have all the information already in the sim…

> Although I really like the idea of giving the player control over how the bot raycasts and letting them optimise that. Lots of fun strategies to find there! I’d even bound it so they can’t afford to do too many raycasts so they have to get creative.

This is actually exactly what I did when I built a similar game about a decade ago! Bots had a budget of 20 raycasts per second, which would slowly replenish. It was the bot programmer's responsibility to figure out the best way to use them. It was a lot of fun! :)

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#69

Earlier quoted context omitted.

Wait. that doesn't sound like you're doing 1000s of raycasts? Just a few, maybe a dozen? also, sounds like you're using JS, not Godot?

Well, I would like to be able to do 1000s of raycast per frame (360 for each bot), but cannot and yes, I do not use godot, but my own engine (with pixijs for graphics and a emscriptem port of box2d for physics https://github.com/Birch-san/box2d-wasm .) Godot uses box2d, too, so that would be convenient, if I switch to godot, but only if it is worth the performance improvement, which it currently does not seem to be.…

Wait. I was thinking 1000s of objects doing raycasts.

Re: Article reply “Godot is not the new Unity” from Juan Linietsky (BDFL of Godot)

#70
post #19

Earlier quoted context omitted.

If you’re doing thousands of raycasts per frame in any game, 2D or 3D, then something has gone wrong. Raycasts are very general, and there is often a more specialized way to get the same information that won’t require as much work.

Maybe there's thousands of guns being fired.

Ok, if you’ve got thousands of players in the game then you’re doing _something_ right, even if the raycasts aren’t helping :)
Post reply on HN