游戏辅助脚本编写

Let software tooling check the consistency of your roleplay scripts for you!

让软件工具为您检查角色扮演脚本的一致性!

(French version of this article available here on Electro-GN)

(本文的法语版本在 此处可在Electro-GN上找到 )

问题 (Issue)

Every  writer will confirm it to you: it is not easy to remain coherent when  you are working, for several months, on a long story. It is even less so  when the story in question is lived by dozens of characters, each with  their own partial vision of the truth. And live action roleplay games  (LARPs) are especially exposed to this problem.

每个作家都会向您确认:在长篇幅的研究中,要保持几个月的连续性并不容易。 当所讨论的故事由数十个角色生活时,情况就更是如此,每个角色对真理都有自己的部分看法。 真人角色扮演游戏(LARP)特别容易遇到此问题。

The  danger does not lie in the first draft of the writing: if he has all  his ideas well in place, the author does not risk much, except for a few  typos and interchanges of names. It is during subsequent modifications  (changes in the chronology of facts, additions of twists and turns,  etc.) that the information — disseminated and duplicated in the  documents of the various participants — will gradually become obsolete  and inconsistent. Eventually, even the character sheets of a common  “murder&mystery party” will end up full of spatial, temporal,  lexical and structural improbabilities if they are not rigorously  checked and compared after each evolution of the scenario.

危险并不在于撰写本文的初稿:如果他的所有观点都很好,那么作者除了冒几个错字和名字互换之外,不会冒险。 正是在随后的修改(事实的时间顺序变化,增加的曲折等)期间,在各个参与者的文档中传播和复制的信息将逐渐变得过时和不一致。 最终,如果不对场景进行每次演变后的严格检查和比较,即使是一个普通的“谋杀和神秘派对”的人物表,最终也会充满空间,时间,词汇和结构上的不可能性。

What can we do to prevent this, without spending a lifetime doing comparative proofreading? First, undoubtedly, deduplicate texts common to several players, which lead to tedious copy and paste (multiplying errors and artificially inflating the mass of the text). Then, allow the author to review the interdependent sets of changes he has successively applied to his scenario. Finally, give him summaries of key information, easier to review than verbose literary texts. And all this in as automated a way as possible,  because the number of documents to be managed can make the smallest  operation very time-consuming (and at risk of carelessness).

在不花一生的时间进行比较校对的情况下,我们可以做些什么来防止这种情况发生? 首先,毫无疑问, 对多个播放器通用的文本进行重复数据删除 ,这会导致繁琐的复制和粘贴操作(造成大量错误并人为地夸大了文本的质量)。 然后, 允许作者回顾他已经相继应用于场景的相互依赖的变化集 。 最后,给他一些关键信息的摘要,比冗长的文学文本更容易阅读。 所有这一切都以尽可能自动化的方式进行 ,因为要管理的文档数量可能会使最小的操作非常耗时(并且存在粗心大意的风险)。

pychronia工具机械的好处 (The benefits of Pychronia Tools machinery)

To benefit from these precious writing facilities during the creation of the Chrysalis:Mindstorm mystery party (French only), I set up a specific writing process,  involving simple text files (which contain the scenario), various  existing software tools, as well as a module “Pychronia Tools” developed  for the occasion.

为了在创建Chrysalis:Mindstorm神秘派对(仅法语)期间从这些宝贵的书写工具中受益,我设置了一个特定的书写过程,其中涉及简单的文本文件(包含脚本),各种现有的软件工具以及为此场合开发的模块“ Pychronia Tools”。

Once  this machinery is in place, all you have to do is start it up  and — magic — a hundred PDF files appear one after the other in the  output folder: game master’s manual, complete and summarized character  sheets for players, documents to print on beautiful scrolls to serve as  clues in play, summary sheets for extras….

一旦安装了这种机器,您所要做的就是启动它,而且很神奇,一百个PDF文件在输出文件夹中一个接一个地显示:游戏大师的手册,完整和摘要的玩家角色表,要打印的文件漂亮的卷轴可以作为游戏的线索,摘要页面可以作为额外的内容……。

