Hedgewars Theme Editor 3

17 replies [Last post]
KoBeWi
KoBeWi's picture
User offline. Last seen 1 day 19 min ago. Offline
Joined: 2010-12-25
Posts: 533

Hi, I'm KoBeWi and my hobby is creating theme editors for Hedgewars. This is the third one (4th if counting great refactoring in HWTE2) and 99.9% sure it will be the final one.

Why did this happen? I created previous editor to be more usable than the first one. It was packed with a load of features that really made it powerful. However, it had one big problem. It was written in Java. I chose Java, because I knew Java and it's cross-platform. But well, I hate Java XD Programming the editor was terrible, refactoring was terrible and maintenance would be terrible too probably. It was there, it worked, but luckily I didn't need to make any changes in the past year or so.

Then I discovered Godot. Ever since I started programming, Ruby have always been my favorite language ever <3. My first theme editor was written in Ruby. But while it is the best language ever <3, it has a flaw of having poor support for cross-platform and actually running in general anywhere outside your computer. Godot doesn't have this flaw + it's really friendly and has a rare trait of being not hated by me. I've been using it almost exclusively for making games for the last year (yes, I'm making games and I was doing it in Ruby before), then I did the LUA translation tool for Hedgewars. And since Godot proved itself even in GUI application, I decided I'd give it a try in making yet another theme editor. (maybe YATE should be the actual name? XD)

Anyways, after this long and useless introduction, here's a list of very important changes brought by this new editor:
-it will work natively on any platform, no need to install anything
-it's made with open-source in mind, with the MIT masterrace license
-supports Gettext for translation (Wuzzy right now)
-I'm going to edit the GUI theme to look like Hedgewars frontend

It also has a music player for testing music (something that was really hard to do in Java) and possibly will include a theme preview, which will generate test map to see the theme without running game (I might play with implementing some simple engine stuff, like hedgehogs walking and shooting, just for fun).

I'm not doing a rushed release now. Rather, it's a no-release (XD), because the editor isn't even finished. I just got it to usable state, enough to load theme and save it without breaking, but you can't edit anything yet and many features are unimplemented.

Here you can find a repo with code, where you can follow my progress: https://github.com/KoBeWi/Hedgewars-Theme-Editor-3

