Author Topic: scenario editor  (Read 27162 times)

treba

  • Guest
scenario editor
« on: 10 June 2010, 16:42:07 »
Sourceforge page | Git
hey everybody,

i just thought about making a little campaign, but when i started to work on a scenario, i found it really anoying how complex this task actually is.
in the past i used to build maps for starcraft and warcraft 3, which have really powerfull map-editors with inbuild trigger-editors. everybody could easily build their own campaigns without knowledge about scripting languages.
i know that mg and gae have great support for own scripts in lua, but it is very tricky at the moment to use is right. as far as i know do only a very few scenarios out there make use of the possabilities given, maybe because it´s so hard to use them.
to come to the point: i miss a easy to use trigger-editor for scenarios. just like the ones in sc and wc3.

to give you an idea how it looked in sc:



so what im thinking about is a simple gui that puts together the lua scripts.

here an example:
Code: [Select]
<scripts>
  <startup>
    ...
    giveResource('gold', 1, 1000)
    ...
  </startup>
  ...
</scripts>
these lines are an excerpt from the storming scenario. in the editor i am thinking about, you would select something like 'new trigger' and two boxes would appear, one for conditions and on for actions.
in this example, you would select something like "new condition". there, a drop down menu for conditions would appear. in this case you would pick "startup" or "initialisation".
then, you go to the "actions" box, select "add action", scroll down in the drop down menu for "add resource". more drop down menus or other input fields for the needed arguments would appear (resouce type, player, amount).
i hope you got the trick.

i know this is a lot work to be done, but works very simple. besides, the possible lua scripts could be build in step to step.
so it could start with giveResource and createUnit and would gain more and more possabilitys over time.

i don´t have much time atm, but i will try to write the basics needed for it.

so, do you also think this is usefull and possible? and does someone want to work on it?

greetz
« Last Edit: 27 December 2011, 14:16:40 by treba »

Gabbe

  • Guest
Re: scenario editor
« Reply #1 on: 10 June 2010, 17:28:35 »
i want it badly...

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: scenario editor
« Reply #2 on: 10 June 2010, 21:01:49 »
This would be awesome.  Without some kind of scenario maker/editor thingy, I'm (probably) never going to touch Lua.

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: scenario editor
« Reply #3 on: 10 June 2010, 23:45:16 »
I can do Lua, but its hard and take a extremely long time... I would LOVE a scenario editor. :)

Um, Go ahead get right on it...
Get the Vbros': Packs 1, 2, 3, 4, and 5!

treba

  • Guest
Re: scenario editor
« Reply #4 on: 20 June 2010, 01:41:31 »
just started with this some hours ago and the basic things work now (read out data from xml files etc.....took me a while since it´s my first c++ project).
but i don´t know the lua command myself, only those from scenarios like storming. is there a full documentation? especially for mg and gae?

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: scenario editor
« Reply #5 on: 20 June 2010, 04:31:18 »
is there a full documentation? especially for mg and gae?

The best reference for a starting point is https://docs.megaglest.org/Scenario_Editing which covers some basics you need to know, and has the complete Vanilla/Mega Glest function reference.

MG has no new lua functions as yet, and while it would be nice to think they'll just take ours, I doubt it will happen like that.

For the extended GAE only functionality, see http://sourceforge.net/apps/trac/glestae/wiki/LuaReference (this is a complete function reference, it also covers the original Glest functions).

Good luck, this is no small project!

Edit: As well as the new functions, GAE also includes lua error handling and reporting, so even if you are developing with Vanilla/Mega glest in mind, I strongly recommend using GAE while developing/testing.
« Last Edit: 18 June 2016, 19:17:33 by filux »
Glest Advanced Engine - Code Monkey

Timeline | Downloads

treba

  • Guest
Re: scenario editor
« Reply #6 on: 20 June 2010, 16:12:02 »
@silnarm: thanks!  :)

as i said before, i don´t plan to include the whole bandwith of lua scripts. atm i think about a xml based system where everybody can add new lua commands. i will only do the basics, so i only want to understand the whole thing.

i´m thinking of sth. like this:

so to give the editor the possability to write sth like this:
Code: [Select]
createUnit('library', 2, startLocation(1))the xml file to add this function to the editor will have to look like this:
Code: [Select]
<?xml version="1.0" standalone="yes" ?>
<command>
<string>createUnit(%1, %2, %3)</string>
<1 value="unit_type"/>
        <2 value="player"/>
        <3 value="location"/>
</command>
the possabilitys for the values will come from other xml files or from the game files. so i myself only have to code the functions for the values, but not the real lua stuff. if everything works like exspected, i have to do much less than expected in the first moment.

to everybody who knows the lua a little bit: is there something i missed with that idea? is it going to work?

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: scenario editor
« Reply #7 on: 21 June 2010, 00:15:08 »
Seems like a good plan Treba  :thumbup:

I can't see any problem with this format as it should work with the current Lua commands and keeps the flexibilty to add new LUA commands to the editor as the are created.

This would be a really helpful tool if you manage to finish it and might help kickstart the community to make more scenarios   :scientist:
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: scenario editor
« Reply #8 on: 21 June 2010, 01:36:32 »
Cool, I'll be looking forward to it. :)

treba

  • Guest
Re: scenario editor
« Reply #9 on: 24 June 2010, 21:46:45 »
hey ho!

since this is my first real program (i only did php stuff before), it took me a bit to get into all this stuff. also, i was to lacy to use wxwidgets because i didn´t find a good ide for it. so i decided to use qt, witch is also platform independent and has all the necessary stuff like, even a xml library.
the program is far from being ready now, but i got the basics for it. that is good, because i now know how everything works.
that is why i now took the project to sourceforge.
if you are interested in it, you can check out the current code from svn. the code is not very nice so far, but it will get better, i promise :)
i don´t know how qt programs are compiled under windows, but with linux, a simple
Code: [Select]
qmake
make
will do it, as long as qt is installed.

the version history will take place in three steps:
0.1: basic scenario settings can be handled via gui. data comes from the glest folder or the settings.xml. full compatibel with scenarios not created with editor.
0.2: scripts can be created via gui. code for scripts comes from xml files. not compatibel with scenarios not created with the editor.
maybe 0.3: compatibility with scenarios not created with editor.
1.0: everything is stable an will hopefully not need to be changed when changes to the format are made (like 8 players)

atm, we are at 0.1 alpha. basic editing works, files can be loaded and saved again, but some things don´t work as they should (like displaying right factions after loading a scenario if the faction can´t be found in the given techtree. but that´s only a detail). expect 0.1 in a few days.

some screens:



greetz,
treba
« Last Edit: 25 June 2010, 12:49:40 by treba »

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: scenario editor
« Reply #10 on: 25 June 2010, 01:36:12 »
Cool! can't wait till its done!
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: scenario editor
« Reply #11 on: 26 June 2010, 05:41:26 »
Might be interesting. I wouldn't need it, but you never know, might get some people who aren't any good at lua into making scenarios.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: scenario editor
« Reply #12 on: 26 June 2010, 07:32:00 »
Might be interesting. I wouldn't need it, but you never know, might get some people who aren't any good at lua into making scenarios.
Sure you could use it! Making scenarios would be much faster.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: scenario editor
« Reply #13 on: 26 June 2010, 15:58:33 »
Might be interesting. I wouldn't need it, but you never know, might get some people who aren't any good at lua into making scenarios.
Sure you could use it! Making scenarios would be much faster.
But if he knows already how to and can make more advanced ones, then it does not really have a use...just for people who don't know much about LUA and such...like me.  :O

Looks cool, Are you emulating windows on a mac? I see...  :)

treba

  • Guest
Re: scenario editor
« Reply #14 on: 26 June 2010, 16:30:55 »
Looks cool, Are you emulating windows on a mac? I see...  :)

it´s kde on linux ;)

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: scenario editor
« Reply #15 on: 26 June 2010, 17:19:25 »
I can do LUA but I think this editor might make it faster.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: scenario editor
« Reply #16 on: 1 July 2010, 22:52:28 »
Well, face it, editors are for the inexperienced at something. Once you get experienced enough, you can do it in just code. For example, a web design noob might use Microsoft Frontpage to make a website. But, frontpage is very limited, has horrid formatting, puts in a lot of junk that drastically increases filesize, and makes it based for IE. Once you are good at HTML, you'll make all your webpages from scratch in code, because it is better, allows you to do more, and overally increases performance (not to mention way more fun! :D).

