[(not really) Shower Thought] Remaking Hedgewars in Godot

8 replies [Last post]
KoBeWi
KoBeWi's picture
User offline. Last seen 1 week 1 day ago. Offline
Joined: 2010-12-25
Posts: 564

Sooo... I heard that there are plans for frontend and server rewrites and that for engine it's unlikely. Recently I said that I've been using a lot of Godot and I even made the LUA translation tool I posted and it's not unlikely that I will also make a Hedgewars Theme Editor 3 (this would be the final one). Seeing how Godot is cool and all, I thought that it could be also cool to actually remake Hedgewars in Godot.

Now, before I start argumenting this hopeless idea... In case someone doesn't know, Godot is a free and open-source MIT-licensed game engine. I've been using it really extensively and it didn't let me down enough to say a bad word about it. It's gaining a lots of popularity, especially this year, and is capable to compete with commercial engines out there, especially in 2D.

Back on Hedgewars topic, rewriting whole engine would be a huge task, but comes with lots of benefits. The biggest one is accessibility for contribution. Right now, Hedgewars has a shitload of dependencies and building on anything other than Linux is complete hell. I made some contributions myself, but I no longer have Linux, since I don't need it anymore and keeping a virtual machine for the sake of compiling one game is dumb. I tried building on Windows, but wasted few hours and met a dead end. Now if I ever wanted to contirbute again I'd have to go through this again and hope I succeed this time. Even if I do, that's just few hours of setup and trying.

This wouldn't be a case with Godot - you just download the project and open it in editor and it all works out-of-the-box, without compiling any additional stuff. This could bring more potential contributors, especially from Godot community which is really active and some interested people are bound to be out there. It would also be much easier to contribute, as you wouldn't need to touch code written in Pascal. Godot has its own language, and if that wouldn't be enough, the engine is easily extensible in C++ (I guess some parts of Hedgewars could need that).

I mean, Hedgewars code is terrible. I know devs are trying their best, but there's lots of stuff that just could be done simpler in higher-level language. Like, when I contributed my theme stuff, the theme.cfg parsing is just awkward. In my theme editors it was just few lines, because both Ruby and Java have string-processing methods. You work on actual strings, not some char arrays. There's lots of things like this that would just get much simpler and easier and all if they were done in any modern language, GDScript included.

Godot also comes with lots of own things that you'd normally need to implement. Shaders, 2D transforms, vector math, rendering, audio, controls... I guess a big part of Hedgewars code is just, well, engine code that does these sorts of stuff. Since Godot has most of it (if not all) built-in, you can save time implementing it, which makes making the game easier. Also, you can use physics. I know that devs are against physics, but I don't mean physics with rigidbodies and everything that happens when you overuse physics. I mean kinematic bodies that you have 100% control over, which provide very efficient collision detection. You can avoid all the weird behavior which usually comes with physics and just tell it to move and you get all collision data, like points and normals, for free.

Also, since Godot of course has it's own GUI, "engine" and frontend could be done using the same tools. That allows for greater integration between the two and doesn't require you to use two completely different tools to make basically two independent applications. Godot also supports easy-to-use translations with csv files. On a side note, it's also super-easy to export the game for Android and even browsers as HTML5. There's little work overhead to achieve this.

Overall, the list of benefits of remake is long (probably longer than that) and the game would be more maintainable. Also, using a game engine has an advantage that if you have a huge problem, instead of spending days trying to figure it out with libraries that no one uses, you can get help from engine's community. And if you share the game with community, more people will actually play it. Also, since engine is open-source, if anything goes wrong, you aren't dependent on its original creators.

I know it probably won't happen >.>
But might be interesting thing to consider, as it would potentially bring new life to the game. All things considered, it wouldn't take as much time as it took to get this far.

Wuzzy
Wuzzy's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2012-06-20
Posts: 1301

The problem with ideas with these is, this would set back progress by years and we would lose years of work, testing and debugging before we even got to 1.0.0.

Moreover, we would be unable to release for years (again) which would be just terrible. “Releasing 1.0.0” would move many years into the future. That alone is a huge no-go for me already.

Besides … So, we are basically replacing the server, the frontend and the engine now?
That's Hedgewars 2. Smile

IMO the highest priority for HW right now is 1.0.0.

