An interface for developing campaigns ...

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
User avatar
Tomsik
Posts: 1401
Joined: February 7th, 2005, 7:04 am
Location: Poland

Post by Tomsik »

allefant wrote:Ok, I made a first official alpha release :) It's not very useful yet, but feedback/feature request/ideas are welcome: http://wesnoth.org/wiki/CampGen
its nice, i want to see ver 1.0 :)

P.S.: now i learning python :)
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

When you have done the event editor, i'll be testing it. I'll probably use it for the last 2 scenarios of my campaign.
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Just so you know, I would say that the one feature this would provide that I might find useful is having a point'n'click interface for putting the dots and crosses on the story map. However, I would find that EXTREMELY useful.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

The story editor is what I started earlier, it looks like this:

Image

Mostly mockup yet. Must think about how to specify the per-marker delays, probably by right click in the list ot the left. Also, you specify the position by right-clicking in the background image, full drag&drop will have to wait for campgen 2.0.

About the event editor, I sort of abandoned that idea for now. Instead, I know now how I can keep all WML from read in files, with a simple change. So events can be edited in an external text editor. (Or in a simple XML editor which will be included in the next version, as part of this change).

That is, if someone designs an interface for an event editor, I can transfer it to wxglade, I guess :) But there's just too many different things - the different events, then the filters, then the actions.. how can you make a GUI out of it?
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

Don't give up on it, once you've done everything else try to do the event editor again, perhaps you could just do it for simple things like, specifying what is said when a someone dies. Just do it as...

Like what triggers it, maybe 3 different select boxes, like the first being selecting what actually has happened so death or its reached a certain turn and the second being the target of it, so with the turns it'd be which turn, and the with the death one, it'd go through the starting charecters and leaders and there would a other option to type in who. And with the third box you would have any more complications so, with turn it be after which side number. Anything more complicated the person might as well look it up.....

Then what actually happens so you can set it up as maybe another 3 boxes, the first with say talk, kill, store, move, victory, defeat, sighted, just a list which they can choose from. With the second it'd be who, and for the 3rd it'd be like what they say, only needed for a few. And they'd have a choice to do this set over and over again, like the add attachment window we have on the forums, you can do it then you can press "add attachment" and then you'd have a clean one to do it on but still in this event. And then you could to select the event later just have a list of them, maybe make the author give each 1 a title.
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

If you can get part 1 working, I have some ideas on the event editor.
You should be able to create functional campaigns without any events, as long as your objective is kill all enemy leaders.

Each scenario has a variable length array of event pointers, each of which points to an event. Now each event could be another pointer array, and each element points to a tag/key structure. The first element would point to a string holding the event name.

Each tag/key structure would be unique. You could also use a string array I suppose. The structure would contain all of the keys for a certain type of tag.

So, to sum up...

the scenario structure has structure.events, which is a variable length pointer array

If event1 = *(structure.events[0]), then event1 is a pointer array.

*(event1[0]) = a string that is the event name, e.g. 'prestart'
*(event1[1]) = a structure

If tag1 = *(event1[1]), then
tag1.name = 'message'
tag1.speaker = 'Hero'
tag1.text = ' _ "Look at those orcs! They want to kill us."'

You can see that each type of supported tag requires a custom structure and a custom input dialog. However, I was thinking about Blizzard's event generator and they do the same thing.

The scenario writer needs to be aware of every supported tag type and know what structure elements to expect. So a message structure has 'speaker' and 'text'. The endlevel structure has 'result', 'bonus', and 'next_level'.

It doesn't scale too well to handle nested tags like if/then, but a simple event editor could be set up like this.


EDIT: the scenario writer routine also needs to be smart about omitted tags. For example when filtering, you usually fill one field and leave the rest blank.
Last edited by scott on August 28th, 2005, 8:54 pm, edited 1 time in total.
Hope springs eternal.
Wesnoth acronym guide.
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

scott wrote:If you can get part 1 working, I have some ideas on the event editor.
You should be able to create functional campaigns without any events, as long as your objective is kill all enemy leaders.