There's one test translation included, but it doesn't even contain all strings. I just made it to see how Gettext will work and well, Godot supports it natively (actually it's used for official engine translation).

To run the source, you'll need Godot 3.2, which you can get from the official site: https://godotengine.org/download

Also, a screenshot:

mikade
mikade's picture
User offline. Last seen 28 weeks 3 days ago. Offline
Joined: 2010-10-22
Posts: 355

Keep up the good work, KoBeWi. Smile
Looking forward to seeing further developments.

Out of interest, what kind of games are you working on? Do you have any screenies available?

mikade
Hedgewars Developer

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

mikade allegedly wrote:
Keep up the good work, KoBeWi.
Looking forward to seeing further developments.
Thanks :3

mikade allegedly wrote:
Out of interest, what kind of games are you working on? Do you have any screenies available?
I recently made a topic about my old projects: https://www.hedgewars.org/node/6963

As for new games, they are in early stage and no screenshots are available. But one of them is "remake" of Mariovania mentioned in above topic.

EDIT:
Back to HWTE3, seems like Godot doesn't support extracting translateable strings from project (or at least no one I asked was able to tell me how to achieve that), so I created a Ruby (<3) script, which generates .pot files and seems like it's working. So any potential translators will be able to easily translate the editor once it's finished.

UltiMaxKom
UltiMaxKom's picture
User offline. Last seen 40 weeks 6 days ago. Offline
Joined: 2016-06-26
Posts: 381

@KoBeWi
Me, before: Yay! New HWTE3 :OOOOOOOO SUPA-AWESOME! HWTE3 IS LOVE, KOBEWI IS LIFE! *All CAP mode*
Me, after: Damn, I've just read all the text in the OP, then found out that it's not released yet xD *killed by Ligma*
Also me: Let's reply to KoBeWi about this so he can finish the editor faster, in non-rush-style! *Kawaii, anime-style chuckle*
Me in C-137 dimension: How about PM? Email spam? Or multi-post so he can boost the thing? *evil laugh*
Everyone but me: stfu and just wait for it! Can't you have some patience?! *dank face activated*
Other KoBeWi in the parallel universe: Already finished HTWE3... *insert Lenny Face here*

Me, now: *watching PewDiePie killing memes, while laughing autistically*



Anyway, good luck KoBeWi!
I hope you can finish it perfectly! Like you always do ^^

╟───NW──────┼──────N╢

╓──────────────────╖ ╓──────────────────╖
⠀HP: ██████████ 1E9/1E91E9/1E9 ██████████ :MP
╙──────────────────╜ ╙──────────────────╜

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

So this just happened:

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

Release time, I guess.

The editor is usable. I mean, you can already change everything, it loads correctly, saves correctly, so you can make themes already. You can grab the binaries here: https://github.com/KoBeWi/Hedgewars-Theme-Editor-3/releases/tag/v0.7beta
(I can add a Mac binary if requested)

List of new stuff compared to previous editor:
-.po translation support. You can use .rb script from repo to generate .pot file (I'll hand out one here on "string freeze")
-theme version support (automatically reads and appends theme versions, see above image)
-auto-save now fires on value change instead of periodically
-music player (for previewing theme music, but also for listening music while making themes)
-indicator if theme has unsaved changes (* in window's title), in case you disable auto-save
-controls for theme variables get disabled when variable is disabled
-more tooltips
-setting for maximizing window on start
-other things I forgot

List of still missing things, most of which are planned for 1.0 or later:
-packing themes into hwp (right now it only creates folders)
-packing custom music with theme
-file watchers to refresh files (images etc.) on change
-warnings if some theme file/setting would cause a crash (would be cool if crashing the game was impossible actually...)
-old theme format support (it won't happen, but you can import old themes into the old editor)
-recreating Hedgewars frontend theme for the editor
-other things I marked as TODO in the code

List of implemented Hedgewars features, not counting ones from previous editor:
-"hidden" flag for themes
-Snow.png
-fallback music

List of yet unimplemented features:
-anchors
-overlays
-rq stuff (is it even needed?)
-sound customization

So that's it and probably even more. I might take another break from development now and in the meantime wait for unevitable bug reports. Since the project is on GitHub, if you have an account, I'd prefer if you filled an issue there. PRs are also welcome probably. You will need Godot 3.1 if you want to help.

Have fun with the editor or something >_>

Wuzzy
Wuzzy's picture
User offline. Last seen 1 day 21 hours ago. Offline
Joined: 2012-06-20
Posts: 1214

If only I knew how to build this!

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

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

I probably forgot to include a README.

Anyways, you don't need to build anything. Just download the source and run Godot inside the directory (with -e flag if you want to edit). Or just use the binary if you simply want to use the editor.

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


(obviously unfinished)

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

So I took some time to work on the editor again (hopefully stable release is coming this year). The Hedgewars-like theme is almost finished.

I also added a Readme with instructions how to run from the source.

Wuzzy
Wuzzy's picture
User offline. Last seen 1 day 21 hours ago. Offline
Joined: 2012-06-20
Posts: 1214

Nice. Smile

You seem to be REALLY into themes. Big Grin

So far, this looks like it just adds a bunch of controls to input the theme settings more easily. Basically just a more convenient way to input numbers and select files.

That's of course nice, but I think not really that big of an improvement over editing text files … I think I don't really feel compelled to use this program, It'll still be easier for me to do things manually.

The most tedious part of creating themes is not actually editing theme.conf itself, but by tweaking the numbers over and over again and restarting the game to check it (also in SD).

What would be REALLY useful would be preview panel, to preview a simplified version of the theme background (with animated flakes, clouds, water), also for SD. Doesn't need to be a 1:1 match, just for the general idea.

I recommend to add a list of features into the README.

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

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

Quote:
That's of course nice, but I think not really that big of an improvement over editing text files … I think I don't really feel compelled to use this program, It'll still be easier for me to do things manually.
Really? Even the land rectangles? With the editor, you can lay them out visually, so you can easily predict how will they behave. It's especially useful for complex objects.

Quote:
The most tedious part of creating themes is not actually editing theme.conf itself, but by tweaking the numbers over and over again and restarting the game to check it (also in SD).
Personally I don't think there's so much to tweak. Running the game takes few seconds, so it's not that much of a bother either.

Quote:
What would be REALLY useful would be preview panel, to preview a simplified version of the theme background (with animated flakes, clouds, water), also for SD.
That's a planned feature actually (I even mentioned it in the first post). Not sure where will it come though, might be after 1.0.

Quote:
You seem to be REALLY into themes.
Yeah, it actually started way way earlier back when I was playing Worms. I thought it would be cool to create my own themes and Hedgewars actually made it possible. I'm a bit busy with other things right now, but I still haven't completely given up on making more themes. It's fun.

Wuzzy
Wuzzy's picture
User offline. Last seen 1 day 21 hours ago. Offline
Joined: 2012-06-20
Posts: 1214

Quote:
Really? Even the land rectangles? With the editor, you can lay them out visually, so you can easily predict how will they behave. It's especially useful for complex objects.

Oops, right. I forgot about that feature.

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

Connorses
User offline. Last seen 4 weeks 2 days ago. Offline
Joined: 2020-07-18
Posts: 7

I've opened the editor and all sections are grayed out except Main. I can't click into them. Is there something I'm missing?

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

Quote:
I've opened the editor and all sections are grayed out except Main. I can't click into them. Is there something I'm missing?
Hey sorry for late reply, but you need to load a theme first. To do that you need to create a directory in your Themes Hedgewars user directory and add empty theme.cfg. I think I should add a button to create a theme...

Wuzzy
Wuzzy's picture
User offline. Last seen 1 day 21 hours ago. Offline
Joined: 2012-06-20
Posts: 1214

Hello. I think this theme editor seems to sometimes add fields in theme.cfg that are pointless because they just copy default values:

- water-animation and sd-water-animation when no water animation is used (in that case, just remove those fields)
- sd-music, fallback-music and fallback-sd-music are added when they are actually just the same as the defaults. sd-music MIGHT be excusable. But especially the fallback fields should NOT be added when they are identical to their non-fallback versions.

It's not really a bug, but a minor annoyance. I think a theme editor should always generate a clean theme.cfg.

Thank you for reading. :P

Besides, the Theme Editor currently crashes on startup anyway, so …

Console log:

ERROR: _load_data: Condition "!f" is true. Returned: ERR_CANT_OPEN
   At: scene/resources/texture.cpp:502.
ERROR: _load: Failed loading resource: res://.import/CheckboxOn.png-f490af681bbdb34e9322512881bba8fa.stex.
   At: core/io/resource_loader.cpp:278.
ERROR: _load: Failed loading resource: res://Images/Icons/CheckboxOn.png.
   At: core/io/resource_loader.cpp:278.
ERROR: poll: Can't load dependency: res://Images/Icons/CheckboxOn.png.
   At: core/io/resource_format_binary.cpp:655.
ERROR: load: Failed to load resource 'res://Resources/UITheme.theme'.
   At: core/io/resource_loader.cpp:208.
ERROR: _load: Failed loading resource: res://Resources/UITheme.theme.
   At: core/io/resource_loader.cpp:278.
ERROR: register_scene_types: Error loading custom theme 'res://Resources/UITheme.theme'
   At: scene/register_scene_types.cpp:767.
ERROR: _load_data: Condition "!f" is true. Returned: ERR_CANT_OPEN
   At: scene/resources/texture.cpp:502.
ERROR: _load: Failed loading resource: res://.import/Play.png-b3dd933e3d42657fd903c91b595b03d5.stex.
   At: core/io/resource_loader.cpp:278.
ERROR: _load: Failed loading resource: res://Images/Icons/Play.png.
   At: core/io/resource_loader.cpp:278.
ERROR: poll: res://Tabs/Theme.tscn:6 - Parse Error: [ext_resource] referenced nonexistent resource at: res://Images/Icons/Play.png
   At: scene/resources/resource_format_text.cpp:440.
ERROR: load: Failed to load resource 'res://Tabs/Theme.tscn'.
   At: core/io/resource_loader.cpp:208.
ERROR: _load: Failed loading resource: res://Tabs/Theme.tscn.
   At: core/io/resource_loader.cpp:278.
ERROR: poll: res://ThemeEditor.tscn:5 - Parse Error: [ext_resource] referenced nonexistent resource at: res://Tabs/Theme.tscn
   At: scene/resources/resource_format_text.cpp:440.
ERROR: load: Failed to load resource 'res://ThemeEditor.tscn'.
   At: core/io/resource_loader.cpp:208.
ERROR: _load: Failed loading resource: res://ThemeEditor.tscn.
   At: core/io/resource_loader.cpp:278.
ERROR: start: Failed loading scene: res://ThemeEditor.tscn
   At: main/main.cpp:1864.
ERROR: ~List: Condition "_first != __null" is true.
   At: ./core/self_list.h:112.
ERROR: ~List: Condition "_first != __null" is true.
   At: ./core/self_list.h:112.
WARNING: cleanup: ObjectDB Instances still exist!
   At: core/object.cpp:2071.
ERROR: clear: Resources Still in use at Exit!
   At: core/resource.cpp:476.

But then, my Godot might be outdated (3.2.1).

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

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

Quote:
Hello. I think this theme editor seems to sometimes add fields in theme.cfg that are pointless because they just copy default values:
Weird, because you need to enable a checkbox to have them saved. Similar with music, it's /none/ by default, which makes the value not saved. I can't reproduce this, unless it happened in an old version or something.

Quote:
Besides, the Theme Editor currently crashes on startup anyway, so …
Did you open it in the editor first? You need to open Godot editor, so it imports all images (the editor uses some custom icons), then you can run normally. I should probably mention it in the README.

Wuzzy
Wuzzy's picture
User offline. Last seen 1 day 21 hours ago. Offline
Joined: 2012-06-20
Posts: 1214

OK, forget my bug report then. I was wrong about this, it was a misunderstanding.
Thanks.

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

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