Plus, the players don't care. They are waiting for a complete and stable (!) game. I think it is much more important to finish up Hedgewars 1.0.0 and hammer out all those bugs and make it as stable as ever.

Also, any move to [INSERT OVERHYPED TECHNOLOGY HERE] is a big risk as well. The promises might turn out to be not true. There is no guarantee the codebase will actually improve. There is no reason to believe that it will attract more contributors. What it does guarantee is that it slows down real progress (i.e. new features) a lot.

Hedgewars is basically feature-complete, so the coding work is mainly about bugfixing anyway. The interesting work on Hedgewars is now on artwork and building more singleplayer content. Not much has happened in this area lately.

Quote:
I mean, Hedgewars code is terrible.

Heh.

Maybe. But it also has seen years of usage. We know pretty well what bugs are still in there and which bugs have been fixed.

The fact is, Hedgewars works on quite a good number of computers. Players are actually playing this game.

Quote:
In my theme editors it was just few lines, because both Ruby and Java have string-processing methods.

I don't think just having a few ready-to-use string processing functions is not reason enough to switch. There might be a Pascal library for it, too. Nobody just bothered to check.

But yeah, this section of code needs a refactoring, agreed. Big Grin

Patches welcome. :P

Quote:
Also, since Godot of course has it's own GUI

Great, so we can kiss good-bye to frontend, too and have to start from scratch with that one, too.

Quote:
Godot also supports easy-to-use translations with csv files.

It's not Gettext or Qt, so that's a no-go. I generally want to avoid having obscure translation formats. Our translation system is a big mess, Godot would not make it any better.
I wanted HW to move to Gettext (at least partially) years ago. Still not done. Sad Smiley

Note: I think my fellow developers might have a bit of a different opinion of that subject.

Sidenote: unC0Rr proposed a redo of the engine as well. But not a rewrite. They want to change the programming language (to Rust, I believe). But this is planned to be done half-automated, so it's not like we are going to lose lots of working code. So I am not really opposed to that step anymore. Initially I was opposed, but my opinion changed when it was clear it's supposed to be more or less automated.

Relevant read:
https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/

Hi, I am a Hedgewars developer. Smile

KoBeWi
KoBeWi's picture
User offline. Last seen 1 week 1 day ago. Offline
Joined: 2010-12-25
Posts: 564

Wuzzy allegedly wrote:
Hedgewars is basically feature-complete
That's my biggest problem actually. There's lots of stuff I'd like to see in this game, but they probably won't make it in and I don't feel like fighting with the current engine to do it myself. There's also lots of things that could be done better. In Godot it would be just much easier to make it. I mean, it would take time to make engine from scratch (although less than it took so far), but then adding new features would be... less bothersome and straightforward. At least that what I think after having experience with both Hedgewars development and development in Godot.

Wuzzy allegedly wrote:
I don't think just having a few ready-to-use string processing functions is not reason enough to switch.
That was just an example. There's lots more of that and adding libraries that do it in Pascal would just bring more dependencies.

Wuzzy allegedly wrote:
Great, so we can kiss good-bye to frontend, too and have to start from scratch with that one, too.
Isn't that what the planned reword would do?

Wuzzy allegedly wrote:
It's not Gettext or Qt, so that's a no-go.
Well, using Gettext would definitely be possible too.

Quote:
Relevant read:
Irrelevant (XD). It's not only about rewrite, but also technology change for something more productive than dead language.

Wuzzy
Wuzzy's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2012-06-20
Posts: 1301

Quote:
There's lots of stuff I'd like to see in this game

Feel free to post feature requests. Smile

Also, “feature complete” does not mean there can't be room for more.

Quote:
I don't feel like fighting with the current engine to do it myself

That's fine.
But note that Pascal isn't difficult. Actually, I think it is one of the nicest programming languages.
I did not know how to code in Pascal at all before I got into Hedgewars. So I decided to learn it. Simple as that.

Hi, I am a Hedgewars developer. Smile

vint
vint's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2018-07-28
Posts: 31

I see here's tense discussion field about making something from scratch. I personally appretiate KoBeWi's point of making development process more straightforward because from long-term perspective it will pay off.

But why influencing exactly Hedgewars? There's already big band behind the scenes knowing how to handle those pesky bugs in their current codebase which was just defined by its community. Just let's go make another game with Godot once concept is finally ready! After all, Hedgewars isn't universal taste, and somebody will be wrong saying it didn't worth it. Wink Smiley (Oh wait, you are already rewriting one game for Godot as I seen in your Reddit post.)





