BehindTheHedge: HedgeEditor


:D
Hey, hogs! I thought I'd update you with something I think is finally functional enough to be included in the upcoming .22 release. If you can bear my terrible, raspy voice and strange accent, check it out!

Otherwise, if words are more your thing, feel free to go read the wiki article I've started to work on here -> HedgeEditor.

YOUR VOICE IS REVEALED!!!

Oh, yea, your game sound is louder than your microphone, watch out with that.

Nice video Big Grin

Hm, note to self: fix cursor bleeding

In my general quest to rid the world of redundant jquery...
http://m8y.org/hw/GameLogExtractor.html this one does not require the extra lib bloat just to look up IDs and fetch a file ☺

http://youmightnotneedjquery.com/

I also reenabled a button that seemed useful and had been disabled.
Given this is running locally and cheaply, could possibly even just keep polling for log and updating the text areas if the file changes.

nemo allegedly wrote:

In my general quest to rid the world of redundant jquery...
http://m8y.org/hw/GameLogExtractor.html this one does not require the extra lib bloat just to look up IDs and fetch a file ☺

Thanks. I updated the wiki to point to the file on your server, though it would be nice if we could get it hosted on hedgewars.org.

I have made some tests with this script.

First, some bugs:

  • FIXED: Sprite placement is mostly broken. For most sprites I get Lua error messages (I can recall nemo told me that PlaceSprite can NOT place all sprites, I have written down more in the dev wiki about this.)
  • FIXED: You can "place" girders out of map bounds. Well, not really, they don't appear in the map but in the generated code I see sprite spawning with negative coordinates
  • Some weapon icons in weapon crate placement mode are incorrect. Air attack, for example.
  • Script seems to hang sometimes if your hedgehog dies (sorry, I can't really reproduce this)
  • FIXED:I always see a vertical girder at the top left of the map, but it can't be walked on or destroyed.
  • FIXED: The map preview image for random maps is wrong
  • FIXED: It seems this script will not be installed by make install, so I needed to copy it manually. I also cleaned cmake cache several times; I am not sure if it is just me or if somebody just forgot to update something. ;)

Suggestions:

  • DONE: Also allow to select the other sprite IDs of the sprite sheets (currently only the first one is allowed)
  • DONE: Allow 60 health for barrels (the current default)
  • Allow to explicitly select default health/timer for gears (in other words, leave the health untouched, don't call SetHealth)
  • Include the extraction script into Hedgewars
  • Maybe make standalone script or program (Shell/Phython/whatever) for extracting stuff; as an alternative to HTML
  • Include better selected-by-default schemes for HedgeEditor (Default just seems wrong), just like suggested in the wiki
  • Allow to place fake crates (SpawnFakeAmmoCrate, etc.) with optional explosion and poison enabled/disabled, also should be markable as destroy/collect goal
  • DONE: Extend health modify mode where you can select "-1", "-10", "-100", "+1", "+10", "+100", and the like. When you click a hog hog with it, it adds or subtracts the displayed amount of health; This would be very flexible IMO, because players now could set any arbitrary amount of health this way. Should prevent the health going to 0, of course.
  • DONE: Health modify mode should also work for barrels
  • Add query mode where you can query timers, health, and other "invisible" values of gears.
  • DONE: "Tag Victory Mode" and "Tag Failure Mode" should be explained better, it is not clear what to do with the gears for victory/failure
  • Add hat mode, where you can set hats for individual hogs
  • Add dud mine mode (done), frozen mine mode, frozen barrel mode
  • Extend sticky mine mode where you can set the "throw direction" (i.e. up) so you can place sticky mines at vertical walls or at the bottom of something.
  • Maybe same for cleaver?
  • Can this also be used with only 1 clan?

Honestly, I am not very excited about the whole architecture of this thing.

I would have liked it if some Lua library was used as template for the generated missions. It seems all generated missions are self-contained, which means there is a lot of boilerplate and redundancy throughout generated missions.
I also see a lot of unused code in generated missions, i.e. mission objective strings even no objective has been added, etc.

If you add improvements to this script (or fix bugs) later, those won't affect the generated missions. All generated missions would have to be maintained on a case-to-case basis. Well, we could still do that, but it is sub-optimal IMO.

The reason why I have made Lua libraries for Speed Shoppa and the target practice missions is not only ease-of-use but also to make it easier to be generated by tools.

Maybe there could be some

One thing that this script *is* certainly useful for is to get pixel-perfect coordinates for new gears.

Fun fact: I have used your script in parts to quickly place all those gears in my Flying Saucer training: http://www.hedgewars.org/node/6261/. Still I just used the coordinates, all other code was thrown away.

(My mission is far too complex and covers lots of corner cases.)

Wuzzy allegedly wrote:

A bunch of stuff

Cool, thanks for the comments. This is the first time the script is seeing actual user-testing so it's very useful to get feedback like this so that it can be improved in while it's in pre-release. There are bound to be a few bugs (and I think there are probably a lot more than what you mentioned) but hopefully they can be ironed out over time.

I'm also happy that this script could already help you in trying to create some new content. Even copy/pasting just gear positions is using this script exactly as it is intended (and how I use it myself), hence why I included that section for getting Core Gear Data. I'm sure you are aware of this already, but HedgeEditor isn't really intended as a magic bullet that is going to handle all cases perfectly.

Using libraries to reduce the amount of redundancy is something we could certaily do in the future and something I will consider when we have a good enough set of libraries. Currently, I've kept things pretty generic, but if I were to allow users to save/output their data as a more specific type (e.g. particular kind of mission/script) we could probably improve this issue further. Missions have always been maintained on a case-to-case basis and unfortunately using libraries isn't really going to totally solve this issue as changes to the library may still require changes to the individual scripts. As you've already noticed, there is a limit to what using a script to help generate missions can do, and that same argument applies to using libraries. I wouldn't use either the existing Speed Shoppa or Target Practice for most of the missions I create as they are far too limited in what they allow and do not allow for much customization at all. That said, having HedgEditor use some kind of library is a good idea, and something I will probably add in the future.

I don't have time to go through your entire list of suggestions and comment on them right now, but thank you for the list, some of them are good ideas.

Maybe have a use on for loop, if they are crates with same type and similar coords?

EDIT1: I don't know if that's on purpose, but randomly generated maps are always blank for some reason and there's no script for non-image maps.

EDIT2: I have 4 missions made with HedgeEditor that are well made, however I'm gonna have to polish them a lot.

cool, thanks.

I have made some bugfixes and updates to HedgeEditor on my repository (default branch), see here:

https://bitbucket.org/Wuzzy2/hedgewars-wuzzy/commits

(The latest 6 commits are the relevant ones, changesets 45316b6eb4a0eaffaf9b1d7dbd1f889d0081aa81 to 6c38097d01e18d362139b951f5e6be87a4ad1ffd.)

EDIT: This post is no longer relevant.

User login

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