Bretzel13
Community member
Posts: 73
|
 |
« Reply #30 on: August 07, 2009, 06:06:19 AM » |
|
Here's my idea for the language. This should cover a lot of TrainedCircusIdiot's points # Define characters. Kind of like C++ where you declare their class NPC Guard
SECTION MainDialog # A section of dialog. If you had a lot of dialog, you could organize it into sections and then call them.
SAY Guard "You cannot pass." # SAY [who says it] [what to say]
OPTION leaveOrFight # OPTION [option_name] 1 "Fine." # [option_number] [what_section_to_run] 2 "I must pass." ENDOPTION # End the option
ENDSECTION
SECTION leaveGuard guardDead = False PLAYSOUND "testsound.wav" 1 # PLAYSOUND [sound_file] [number_of_times] ENDSCRIPT # End the script ENDSECTION
SECTION attackGuard SAY Guard "I will not let you pass." ATTACK PC Guard # ATTACK [attacker] [victim] # Assumes that PC did not die because game will end and script will not continue guardDead = True PLAYSOUND "testsound2.wav" 2 ENDSECTION
CALLSECTION MainDialog # CALLSECTION [section_name]
RETURN guardDead # End the script and return whether or not the guard is dead
|
|
|
|
|
Logged
|
|
|
|
shevegen
Community member
Posts: 705
|
 |
« Reply #31 on: August 07, 2009, 08:37:17 AM » |
|
Reminds me of the language in Zak Mc Kracken http://en.wikipedia.org/wiki/Zak_McKracken  A few questions: - Need the instructions be UPCASED or can they be downcased as well? - How are the NPCs identified? This example here: SAY Guard "You cannot pass." # SAY [who says it] [what to say] To which guard will it refer (i am curious)? Also, I think it would be better if this syntax would be used: NPC SAY "lalala" Reminds me more of a novel: The renegade says: "Let's leave." vs says the renegade: "Let's leave." Anyway, much better than any XML 
|
|
|
|
|
Logged
|
Cleaning away the bureaucracy in PARPG to make our life easier.
|
|
|
Kaydeth
Community member
Posts: 185
|
 |
« Reply #32 on: August 07, 2009, 02:15:39 PM » |
|
I'm confused about the OPTION part Is this missing something? OPTION leaveOrFight # OPTION [option_name] 1 "Fine." # [option_number] [what_section_to_run] 2 "I must pass." ENDOPTION # End the option
Shouldn't it be OPTION leaveOrFight # OPTION [option_name] 1 "Fine." leaveGuard 2 "I must pass." attackGuard ENDOPTION # End the option
|
|
|
|
« Last Edit: August 07, 2009, 08:07:40 PM by Kaydeth »
|
Logged
|
|
|
|
|
|
shevegen
Community member
Posts: 705
|
 |
« Reply #34 on: August 07, 2009, 03:57:54 PM » |
|
Interesting - do they use a graphical editor all the way? Or is there any kind of text involved? http://adonthell.berlios.de/doc/index.php/Tools:Dlgedit:TutorialIt seems they use pure python actually, which I believe is suboptimal for a dialogue based system "The dialogue engine allows to embed a function call into a line of text and will insert whatever string this function returns in place of the function. This only works for methods defined in the custom function window (Dialogue → Functions or Ctrl+F). It mustn’t take any arguments and should return a string. For example, the method def f_hello (self): return "Hello world!" " And variables need be set like this? self.special_info_gained = 1 I think I prefer the version proposed here rather than such a python-based dialogue system, but of course this is just my personal preference.
|
|
|
|
« Last Edit: August 07, 2009, 03:59:47 PM by shevegen »
|
Logged
|
Cleaning away the bureaucracy in PARPG to make our life easier.
|
|
|
Bretzel13
Community member
Posts: 73
|
 |
« Reply #35 on: August 07, 2009, 07:21:27 PM » |
|
- Need the instructions be UPCASED or can they be downcased as well?
Doesn't really matter to me, except UPPERCASE does seem to pop it out. But then again, I'll be putting syntax highlighting into the editor so I guess either would work - How are the NPCs identified? This example here:
SAY Guard "You cannot pass." # SAY [who says it] [what to say]
To which guard will it refer (i am curious)?
Well, I just defined a NPC called Guard as a generic thing. You could just have easily have said NPC Joe, and say SAY Joe "whatever" Also, I think it would be better if this syntax would be used:
NPC SAY "lalala" Reminds me more of a novel: The renegade says: "Let's leave." vs says the renegade: "Let's leave."
That's true
|
|
|
|
|
Logged
|
|
|
|
Bretzel13
Community member
Posts: 73
|
 |
« Reply #36 on: August 07, 2009, 07:22:57 PM » |
|
I'm confused option the OPTION part Is this missing something? OPTION leaveOrFight # OPTION [option_name] 1 "Fine." # [option_number] [what_section_to_run] 2 "I must pass." ENDOPTION # End the option
Shouldn't it be OPTION leaveOrFight # OPTION [option_name] 1 "Fine." leaveGuard 2 "I must pass." attackGuard ENDOPTION # End the option
You're right I just forgot to add that once I changed the way the options worked
|
|
|
|
|
Logged
|
|
|
|
|
|
shevegen
Community member
Posts: 705
|
 |
« Reply #38 on: August 09, 2009, 01:30:25 PM » |
|
I think one problem i have with it is that it is a valid python script right?
I believe a specific tailor-made dialog language (a domain specific language if you will) would be better than pure python scripts.
The graphical stuff is cool though, and if possible should exist in parpg too, but I am not so enthusiastic about the created .py scripts. A specific, very simple dialog based message should be nicer.
I mean, I am not trying to push that discussion here in any direction (to the one I prefer more) - we could try both approaches and see which one will be nicer in the long run anyway, or? Like switching from one to the other easily lateron.
Some kind of graphical editor - or integrated with a world editor - would be cool at any rate though. A bit like a toolkit for creating worlds and games.
|
|
|
|
|
Logged
|
Cleaning away the bureaucracy in PARPG to make our life easier.
|
|
|
MaximB
Community member
Posts: 7
|
 |
« Reply #39 on: August 09, 2009, 03:30:17 PM » |
|
Well, as I've said I am not a programmer but from a writers point of view you currently suggesting in the PARPG wiki to use Dia for dialog trees, which was the first tool I've tried for my dialogs - and it's very unconformable for long dialog trees. And Dia is just for visual view of the tree, it cannot be used in the actual game ... all the dialogs then needs to be rewritten from scratch with some other program or language.
You see it from the programmers view which I can get, but from the writers point of view you have to find something easy that you could then integrate into the game.
|
|
|
|
|
Logged
|
|
|
|
Kaydeth
Community member
Posts: 185
|
 |
« Reply #40 on: August 11, 2009, 09:05:38 PM » |
|
I agree with Shevegan. The fact that dlgedit generates python code is a bit of a turn off. For one, not everyone likes to work with a gui editor so having a scripting language gives them the option of just writing dialogues in an editor. We may want to borrow the gui component but I don't think we are there yet. Bretzel, can I assume you are moving forward with the syntax you layed out? If so do you think you can update the Wiki proposal ( http://wiki.parpg.net/Proposals:Dialog_Implementation)?You could also create a new proposal if you wish. But we definitely need to document the dialog syntax somewhere.
|
|
|
|
|
Logged
|
|
|
|
superfluid
Community member
Posts: 90
Just another Python Hacker
|
 |
« Reply #41 on: August 25, 2009, 06:18:45 PM » |
|
I think Tech-demo 1 will be easy to reach (i should never say that before its finished eh? but hey I am gonna stand by that comment now) My complaint against XML basically boils down that it is too verbose. It is not the simplest approach that works elegantly. All the closing tags are - for me - redundant information: <name> joe </name> YAML usually uses that instead: name: joe which is better (well ok you must make a newline afterwards, but I am fine with that because I can read it easier) Unfortunately yaml has a few other problems, such as that parsing errors are a bit harder to track than in XML Personally I think it would be nice if we can come up with a syntax that is easy to read and allows for the needed complexity too. I just hope it wond end up like Wesnoth WML. Look here for the problems it has: http://www.wesnoth.org/wiki/AnimationWMLScroll down to the examples "Example Syntax " and look at [if] tags I am sorry but if XML starts to become a real programming language where one needs to put conditionals like [if] into tags, then in my opinion something is very wrong with the design. Also note all the closing tags for the redundant information. I think it can be done easier and better without XML-like syntax. I'd like to throw my opinion in on this if I may... As much as I'm loathe to use XML, writing our own lexer/parser is almost certaintly a worse idea and seems like it would lead to a lot of yak shaving, whereas our efforts could be better focused using an off the shelf library and writing the component that would interpret an abstract tree and do something useful with it... if that makes any sense. Its funny, but when I started reading this thead I immediately though of YAML. I've had some experience using YAML as a domain specific language for software automation, and its actually quite a nice fit. It's very readable, even for non-technical folks, it's not as as heavy as XML and has just as good support library-wise as XML. Check out this example, I don't think it's too far from what we want to do: --- NAME: Administrator changes their timezone ID: admin_changes_tz SUMMARY: Administrators need to have a mechanism for changing their timezone. PRECONDITIONS: - ensure user exists: admin - ensure timezone is: America/Vancouver INSTRUCTIONS: - login: username: admin password: testpass - goto page: Account Settings - verify current timezone is: America/Vancouver - change timezone to: Australia/Brisbane - verify current timezone is: Australia/Brisbane POSTCONDITIONS: - ensure timezone is: America/Vancouver http://search.cpan.org/dist/Test-A8N/lib/Test/A8N.pm
|
|
|
|
|
Logged
|
aka or1andov on IRC
|
|
|
zenbitz
Community member
Posts: 1164
|
 |
« Reply #42 on: August 25, 2009, 08:14:56 PM » |
|
YAML or JSON (subclass of YAML) would probably work. Not sure which is better for dialogue. I am not sure it handles flow control though. I would just do it in Python... I mean, the stupid interpreter is already built in! For an example of an app like this (non game related): http://www.pymol.org
|
|
|
|
|
Logged
|
We are not denying them an ending... We are denying them a DISNEY ending - Icelus
|
|
|
superfluid
Community member
Posts: 90
Just another Python Hacker
|
 |
« Reply #43 on: August 26, 2009, 03:23:55 AM » |
|
YAML or JSON (subclass of YAML) would probably work. Not sure which is better for dialogue. I am not sure it handles flow control though. I would just do it in Python... I mean, the stupid interpreter is already built in! For an example of an app like this (non game related): http://www.pymol.orgI like JSON, but my one reservation about it is that it's stricter about proper quoting of keys and stuff like that... it's more data structure-y
|
|
|
|
|
Logged
|
aka or1andov on IRC
|
|
|
Kaydeth
Community member
Posts: 185
|
 |
« Reply #44 on: August 26, 2009, 02:02:43 PM » |
|
I believe Bretzel is moving forward with his home grown syntax but I don't know how far he's gotten and I haven't seen him around lately.
Can you can give an example of YAML script or which ever language you think is best? perhaps translate Bretzel's example? It's hard to come to any conclusion without something to look at. Also do you know how the python library will translate the script? What will it return to the caller? One of the advantages of writing your own parser is that you control exactly how the data is put together when the script is read.
|
|
|
|
|
Logged
|
|
|
|
|