This tool is much more than a simple document generator: it includes an automatic check of the script consistency.  Now, if an index is mentioned in one place but not provided in another,  or if the same symbol has different values from one file to another,  the error is reported. Extract of consistency errors returned by the program:

该工具不仅仅是一个简单的文档生成器,它还包括脚本一致性自动检查 。 现在,如果在一个地方提到一个索引但在另一个地方没有提供索引,或者同一符号在一个文件与另一个文件之间的值不同,则会报告错误。 程序返回的一致性错误的摘录:

!!! ERROR IN hints registry for key golden_box_with_blood : [‘needed’] requires a provided hint

!!! ERROR IN提示注册表中的Golden_box_with_blood键:['needed']需要提供提示

And  thanks to the automatically generated summary tables, it is possible to  check at a glance that each player is well informed of the facts  concerning him/her, that the distribution of key information is more or  less balanced, and that major events are correctly recorded in summary  sheets.

借助自动生成的摘要表,可以一目了然地检查每个玩家是否充分了解有关他/她的事实,关键信息的分配或多或少是平衡的以及重大事件的正确记录在摘要表中。

Extract from the automatic summary of the “facts” of the scenario:

从方案“事实”的自动摘要中摘录:

Character  names are in italics when they have the “fact” in question only in  their complete character sheet, not in their summary sheet.

当字符名称仅在完整字符表中而不是在摘要表中有问题的“事实”时,以斜体显示。

As  a result, the game master can rely quietly on his own (self-generated)  documents to set up and monitor the game: detailed scenario, evening  planning, checklist of materials and writings to be placed in the  premises, automatic summary of missions and special skills of each  player…

因此,游戏主管可以安静地依靠自己(自己生成的)文档来设置和监视游戏:详细的场景,夜间计划,要放置在场所中的材料和文字的清单,任务的自动摘要和每个球员的特殊技能

On  top of that, this machine can also send its game documents, by email,  to each player (e.g. character card and documents initially owned). This  avoids the drama that awaits each organizer: spoiling a participant by  sending him the wrong documents.

最重要的是,该机器还可以通过电子邮件将其游戏文档发送给每个玩家(例如角色卡和最初拥有的文档)。 这避免了等待每个组织者参加的戏剧:通过向参与者发送错误的文件来破坏参与者。

This  system obviously adds a certain complexity to the project, compared to  some common Word/LibreOffice files. But it provides invaluable support  in terms of scenario scalability and robustness, detecting  inconsistencies and automating daunting tasks. Personally, he saved me  more than once, when I switched the names of some characters in cards,  or forgot to warn some players of the new misdeeds they were supposed to  have committed in the past.

与某些常见的Word / LibreOffice文件相比,该系统显然给项目增加了一定的复杂性。 但是,它在方案可扩展性和健壮性,检测不一致之处以及自动执行艰巨任务方面提供了宝贵的支持。 就个人而言,当我切换卡片中某些角色的名称,或者忘记警告某些玩家过去应该犯下的新罪行时,他不止一次救了我。

如何建立这样的程序? (How to set up such a process?)

Step 1: Move away from rich office files (docx, odt, pdf…) to a plain text  format, easily manipulable, where the formatting is explicitly indicated  by special characters. The documents in game with  high graphic and typographical needs (posters, scrolls, newspapers…)  can be left aside, in more usual office automation files: Word,  LibreOffice, InDesign…

步骤1:从丰富的Office文件(docx,odt,pdf等)转移到易于操作的纯文本格式,其中的格式由特殊字符明确指示。 可以将具有较高图形和印刷要求的游戏文档(海报,卷轴,报纸等)放在更常用的办公自动化文件中:Word,LibreOffice,InDesign ...

Example of plain text (restructuredtext format):

纯文本示例(重组文本格式):

Manuel du Maître de Jeu
############################

.. contents:: Table des Matières
    :depth: 2

Concept de la soirée mystère
================================

**Chrysalis:Mindstorm** est un huis clos entre `enquête 
<https://fr.wikipedia/wiki/Enqu%C3%AAte>`_ criminelle et conflit
géopolitique, où des agents secrets et des civils de divers pays se 
retrouvent face à un *redoutable* inspecteur de police, qui va les 
pousser dans leurs derniers retranchements.

Rendering of this text once converted to PDF:

将此文本的渲染一旦转换为PDF:

Step 2: Use a version manager for scenario files. This makes it possible to go  back in time at any time, to avoid horrifying accidental file  modifications, and to check the consistency of each of the changes made  (renaming a place, adding information for a group of players…).

步骤2:对方案文件使用版本管理器。 这样就可以随时返回时间,避免对意外的文件修改造成恐惧,并可以检查所做的每个更改的一致性(重新命名,为一组玩家添加信息……)。

Viewing a change made to the rules of the game:

查看对游戏规则所做的更改:

Step 3: Add  a small processing engine, to enrich the text with simple and practical  features: allow one file to include another, define reusable text  blocks, insert variables (e. g. the date of a crucial event, different  for each session of the mystery evening), display different information  according to the team to which the targeted player belongs….

第3步:添加一个小型处理引擎,以简单实用的功能丰富文本:允许一个文件包含另一个文件,定义可重复使用的文本块,插入变量(例如,关键事件的日期,每个神秘夜晚的会话都不同) ),根据目标玩家所属的团队显示不同的信息…。

Step 4: Automate consistency checks. To do this, I created specific tags in the processing engine, which I then inserted as I wrote: — The  {% fact %} tag is used to announce a fact (e. g. “so-and-so tried to  rob Loyd Georges”), and to indicate whether the player is the author or  just a witness. — The {% hint %} tag allows you to request the existence of a physical clue (letter, object…) to give to the player. — The  {% symbol %} tag ensures that a value is unique in all scenario files  (e. g. the exact time of a crime), while avoiding the use of “variables”  that obscure the text.

步骤4:自动执行一致性检查。 为此,我在处理引擎中创建了特定的标签,然后在编写时将其插入:— {%fact%}标签用于宣布事实(例如“某某试图抢劫Loyd Georges”) ,并指出玩家是作者还是见证人。 — {%hint%}标签允许您请求要提供给播放器的物理提示(字母,对象……)。 — {%symbol%}标签可确保值在所有方案文件中都是唯一的(例如,犯罪的确切时间),同时避免使用使文本模糊的“变量”。

Example of using special tags to enrich a scenario text:

使用特殊标签丰富场景文本的示例:

To  the attention of {{agent_gamma_fake_name }} : the country of {% symbol  “Balberith” for “first_country_at_war” %} has entered the war, following  the plot led by agent Epsilon {% fact “agent_epsilon_triggered_war” as  author %}. You have a testimony signed by him and attesting to it. {%  hint “epsilon_signed_testimony_for_agent_gamma” is needed %}.
请注意{{agent_gamma_fake_name}}:在代理商Epsilon领导的阴谋{%fact“ agent_epsilon_triggered_war”作为作者%}之后,{%符号“ Balberith”代表“ first_country_at_war”%}的国家已进入战争。 您有他签署并作证的证词。 {%需要提示“ epsilon_signed_testimony_for_agent_gamma”%}。

As  we can see, these tags each have their own syntax, and can use other  features of the processing engine, such as variables (of which we have  an example with {{agent_gamma_fake_name }}).

如我们所见,这些标记各自具有自己的语法,并且可以使用处理引擎的其他功能,例如变量(我们有一个带有{{agent_gamma_fake_name}}的示例)。

Step 5: Link  all this with scripts, which will automate the different steps of  creating game documents: gathering useful data (including player  photos), distributing scenario pages for each participant (global  context, personal context, game rules…), transforming them into PDF  format, and generating summary sheets for the game master.

步骤5:通过脚本将所有这些链接起来,这将自动执行创建游戏文档的不同步骤:收集有用的数据(包括玩家照片),为每个参与者分发场景页面(全局上下文,个人上下文,游戏规则等),并将其转换为PDF格式,并为游戏管理员生成摘要表。

Some of the PDF documents generated, next to their plain text sources:

生成的一些PDF文档(纯文本源旁边):

未来 (The future)

All this is all well and good, but what about the rest of the role-playing  community? Can it benefit, more broadly, from the functionalities  offered by this scriptwriting support system?

所有这一切都很好,但是其余的角色扮演社区又如何呢? 它可以从此脚本支持系统提供的功能中更广泛地受益吗?

The  answer is yes. However, as seen in the steps above, this tooling  requires a certain affinity with processes that are usually reserved for  computer development; an affinity that many GN authors do not have.

答案是肯定的。 但是,如上述步骤所示,此工具要求与通常为计算机开发保留的过程具有一定的亲和力。 许多GN作者没有的亲和力。

I  am therefore listening to authors tempted by the experience, in order  to see with them how they work, what formats and tools they are able to  use, and how this system could be generalized to suit their use. I could  then see to extract this code (which is currently strongly linked to  the structure of the Chrysalis game files), to make it more autonomous  and more easily deployable.

因此,我在听那些受经验吸引的作者,以便与他们一起了解他们的工作方式,他们可以使用的格式和工具,以及可以如何推广该系统以适合他们的使用。 然后,我可以看到提取该代码(当前已与Chrysalis游戏文件的结构紧密链接),以使其更加自治且更易于部署。

Note that software such as Twine already allows scenarios to be created in a fairly simple way, with a  mini-language to define variables and use logical operations. Pychronia  Tools machinery therefore only makes sense for the very high level of  integration it offers, with its automated consistency checks and  end-to-end generation scripts.

请注意,诸如Twine之类的软件已经允许以相当简单的方式创建方案,并使用迷你语言来定义变量和使用逻辑运算。 因此,Pychronia Tools机械仅通过其自动一致性检查和端到端生成脚本,对其提供的很高的集成水平才有意义。

Interested in this scriptwriting support system? Feel free to contact me using the information on the Chrysalis Website.

对这个脚本支持系统感兴趣? 请使用蝶ry网站上的信息随时与我联系。

附录:有计算机知识者的详细信息 (Appendix : Details for computer literate people)

My machinery is based on the Python language and its document manipulation/creation ecosystem.

我的机器基于Python语言及其文档操纵/创建生态系统。

As  for the “plain text” format of the scenario, many “markup languages”  can be used for this purpose: restructuredtext, markdown, textile,  latex, or even html… I chose restructuredtext for  its clarity, versatility, and its advanced integration with the Python  language. To edit these text files, of course, Pycharm, Notepad++,  Geany, or a simple notebook can do the trick.

至于场景的“纯文本”格式,许多“标记语言”可用于此目的:重组文本,降价,纺织品,乳胶甚至是html……我选择重组文本是因为其清晰,通用性强并且与Python语言。 要编辑这些文本文件,当然可以使用Pycharm,Notepad ++,Geany或简单的笔记本来完成。

For  the version manager (or “VCS”), I chose Git and its excellent  TortoiseGit graphical interface (available under Windows only  unfortunately). Mercurial, Bazaar, DARCS, or others are just as  relevant. At a minimum, we can use the versioned file backup proposed by  Dropbox et al., even if it offers only a few features to visualize the  differences between several writing steps…

对于版本管理器(或“ VCS”),我选择了Git及其出色的TortoiseGit图形界面(不幸的是,仅在Windows下可用)。 Mercurial,Bazaar,DARCS或其他也与此相关。 至少,我们可以使用Dropbox等人建议的版本化文件备份,即使它仅提供一些功能以可视化多个编写步骤之间的差异也是如此...

Visualization, via GIT, of the sets of modifications made to the scenario:

通过GIT可视化对该场景所做的修改:

Regarding the template engine used to process text files (and for specific tags), finally, I have integrated the powerful Jinja2,  which allows you to create variables and macros directly in the  templates. The data handled by this engine comes, in my case, from a  tree structure of Yaml files, but many other sources (python file, csv,  xml…) are very easily integrated.

最后,关于用于处理文本文件(以及特定标签)的模板引擎,我已经集成了功能强大的Jinja2 ,它允许您直接在模板中创建变量和宏。 在我的情况下,此引擎处理的数据来自Yaml文件的树结构,但是很容易集成许多其他来源(python文件,csv,xml等)。

翻译自: https://www.freecodecamp/news/assisted-script-writing-with-pychronia-tools/

游戏辅助脚本编写

更多推荐

游戏辅助脚本编写_使用Pychronia工具进行辅助脚本编写