Hello, I am author of Typewriter Hedgewars Lua library.
Will be happy to contribute in some HW campaign or mission!

Wink Smiley

KoBeWi
KoBeWi's picture
User offline. Last seen 1 week 1 day ago. Offline
Joined: 2010-12-25
Posts: 564

Wuzzy allegedly wrote:
But note that Pascal isn't difficult. Actually, I think it is one of the nicest programming languages.
I did not know how to code in Pascal at all before I got into Hedgewars. So I decided to learn it. Simple as that.
Well, I know like 10 different programming languages and I have to say that Pascal is my least favorite one, deep at the bottom of my preference list. It just totally puts me off.

But maybe I'm just biased, because I started with Ruby (which is best language ever) and out of 9 other languages I used, I could tolerate only Javascript. Any other language has lots of annoying quirks that just I can't stand long-term and Pascal with its syntax is the worst (weird semicolon rules and forward declaration are among stuff I don't like there). It's not about difficulty, but... usability probably.

(btw, if you count GDScript as programming language, then I like it too actually. It's like Python, but without Python's bs)

vint allegedly wrote:
(Oh wait, you are already rewriting one game for Godot as I seen in your Reddit post.)
Heh, this is for technical reasons mostly. At first I wanted to swap assets with minimal effort and sell it since the game was already popular (XD), but there were lots of problems with my previous "engine", so I decided to switch it and ultimately totally remake the game, leaving only the base concept.

vint
vint's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2018-07-28
Posts: 31

KoBeWi allegedly wrote:

But maybe I'm just biased, because I started with Ruby (which is best language ever) and out of 9 other languages I used, I could tolerate only Javascript. Any other language has lots of annoying quirks that just I can't stand long-term

I have to admit that JS is not without quirks also AFAIK. Well, maybe there are too much than in other languages actually. It gives several ways of truth (getting things to work, I mean), it lacks more definition in internals which makes it flexible, but what if an open developer doesn't recognize these? Right, he has to delegate the work to contributor that understands sugar syntax provided with build tools.
I find the analogy to Hedgewars behind it but with more languages that you need to learn to understand how to fix almost everything. Even then you obviously get in trouble of maintaining such code. And while there's no problem unsolved for people, they will work with the same codebase because it's the entire work of community.
I understand why devs are paranoid about immediately start (or ever do it some day) switching stack: as they note it's time-consuming and release terms block them. If someone special ever would create full-featured Hedgewars in Godot, it would shock. Like why not merge it after successful tests and code analysis? And as always it's the work for other team.

KoBeWi allegedly wrote:

(btw, if you count GDScript as programming language, then I like it too actually. It's like Python, but without Python's bs)

Thank you about referencing Godot. I was kinda struggling from choice between Unity's neat object model and other great features provided through full open source (like with Cocos, but that one didn't fit me), then you accidentelly pointed out the solution for me that gives both!





Hello, I am author of Typewriter Hedgewars Lua library.
Will be happy to contribute in some HW campaign or mission!

Wink Smiley

Wuzzy
Wuzzy's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2012-06-20
Posts: 1301

Well, we cannot just randomly switch programming languages whenever some contributors have a personal dislike. Then we would never get anything done.

Personally, I think wars over programming languages are generally pointless. I don't go to projects and keep whining about how bad their choice of programming language is. If I really care enough about a project, I just adapt instead of trying to change the entire project's workflow. That's a battle you will usually lose anyway, and it's rarely needed anyway.

Yes, there are always some minor things and quirks you can complain about, but if you know how to deal with the shortcomings, at the end of the day, it doesn't matter THAT much. Programming languages are tools and a good programmer knows how to use these tools well. I am not biasad towards or against Pascal, or Ruby, or Rust, whatever is hot right now; and neither should you.

I am really tired about discussions about how X is better than Y because the brackets are slightly different or the indentations are so clever. Most popular programming languages are fine. Except PHP. Big Grin

Hi, I am a Hedgewars developer. Smile

KoBeWi
KoBeWi's picture
User offline. Last seen 1 week 1 day ago. Offline
Joined: 2010-12-25
Posts: 564

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]