Mission editor

25 replies [Last post]
Noob.com_123-321
Noob.com_123-321's picture
User offline. Last seen 10 years 46 weeks ago. Offline
Joined: 2013-01-02
Posts: 115

Some people don't know ANY lua, so why not make this?

(Account blocked from further forum access due to: spam, verbal abuse, and other cases of misbehavior)

sphrix
sphrix's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2011-04-07
Posts: 206

maybe developpe your idea, how you imagine it would work etc....
plus, you can try and learn some lua code , trust me, i never touched it, but with help, and reading hedgewars wiki about lua, reading other mission file, i finally did a mission : the portal one.

at least, developp your idea Wink Smiley

the beachs hogs surfin hedgewars

Star and Moon
Star and Moon's picture
User offline. Last seen 51 weeks 6 days ago. Offline
Joined: 2010-04-03
Posts: 718

From what I've heard, Lua is easy to learn. I haven't looked at it yet but I'm going to as soon as I finish learning Python. (try poking mikade for tutorials or looking on the wiki)

A mission editor would be great, but I don't think it'll ever come 'till way after version 1, unless somebody has enough spare time to do so. Maybe when I get experienced enough in programming I'll look into it.

sphrix
sphrix's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2011-04-07
Posts: 206

first thing to read, just to understand how it work : http://code.google.com/p/hedgewars/wiki/LuaGuide

second thing : http://code.google.com/p/hedgewars/wiki/LuaAPI

and finally, a bit harder maybe, more complex for me but can be usefull :
http://code.google.com/p/hedgewars/wiki/LuaLibraries

this doesn't say how lua work, but can help you to try a litlle script.

try first little scripting to test what it does, and understand it
then you can do missions etc....

also, i have in mind how mission editor could be but as its not complete in my mind i won't explain now

so, how do you see your mission editor ? Wink Smiley

the beachs hogs surfin hedgewars

Noob.com_123-321
Noob.com_123-321's picture
User offline. Last seen 10 years 46 weeks ago. Offline
Joined: 2013-01-02
Posts: 115

But there are people who don't want to type out every mission!

(Account blocked from further forum access due to: spam, verbal abuse, and other cases of misbehavior)

sphrix
sphrix's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2011-04-07
Posts: 206

i just gave you keys to make it if you wanna, without wait for an hypothetical editor.

and really, how do you see the editor ? describe it if you want to see it one day you have to suggest how it should be.

the beachs hogs surfin hedgewars

Star and Moon
Star and Moon's picture
User offline. Last seen 51 weeks 6 days ago. Offline
Joined: 2010-04-03
Posts: 718

Noob.com_123-321 allegedly wrote:

But there are people who don't want to type out every mission!

A.K.A people who are lazy.

Noob.com_123-321
Noob.com_123-321's picture
User offline. Last seen 10 years 46 weeks ago. Offline
Joined: 2013-01-02
Posts: 115

There are some people out there that are not lazy, but are either disabled or without a keyboard.

(Account blocked from further forum access due to: spam, verbal abuse, and other cases of misbehavior)

Star and Moon
Star and Moon's picture
User offline. Last seen 51 weeks 6 days ago. Offline
Joined: 2010-04-03
Posts: 718

Noob.com_123-321 allegedly wrote:

There are some people out there that are not lazy, but are either disabled or without a keyboard.

If you don't have a keyboard, then how are you typing these comments or playing hedgewars?

Also, what the heck do you mean by disabled?

Noob.com_123-321
Noob.com_123-321's picture
User offline. Last seen 10 years 46 weeks ago. Offline
Joined: 2013-01-02
Posts: 115

Star and Moon allegedly wrote:

Noob.com_123-321 allegedly wrote:

There are some people out there that are not lazy, but are either disabled or without a keyboard.

If you don't have a keyboard, then how are you typing these comments or playing hedgewars?

Also, what the heck do you mean by disabled?


You might wanna use the on screen keyboard!
Also, with disabilities is what i mean by disabled.

(Account blocked from further forum access due to: spam, verbal abuse, and other cases of misbehavior)

Star and Moon
Star and Moon's picture
User offline. Last seen 51 weeks 6 days ago. Offline
Joined: 2010-04-03
Posts: 718

Noob.com_123-321 allegedly wrote:

Also, with disabilities is what i mean by disabled.

OOH! THAT EXPLAINS EVERYTHING!

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

Noob.com_123-321 allegedly wrote:

Some people don't know ANY lua, so why not make this?

Hi there. You can read about our editor and other upcoming features on the release schedule.
---> http://www.hedgewars.org/releaseschedule

mikade
Hedgewars Developer

claymore
User offline. Last seen 1 year 3 weeks ago. Offline
Joined: 2009-06-12
Posts: 306

It would be funny if it weren't for real...

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

I have limited sympathy for those who won't even outline their ideas. Also, feel free to lend a hand.

mikade
Hedgewars Developer

sphrix
sphrix's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2011-04-07
Posts: 206

i have this idea in mind, and i imagine how it could look
not sure it is possible
i will try to make an image to show what I imagine about this

so, actually, my post is useless :p

but i like mikade shedule !

edit, http://www.hedgewars.org/gsoc_ideas2012.html

Editors
not every one playing and wanting to contribute to the game knows how two code or how the game works. Creating a mission editor with helpful features or a theme editor will allow many more to create content.

Skills: c++/lua, qt
Difficulty: medium
People to bug: unc0rr, henek, mikade, smaxx
Impact: easier creation of content and therefore more content

the beachs hogs surfin hedgewars

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

Eh, well, a fully functional editor implemented in frontend and/or engine would of course be pretty neat. That's outside my sphere of influence however, so I personally can't help there. Would be nice to get that as a finished GSoC project, sure.

There actually is a Hedgewars Editor of sorts already. I made one for belphegorr and the other GSoC applicants just before last year's GSoC started. It is entirely lua-based tho, so it doesn't really help people who aren't going to put in some level of effort to read the wikis and familiarize themselves with scripting basics. Depending on what projects are selecting this year I will think about maybe improving and or publishing it.

mikade
Hedgewars Developer

sphrix
sphrix's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2011-04-07
Posts: 206

yeah share it mikade :p
that would help sometimes

the beachs hogs surfin hedgewars

Wuzzy
Wuzzy's picture
User offline. Last seen 2 days 22 hours ago. Offline
Joined: 2012-06-20
Posts: 1301

TL;DR: What follows is a very long theoretical post which introduces the idea of a new declarative (rather than procedural) and radically simplified mission file format. The idea behind this is that such a file format may level the way to a mission editor.



Actually I do not see why a good graphical mission editor would be a bad thing after all. WYSIWYG would be a great thing and ease many things up. I can imagine it gets pretty annoying to get all the coordinates for all the hedgehogs and objects right. You probably waste time guessing them, replacing them, moving them again etc. instead of having a graphical editor which shows the map where you can place objects and hedgehogs freely simply by clicking and you can set their properties (health, etc.); probably you could even define some simple goals.
However, one question remains: How does this all fit together with Lua scripts? A graphical mission editor could auto-generate Lua code for the non-fancy stuff like spawning hedgehogs and objects but there is still a problem because such an editor would not be able to read a Lua script to import a mission because Lua allows much more fancy stuff. At least, I can't imagine it would be easy (if even possible) to implement this without going nuts.
The answer to this question probably is: WIYSIWYG does not fit together with Lua scripts at all. It sucks!

But wait: Most missions aren’t very fancy or scriptish: They have simple goals like “kill hedgehog X” or “capture crate Y” or something like that. Hedgehogs, crates, barrels and mines get placed on the map and have a short goal description. Most of the time the Lua script does not do more than simply placing hogs and objects and defining the objective—and that’s it! Lua scripts for such simple missions are clearly an overkill and way too fancy after all. While they are certainly useful for more complex missions, it also is an entry hurdle for people who just want to create simple missions. I think the existance of this thread should prove this beyond doubt. Wink Smiley (Please note that I mean “simple” in the sense of “simple to reproduce”, not in the sense of “simple to win”.)

I have an idea how to radically simplify missions. We could define a dead simple file format just for missions, perhaps in the style of .ini files, let’s call it mission.ini. What is different about my proposed file format that, unlike Lua script, it is declarative. This means the is no executable code at all. There are predefined keys and each key has a value. Unlike in Lua scripts, the order of appearance shall not matter in this file format. mission.ini shall contain a lot of definitions for the following:

  • map (obviously)
  • hedgehogs (with position, team, health, state and other important variables)
  • team arsenals
  • objects
    • mines (position, timeout, dud yes/no)
    • sticky mines (position)
    • barrels (position and health)
    • weapon and utilty crates (position and content)
    • first aid kits (position)
    • targets (position)
  • Starting team
  • Player team
  • goals (meet one or all of some predefined winning conditions):
    • hedgehog H dies (very common goal)
    • team T was wiped out (very common goal)
    • you collect crate C
    • time runs up
    • target X gets destroyed
  • anti-goals (you lose if one or all of some predefined losing conditions are met, the events that may trigger thes)
  • texts
    • mission goal in words
    • short desciption for the mission selection screen
    • winning text
    • losing text
    • title
    • BONUS: all of the above, localized

Here is a rough example of how I’d imagine such a mission.cfg:

[missiondata]
map=Bamboo
startteam=1

[team1_en_GB]
name=Pathetic Resistance
color=0
controlled_by=player
arsenal= ; Oh shit! I have no idea how to do this!
hog1_name=Ikeda
hog1_health=10
hog1_x=30
hog1_y=380
; further hogs would be hog2, hog3, etc.

[team2_en_GB]
name=Cybernetic Empire
color=1
controlled_by=ai_5 ; AI level 5
arsenal= ; Oh shit! I have no idea how to do this!
hog1_name=Unit 835
hog1_health=10
hog1_x=835
hog1_y=490

[goal]
kill=2.1 ; team 2, hog 1 (=Unit 835) has to be killed
; additional kill-goals would have to be seperated by spaces

[texts_en_GB]
map=Bamboo
title=Bamboo Thicket
description=Death comes from above
goal=Eliminate the enemy before time runs out

Above example is a redefinition of the mission “Bamboo Thicket”. Please keep in mind that this is in no way the actual proposed file format, I posted the example only to give you an idea. If you read carefully, you also would have seen that I have no idea how to define the arsenal for now. Some thought still needs to be done on the actual file format.

Some of the fancier missions would not be definable with it. For example, ticker messages or speech bubbles would not be possible but they are not very important. But scripted events are of course also not possible. The following already existing missions could theoretically be created with this simple file format:

  • Bamboo Thicket (Just kill a hog)
  • Newton and the Hammock (Just kill a hog)
  • Teamwork 2 (Just kill a hog)
  • The Great Escape (Just kill a hog)

And if you remove the speech bubbles and other non-important stuff, additionally, following missions would be theoretically possible:

  • Dangerous Ducklings (has speech bubbles; goal=kill hog)
  • Spooky Tree (has a "thinking bubble"; goal=kill hog)
  • Teamwork (has speech bubbles; goal=kill hog)
  • Portal training mission (has thinking bubbles; goal= kill all hogs)

Following missions would not work because they are too fancy:

  • basic training missions (spawning of targets are fancy scripted events)
  • That Sinking Feeling (the rising water is scripted)
  • all missions from the campaign “A Classic Fairytale” (heavy usage of scripting)
  • Challenge: RC Plane (keeping score is not possible without scripts)
  • Diver (Just kill a hog, but you lose if the timer runs out)

The benefits of a well-defined simple file format for missions instead of Lua are:

  • It is easier than a Lua script
  • It could safely be parsed by a software, for example Hedgewars (obviously) or a mission editor Big Grin
  • It could ease the development of the fancy missions, too. Here’s how: Theoretically it would be possible to write a parser which generates a template Lua code out of the mission definition file with all the non-fancy stuff like spawning hedgehogs. It is of course not needed for simple missions but may be very useful for complex missions. The generated code shall of course work out-of-the-box. A possible workflow for fancy missions could look like this: Use a graphical mission editor to do all the “boring” stuff like placing stuff, save the work (in the simple definition format), then auto-generate Lua code out of it and use this code as a base for the *real* mission.
  • It would prove once again that Hedgewars is not Worms: Armageddon! ;D

The drawback is:

  • fancy missions can not be saved in this file format

To clarify: I do not aim to replace Lua scripts for missions at all. I suggest the proposed file format as an alternative to the Lua mission scripts, thus lowering the entry barrier for new players who want to create missions without scaring the experienced ones away. The mission creator has to choose wheather to use the simple definition file format or a fancy Lua script, but not both. If you need fancy stuff, you have to go for Lua but if you just want to place hedgehogs, crates, mines, barrels and the goal is "kill hog X" (or another pre-defined goal), you could go with the simple format.

Hi, I am a Hedgewars developer. Smile

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

Yeah. The current editor is pretty WYSIWYG and works more-or-less as you describe. It lets you place gears via graphical interface, define some simple attributes about them, and then auto-generates a template lua script with that data inside it. From there, you just edit the auto-generated script if you want to change things or add additional complexity. I could probably add simple goal handling to it, but laziness and or lack of time usually get in the way.

But yeah, if YOU feel passionate about it, you could probably already just write a lua script that looks for your described cfg file and interprets it accordingly.

mikade
Hedgewars Developer

nemo
nemo's picture
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 2009-01-28
Posts: 1861

Funny, I was thinking the exact same thing as mikade when I read the description of the cfg. Heck. it wouldn't even require filesystem read.
Just telling people to add a one-line include at top of file, then stuff the config into a datastructure in lua format below it.
Then request that the supporting lib in the one-line include be tossed into the engine.
Done Smile

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Wuzzy
Wuzzy's picture
User offline. Last seen 2 days 22 hours ago. Offline
Joined: 2012-06-20
Posts: 1301

mikade: I thought there isn’t any editor whatsover which is the reason why this thread had been created in the first place. AFAIK there are two binaries which get created when I build hw and stuffs: hedgewars and hwengine. IIRC hwengine is just for replaying demos and hedgewars starts the main game. No mission editing here. I have searched both wikis but found no reference for an editor. The "mission/script" tutorial just points to the Lua documentation which is not what I'm looking for. So what "current" editor are you talking about?

nemo: Interesting idea. I'll keep it in mind. I just don’t see why it wouldn’t require any read from the filesystem. How should Hedgewars know the mission data if it didn’t read it at some point?

Hi, I am a Hedgewars developer. Smile

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

Well, "current" as in the editor used to create most of the missions that come with the game. It's not included because it's just something I messily threw together as a development tool. Programming software can also be used to create missions and we don't include that, either Big Grin

I could upload it, but it's not like it comes with any documentation or is stable etc. Not really designed for use by the general public. That said, since the creation of this thread I've been trying to make it slightly more user-friendly and add a few new features so that people who are interested in making missions can try it out. If we choose making an editor as a GSoC project though, my little tool won't really be needed, so yar.

mikade
Hedgewars Developer

Noob.com_123-321
Noob.com_123-321's picture
User offline. Last seen 10 years 46 weeks ago. Offline
Joined: 2013-01-02
Posts: 115

You can easily create all types of the hedgewars missions!
Concept Image

Just switch out any names with the new and edit versions of the mission modes, replace "Monster Arena" with HedgWwars Mission Editor, Change "Select Area" to "Select Mission Type," and make the HedgeWars background take the place of the background.

(Account blocked from further forum access due to: spam, verbal abuse, and other cases of misbehavior)

Inu
Inu's picture
User offline. Last seen 4 weeks 5 days ago. Offline
Joined: 2009-08-26
Posts: 240

That's not a concept image, that's a direct copy of a Final Fantasy X menu...

CheezeMonkey
User offline. Last seen 4 years 15 weeks ago. Offline
Joined: 2010-11-19
Posts: 117

Inu allegedly wrote:

That's not a concept image, that's a direct copy of a Final Fantasy X menu...

Priceless... ^^

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

CheezeMonkey allegedly wrote:

Priceless... ^^

For everything else, there's mastercard!

Anyway, now that it it looks like we won't be getting a GSoC editor I guess I will go back to hammering on my hack. If we added a bit more stuff to engine it could probably become slightly less hackish in time.

mikade
Hedgewars Developer

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