Each scenario has a variable length array of event pointers, each of which points to an event. Now each event could be another pointer array, and each element points to a tag/key structure. The first element would point to a string holding the event name.

Each tag/key structure would be unique. You could also use a string array I suppose. The structure would contain all of the keys for a certain type of tag.

So, to sum up...

the scenario structure has structure.events, which is a variable length pointer array

If event1 = *(structure.events[0]), then event1 is a pointer array.

*(event1[0]) = a string that is the event name, e.g. 'prestart'
*(event1[1]) = a structure

If tag1 = *(event1[1]), then
tag1.name = 'message'
tag1.speaker = 'Hero'
tag1.text = ' _ "Look at those orcs! They want to kill us."'

You can see that each type of support tag requires a custom structure and a custom input dialog. However, I was thinking about Blizzard's event generator and they do the same thing.

The scenario writer needs to be aware of every supported tag type and know what structure elements to expect. So a message structure has 'speaker' and 'text'. The endlevel structure has 'result', 'bonus', and 'next_level'.

It doesn't scale too well to handle nested tags like if/then, but a simple event editor could be set up like this.


EDIT: the scenario writer routine also needs to be smart about omitted tags. For example when filtering, you usually fill one field and leave the rest blank.
All we want is a simple one, so it'd be fine.
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
pacho
Posts: 72
Joined: February 7th, 2005, 7:42 pm
Location: Oviedo (Asturias), Spain

Campgen doesn´t work for me :(

Post by pacho »

allefant wrote:Don't worry, I haven't forgotten about this :) By now, about all of your initial design's dialogs are working, including partial loading (and only for things it saved out itself). Well, it still has some bugs, but getting there.

I started a page about it on the wiki: http://wesnoth.org/wiki/CampGen

I made 2 changes to your initial design as mentioned there (pathes are gone from the main screen, and short campaign name is gone since I couldn't find a corresponding item in the WML). I'm wondering if the scenario dialog should maybe get a notebook.. well, I wrote it all on the wiki page anyway :)
I am trying to run campgen-0.5 on a gentoo linux (x86-64) with python 2.3 (and 2.4, also) and wxpython 2.4.2.4.
It gives me the following error:

Code: Select all

(17:08:38) pacho@localhost ~/campgen-0.5 $ ./campgen
Reading daytimelist.txt
Reading musiclist.txt
Traceback (most recent call last):
  File "./campgen", line 21, in ?
    app = gui_campaign.MyApp(0)
  File "/usr/lib64/python2.3/site-packages/wxPython/wx.py", line 1951, in __init__
    _wxStart(self.OnInit)
  File "/home/pacho/campgen-0.5/gui_campaign.py", line 686, in OnInit
    frame_main = MyFrame(None, -1, "")
  File "/home/pacho/campgen-0.5/gui_campaign.py", line 156, in __init__
    self.__set_properties()
  File "/home/pacho/campgen-0.5/gui_campaign.py", line 197, in __set_properties
    self.bitmap_campaign.SetMinSize((72, 72))
AttributeError: wxStaticBitmap instance has no attribute 'SetMinSize'
(17:08:40) pacho@localhost ~/campgen-0.5 $
What can I do?

Thanks a lot
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

I am trying to run campgen-0.5 on a gentoo linux (x86-64) with python 2.3 (and 2.4, also) and wxpython 2.4.2.4.
It gives me the following error:
Thanks for trying it. It looks like wxpython 2.6 is required after all - I'll update the version requirements on the wiki page. Or maybe I just made wxglade output 2.6 only code, since the error is inside generated code..

I guess, I'll try and provide a separate package for the next version, which will include wxpython - it should prevent problems like this (but have highly increased filesize).
skullman
Posts: 18
Joined: August 29th, 2005, 5:59 am
Location: austrlia

just wana say

Post by skullman »

im all game for any testing of this new program, to which it can only help us all :P. cheers fellars for making such a mad program and if ur up for a tester add this josh_land_lord@hotmail.com because i will test it on the spot luck fellars!...
SkullMan
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

Disto wrote: Don't give up on it, once you've done everything else try to do the event editor again, perhaps you could just do it for simple things like, specifying what is said when a someone dies. Just do it as...
[...]
Yes, I think I'll try that. Or maybe I'll more use something like scott said.
scott wrote: If you can get part 1 working, I have some ideas on the event editor.
You should be able to create functional campaigns without any events, as long as your objective is kill all enemy leaders.
True. That's what I think works right now.
scott wrote: the scenario structure has structure.events, which is a variable length pointer array

If event1 = *(structure.events[0]), then event1 is a pointer array.

*(event1[0]) = a string that is the event name, e.g. 'prestart'
*(event1[1]) = a structure

If tag1 = *(event1[1]), then
tag1.name = 'message'
tag1.speaker = 'Hero'
tag1.text = ' _ "Look at those orcs! They want to kill us."'

You can see that each type of supported tag requires a custom structure and a custom input dialog. However, I was thinking about Blizzard's event generator and they do the same thing.
I searched a bit in google and think I found a screenshot of the editor you mean. So basically, it would be a tree-list where you can select things, and then a custom input dialog depending on the type of selected tag. Sounds like I'd need to create a different dialog in wxglade for every supported event type then..
The scenario writer needs to be aware of every supported tag type and know what structure elements to expect. So a message structure has 'speaker' and 'text'. The endlevel structure has 'result', 'bonus', and 'next_level'.

It doesn't scale too well to handle nested tags like if/then, but a simple event editor could be set up like this.

EDIT: the scenario writer routine also needs to be smart about omitted tags. For example when filtering, you usually fill one field and leave the rest blank.
Maybe could link to the wiki page about events though, so at least they would know where to look for reference.

My plan is to do something like the "WML inspector" for the events, so you need to know already what you can put there. Then after version 1.0 of campgen, there can be a blizzard-editor like event edtitor :)
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

Release 0.6 can be found here: http://wesnoth.org/wiki/CampGen

Still no packagers, and I failed myself to do anything with cxfreeze or py2exe :P So you still need to first download wxpython 2.6.1.0 or later, and on Windows, also python 2.3 or later. (linux and OSX already should have python).
lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

Sound working on Mac OS X 10.4.

To use it, unpack the archive, go inside with the Terminal and
run

Code: Select all

pythonw ./campgen
Maybe the first line should be

Code: Select all

#!/usr/bin/env pythonw
instead of

Code: Select all

#!/usr/bin/env python
But it's depending on how "pythonw" is named on other systems.

Also, I had an error when starting a new campain

Code: Select all

12:21:22: Can't load image from file 'C:\Dokumente und Einstellungen\root\Eigene Dateien\prog\python\campgen\data\empty.png'
: file does not exist.
12:21:22: no bitmap handler for type 50 defined.
Finaly, "Start time" and "Music" menus have theyre items duplicated.
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

pythonw ./campgen
Thanks, so now I know it can run on any of the 3 OSes :) I'll change the first line of campgen.pyw to call pythonw. Or maybe I'll find out if there's a standard way to do this.

Something else, are the standard pathes correct? I don't know anything about OSX, so not sure it understands the "~" in the pathes.
2:21:22: Can't load image from file 'C:\Dokumente und Einstellungen\root\Eigene Dateien\prog\python\campgen\data\empty.png'
: file does not exist.
Oops. I did some last minute change when I tried the release candidate in windows - and somehow wxglade put in an absolute path. Oh well, easy to fix.
Finaly, "Start time" and "Music" menus have theyre items duplicated.
I see. Times and music don't work yet anyway. Will be fixed in 0.7.
Uppi

Post by Uppi »

Could you please include the following lines at the beginning of gui_main.py (before the imports):

Code: Select all

import wxversion
wxversion.select("2.6")
This will prevent python from loading the 2.4 version of wxpython on systems with both versions installed.

Check http://wiki.wxpython.org/index.cgi/MultiVersionInstalls for details.
Post Reply