Same applies to Lua (BTW, haven't you seen Lua's homepage? They state the ideal way to say it is "Lua" with the first letter capital and the rest lowercase.)

"Lua" (pronounced LOO-ah) means "Moon" in Portuguese. As such, it is neither an acronym nor an abbreviation, but a noun. More specifically, "Lua" is a name, the name of the Earth's moon and the name of the language. Like most names, it should be written in lower case with an initial capital, that is, "Lua". Please do not write it as "LUA", which is both ugly and confusing, because then it becomes an acronym with different meanings for different people. So, please, write "Lua" right!

No wizard, editor, etc has ever been as good as human logic. This will be good for people new to Glest, but for those who hope to make scenarios that do something new and different (see the scenarios of Military for an instance, ALL which are Lua, and range from defeating the foe with limited units, having full bases of starting units, defending allies, following a storyline, surviving waves of enemies, or holding a location for a period of time), you will need to go through the code.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: scenario editor
« Reply #17 on: 2 July 2010, 00:18:12 »
Naturally, dealing with just the raw code itself is going to be more powerful, in the same way that working with a Unix or DOS prompt is a lot more powerful than using an operating system with a GUI, but the latter is a heck of a lot easier to work with, and the majority of people don't want to have to learn a new language.  Frankly, I've learned enough new skills for Glest (modeling, unwrapping, texturing, rigging animating... shall I go on?), and learning Lua is not on my to-do list.  For the truly hardcore scenario people, learning Lua is the best bet, but a graphical editor is a much preferable choice for the less dedicated, or those who just want to give it a try before committing wholly to it.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: scenario editor
« Reply #18 on: 2 July 2010, 06:03:26 »
It's a tool. It will be useful even for 'hardcore scenario people', you'll still be able to add your own code, this will simply be a nice way to get it started, and will probably help less experienced programmers organise their code better.  If it turns out as well as I hope it does, I'll certainly use it :thumbup:
Glest Advanced Engine - Code Monkey

Timeline | Downloads

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: scenario editor
« Reply #19 on: 2 July 2010, 06:08:48 »
it´s kde on linux ;)
Sorry, sometimes my mind is...  :| blank?

Well, face it, editors are for the inexperienced at something. Once you get experienced enough, you can do it in just code. For example, a web design noob might use Microsoft Frontpage to make a website. But, frontpage is very limited, has horrid formatting, puts in a lot of junk that drastically increases filesize, and makes it based for IE. Once you are good at HTML, you'll make all your webpages from scratch in code, because it is better, allows you to do more, and overally increases performance (not to mention way more fun! :D).
...
Yeah, basically... but uh, who knows? This scenario editor might even be good enough for the pros... there aren't that many great scenarios for glest yet, none that are popular...anyways.  :|
So  :thumbup: Will be helpful for newbs. And maybe for others?  :|

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: scenario editor
« Reply #20 on: 5 July 2010, 23:50:52 »
By the way, when working on the glest guide, I rediscovered the Scenario Editor. It had the ability to add custom resources quietly released a few months back. Of course, it has been used a small number of times... 273 people have viewed the scenario creator page, and 105 have gone through to the end and downloaded their work. Still, that's not to bad, seeing I didn't publicize it at all.

Not as functional as the planned idea here (haven't seen any progress, is this still alive?), but its a basic editor...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: scenario editor
« Reply #21 on: 6 July 2010, 00:43:37 »
You mean the one on glest guide? Yeah, it isn't bad. But compared to this, I think this would be better. That is for more simple scenarios, as it is just to set up a game, etc. But that's nice. I did try it...
Hmm, I think this is still being worked on, just no reply...people don't have to...

treba

  • Guest
Re: scenario editor
« Reply #22 on: 14 July 2010, 11:44:49 »
hey, just wanted to say that the project is defenetly not dead but i started to make a break some weaks ago due to some preparations i have to do here. the project will be finished, i promise  :)

treba

  • Guest
Re: scenario editor
« Reply #23 on: 19 September 2010, 12:09:51 »
hey ho again.

here a few pictures of the current status:




Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: scenario editor
« Reply #24 on: 19 September 2010, 17:47:49 »
Looks very impressive. You've been busy. :)
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert