<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Upthorn</id>
	<title>The Battle for Wesnoth Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Upthorn"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Upthorn"/>
	<updated>2026-04-15T05:01:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42253</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42253"/>
		<updated>2011-04-17T14:29:33Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49222] -- corrects a long-standing bug which caused MSVC9 compiled Wesnoth to crash when parsing a [trait] that lacks a description&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49223 Revision 49223] -- exposes suitable_keep() c++ AI helper function to the Lua AI library.&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49236 Revision 49236] -- updates suitable_keep() Lua AI handler not to use obsolete code pattern shown in other Lua AI function handlers.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 27th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile (by July 20th)&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from. (By July 27th)&lt;br /&gt;
**Milestone: By July 27th Lua scripts can be called in multiple modules with minimal additional overhead&lt;br /&gt;
*July 27th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications (By August 2nd)&lt;br /&gt;
*# Implement group tag (By August 19th)&lt;br /&gt;
*## Extend WML engine to parse and process [group] (By August 7th)&lt;br /&gt;
*## Extend Lua interface to support group-based commands (Due by August 14th)&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups (by August 19th)&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent(by August 26th)&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 20th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 20th - July 15th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by July 27th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by July 27th&lt;br /&gt;
#** Script manager tracks files loaded by wesnoth.dofile and wesnoth.require -- Due by July 20th&lt;br /&gt;
#** Script manager compares new requests to files already loaded, and return reference to the loaded file -- Due by July 27th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 2nd&lt;br /&gt;
#* Implement grouping -- Due By August 26th&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 7th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 14th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 19th&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extensions==&lt;br /&gt;
===[group] tag===&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
My current thinking is that a group tag will look like this&lt;br /&gt;
    [group]&lt;br /&gt;
      id=some_group_identifier&lt;br /&gt;
      automatic=no&lt;br /&gt;
      [filter]&lt;br /&gt;
        {optional [[StandardUnitFilter]]}&lt;br /&gt;
      [/filter]&lt;br /&gt;
      [ai]&lt;br /&gt;
        {optional [[AiWML|AI specification]]}&lt;br /&gt;
      [/ai]      &lt;br /&gt;
    [/group]&lt;br /&gt;
&lt;br /&gt;
The id element is the only mandatory element of the group tag. The other tags specify certain automated behaviors that apply to the group. An explanation of each element follows:&lt;br /&gt;
&lt;br /&gt;
=====id=====&lt;br /&gt;
A group id will be some locally unique identifier for the group. This is the name that will be used to issue orders to members of the group, or to add or remove units from the group's membership.&lt;br /&gt;
&lt;br /&gt;
=====automatic=====&lt;br /&gt;
The element &amp;quot;automatic&amp;quot; is a boolean element that specifies whether the wesnoth game engine should track and update the group's membership according to a supplied [[StandardUnitFilter]].&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is &amp;quot;no&amp;quot;, and a value of &amp;quot;yes&amp;quot; requires that the group have a [[StandardUnitFilter]] associated.&lt;br /&gt;
&lt;br /&gt;
=====[filter]=====&lt;br /&gt;
This child tag will specify a [[StandardUnitFilter]] to which the group membership should be applied. &amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is yes, the [filter] tag is mandatory, and group membership will automatically be updated such that all units matching the filter are considered members, and no units not matching the filter are.&amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is no, units matching the filter will be added to the [group] at the time of the group's formation, but any further additions to or removals from the group will require an explicit WML or Lua command.&lt;br /&gt;
&lt;br /&gt;
=====[ai]=====&lt;br /&gt;
This optional child tag will specify a supplementary ai to control member units. Groups without an [ai] child tag will be controlled by the overall [side] ai.&lt;br /&gt;
&lt;br /&gt;
===[[UnitWML]] extension===&lt;br /&gt;
To facilitate the use of groups, I propose to extend Unit data to include a subtag [ai_groups]&lt;br /&gt;
====Basic Structure====&lt;br /&gt;
The basic structure of the [ai_groups] tag will be as follows&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=some_group_identifier&lt;br /&gt;
      ...&lt;br /&gt;
      n=yet_another_group_identifier&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
Each element shall be a number, associated with the id of an extant and valid [group] tag. The number shall be the priority of group membership, such that if two groups are issued conflicting orders, a unit with membership in both gruops will only follow commands issued to the group with the lowest priority number.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, assume an elven archer unit is assigned to a &amp;quot;forest_patrol&amp;quot; group and a &amp;quot;ranged_units&amp;quot; group such that&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
A command is issued to forest_patrol for all member units to move along a circular route within a particular patch of forest and a command is then issued to ranged_units to assault the enemy keep.&lt;br /&gt;
The elven archer in question will ignore the command issued to ranged_units and continue to walk along its circular patrol.&amp;lt;br/&amp;gt;&lt;br /&gt;
If, instead, the command issued to ranged_units was to prefer attacking swordsmen over archers, the elven archer in question would obey both orders, walking along its circular patrol, and attacking swordsmen in its range, but not archers.&lt;br /&gt;
&lt;br /&gt;
===[group] modification actions===&lt;br /&gt;
In addition to the wml extensions specified above, I propose a set of actions to allow WML authors to maintain groups manually.&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [delete_group]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/delete_group]&lt;br /&gt;
&lt;br /&gt;
    [set_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      [ai]&lt;br /&gt;
        [[AiWML|AI Specification]]&lt;br /&gt;
      [/ai]&lt;br /&gt;
    [/set_group_ai]&lt;br /&gt;
&lt;br /&gt;
    [clear_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/clear_group_ai]&lt;br /&gt;
&lt;br /&gt;
[add_to_group] adds a single unit (specified in unit_id), or all units matching a [filter] to a group (specified in group_id). If the group does not exist it will be created. The optional priority element specifies what priority level to mark the new group memberships, and defaults to 1. The new membership will take priority over existing memberships with equal or lesser priority value.&amp;lt;br/&amp;gt;&lt;br /&gt;
For instance, taking the elven_archer from our previous example, if we run&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=elven_archer&lt;br /&gt;
      group_id=test_group&lt;br /&gt;
      priority=2&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
the elven_archer's resulting memberships will be&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=test_group&lt;br /&gt;
      3=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
[remove_from_group] removes a single unit (specified in unit_id), or all units matching a [filter] from a group (specified in group_id). If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[clear_groups] removes a single unit (specified in unit_id), or all units matching a [filter] from all current groups.&lt;br /&gt;
spec&lt;br /&gt;
[delete_group] destroys a current group (specified in group_id) and removes all units from its membership. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[set_group_ai] changes the supplementary ai running in a current group (specified in group_id) to the one specified in the [ai] child tag. If the group does not exist, it will be created.&lt;br /&gt;
&lt;br /&gt;
[clear_group_ai] removes the supplementary ai running in a current group (specified in group_id) and reverts all members to the overall [side] ai. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
Additionally these actions shall all be callable from Lua.&lt;br /&gt;
&lt;br /&gt;
===[[StandardUnitFilter]] extension===&lt;br /&gt;
In order to address units by group membership, I propose to add a &amp;quot;group&amp;quot; attribute to allowable unit filters. A [filter] containing a group attribute will only return units that are members of the group whose id is specified in the attribute.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42252</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42252"/>
		<updated>2011-04-17T14:13:26Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49222] -- corrects a long-standing bug which caused MSVC9 compiled Wesnoth to crash when parsing a [trait] that lacks a description&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49223 Revision 49223] -- exposes suitable_keep() c++ AI helper function to the Lua AI library.&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49223 Revision 49236] -- updates suitable_keep() Lua AI handler not to use obsolete code pattern shown in other Lua AI function handlers.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 27th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile (by July 20th)&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from. (By July 27th)&lt;br /&gt;
**Milestone: By July 27th Lua scripts can be called in multiple modules with minimal additional overhead&lt;br /&gt;
*July 27th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications (By August 2nd)&lt;br /&gt;
*# Implement group tag (By August 19th)&lt;br /&gt;
*## Extend WML engine to parse and process [group] (By August 7th)&lt;br /&gt;
*## Extend Lua interface to support group-based commands (Due by August 14th)&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups (by August 19th)&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent(by August 26th)&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 20th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 20th - July 15th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by July 27th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by July 27th&lt;br /&gt;
#** Script manager tracks files loaded by wesnoth.dofile and wesnoth.require -- Due by July 20th&lt;br /&gt;
#** Script manager compares new requests to files already loaded, and return reference to the loaded file -- Due by July 27th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 2nd&lt;br /&gt;
#* Implement grouping -- Due By August 26th&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 7th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 14th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 19th&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extensions==&lt;br /&gt;
===[group] tag===&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
My current thinking is that a group tag will look like this&lt;br /&gt;
    [group]&lt;br /&gt;
      id=some_group_identifier&lt;br /&gt;
      automatic=no&lt;br /&gt;
      [filter]&lt;br /&gt;
        {optional [[StandardUnitFilter]]}&lt;br /&gt;
      [/filter]&lt;br /&gt;
      [ai]&lt;br /&gt;
        {optional [[AiWML|AI specification]]}&lt;br /&gt;
      [/ai]      &lt;br /&gt;
    [/group]&lt;br /&gt;
&lt;br /&gt;
The id element is the only mandatory element of the group tag. The other tags specify certain automated behaviors that apply to the group. An explanation of each element follows:&lt;br /&gt;
&lt;br /&gt;
=====id=====&lt;br /&gt;
A group id will be some locally unique identifier for the group. This is the name that will be used to issue orders to members of the group, or to add or remove units from the group's membership.&lt;br /&gt;
&lt;br /&gt;
=====automatic=====&lt;br /&gt;
The element &amp;quot;automatic&amp;quot; is a boolean element that specifies whether the wesnoth game engine should track and update the group's membership according to a supplied [[StandardUnitFilter]].&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is &amp;quot;no&amp;quot;, and a value of &amp;quot;yes&amp;quot; requires that the group have a [[StandardUnitFilter]] associated.&lt;br /&gt;
&lt;br /&gt;
=====[filter]=====&lt;br /&gt;
This child tag will specify a [[StandardUnitFilter]] to which the group membership should be applied. &amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is yes, the [filter] tag is mandatory, and group membership will automatically be updated such that all units matching the filter are considered members, and no units not matching the filter are.&amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is no, units matching the filter will be added to the [group] at the time of the group's formation, but any further additions to or removals from the group will require an explicit WML or Lua command.&lt;br /&gt;
&lt;br /&gt;
=====[ai]=====&lt;br /&gt;
This optional child tag will specify a supplementary ai to control member units. Groups without an [ai] child tag will be controlled by the overall [side] ai.&lt;br /&gt;
&lt;br /&gt;
===[[UnitWML]] extension===&lt;br /&gt;
To facilitate the use of groups, I propose to extend Unit data to include a subtag [ai_groups]&lt;br /&gt;
====Basic Structure====&lt;br /&gt;
The basic structure of the [ai_groups] tag will be as follows&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=some_group_identifier&lt;br /&gt;
      ...&lt;br /&gt;
      n=yet_another_group_identifier&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
Each element shall be a number, associated with the id of an extant and valid [group] tag. The number shall be the priority of group membership, such that if two groups are issued conflicting orders, a unit with membership in both gruops will only follow commands issued to the group with the lowest priority number.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, assume an elven archer unit is assigned to a &amp;quot;forest_patrol&amp;quot; group and a &amp;quot;ranged_units&amp;quot; group such that&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
A command is issued to forest_patrol for all member units to move along a circular route within a particular patch of forest and a command is then issued to ranged_units to assault the enemy keep.&lt;br /&gt;
The elven archer in question will ignore the command issued to ranged_units and continue to walk along its circular patrol.&amp;lt;br/&amp;gt;&lt;br /&gt;
If, instead, the command issued to ranged_units was to prefer attacking swordsmen over archers, the elven archer in question would obey both orders, walking along its circular patrol, and attacking swordsmen in its range, but not archers.&lt;br /&gt;
&lt;br /&gt;
===[group] modification actions===&lt;br /&gt;
In addition to the wml extensions specified above, I propose a set of actions to allow WML authors to maintain groups manually.&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [delete_group]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/delete_group]&lt;br /&gt;
&lt;br /&gt;
    [set_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      [ai]&lt;br /&gt;
        [[AiWML|AI Specification]]&lt;br /&gt;
      [/ai]&lt;br /&gt;
    [/set_group_ai]&lt;br /&gt;
&lt;br /&gt;
    [clear_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/clear_group_ai]&lt;br /&gt;
&lt;br /&gt;
[add_to_group] adds a single unit (specified in unit_id), or all units matching a [filter] to a group (specified in group_id). If the group does not exist it will be created. The optional priority element specifies what priority level to mark the new group memberships, and defaults to 1. The new membership will take priority over existing memberships with equal or lesser priority value.&amp;lt;br/&amp;gt;&lt;br /&gt;
For instance, taking the elven_archer from our previous example, if we run&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=elven_archer&lt;br /&gt;
      group_id=test_group&lt;br /&gt;
      priority=2&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
the elven_archer's resulting memberships will be&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=test_group&lt;br /&gt;
      3=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
[remove_from_group] removes a single unit (specified in unit_id), or all units matching a [filter] from a group (specified in group_id). If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[clear_groups] removes a single unit (specified in unit_id), or all units matching a [filter] from all current groups.&lt;br /&gt;
spec&lt;br /&gt;
[delete_group] destroys a current group (specified in group_id) and removes all units from its membership. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[set_group_ai] changes the supplementary ai running in a current group (specified in group_id) to the one specified in the [ai] child tag. If the group does not exist, it will be created.&lt;br /&gt;
&lt;br /&gt;
[clear_group_ai] removes the supplementary ai running in a current group (specified in group_id) and reverts all members to the overall [side] ai. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
Additionally these actions shall all be callable from Lua.&lt;br /&gt;
&lt;br /&gt;
===[[StandardUnitFilter]] extension===&lt;br /&gt;
In order to address units by group membership, I propose to add a &amp;quot;group&amp;quot; attribute to allowable unit filters. A [filter] containing a group attribute will only return units that are members of the group whose id is specified in the attribute.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42193</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42193"/>
		<updated>2011-04-16T18:22:44Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Deliverables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49222] -- corrects a long-standing bug which caused MSVC9 compiled Wesnoth to crash when parsing a [trait] that lacks a description&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49223] -- exposes suitable_keep() c++ AI helper function to the Lua AI library.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 27th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile (by July 20th)&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from. (By July 27th)&lt;br /&gt;
**Milestone: By July 27th Lua scripts can be called in multiple modules with minimal additional overhead&lt;br /&gt;
*July 27th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications (By August 2nd)&lt;br /&gt;
*# Implement group tag (By August 19th)&lt;br /&gt;
*## Extend WML engine to parse and process [group] (By August 7th)&lt;br /&gt;
*## Extend Lua interface to support group-based commands (Due by August 14th)&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups (by August 19th)&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent(by August 26th)&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 20th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 20th - July 15th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by July 27th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by July 27th&lt;br /&gt;
#** Script manager tracks files loaded by wesnoth.dofile and wesnoth.require -- Due by July 20th&lt;br /&gt;
#** Script manager compares new requests to files already loaded, and return reference to the loaded file -- Due by July 27th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 2nd&lt;br /&gt;
#* Implement grouping -- Due By August 26th&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 7th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 14th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 19th&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extensions==&lt;br /&gt;
===[group] tag===&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
My current thinking is that a group tag will look like this&lt;br /&gt;
    [group]&lt;br /&gt;
      id=some_group_identifier&lt;br /&gt;
      automatic=no&lt;br /&gt;
      [filter]&lt;br /&gt;
        {optional [[StandardUnitFilter]]}&lt;br /&gt;
      [/filter]&lt;br /&gt;
      [ai]&lt;br /&gt;
        {optional [[AiWML|AI specification]]}&lt;br /&gt;
      [/ai]      &lt;br /&gt;
    [/group]&lt;br /&gt;
&lt;br /&gt;
The id element is the only mandatory element of the group tag. The other tags specify certain automated behaviors that apply to the group. An explanation of each element follows:&lt;br /&gt;
&lt;br /&gt;
=====id=====&lt;br /&gt;
A group id will be some locally unique identifier for the group. This is the name that will be used to issue orders to members of the group, or to add or remove units from the group's membership.&lt;br /&gt;
&lt;br /&gt;
=====automatic=====&lt;br /&gt;
The element &amp;quot;automatic&amp;quot; is a boolean element that specifies whether the wesnoth game engine should track and update the group's membership according to a supplied [[StandardUnitFilter]].&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is &amp;quot;no&amp;quot;, and a value of &amp;quot;yes&amp;quot; requires that the group have a [[StandardUnitFilter]] associated.&lt;br /&gt;
&lt;br /&gt;
=====[filter]=====&lt;br /&gt;
This child tag will specify a [[StandardUnitFilter]] to which the group membership should be applied. &amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is yes, the [filter] tag is mandatory, and group membership will automatically be updated such that all units matching the filter are considered members, and no units not matching the filter are.&amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is no, units matching the filter will be added to the [group] at the time of the group's formation, but any further additions to or removals from the group will require an explicit WML or Lua command.&lt;br /&gt;
&lt;br /&gt;
=====[ai]=====&lt;br /&gt;
This optional child tag will specify a supplementary ai to control member units. Groups without an [ai] child tag will be controlled by the overall [side] ai.&lt;br /&gt;
&lt;br /&gt;
===[[UnitWML]] extension===&lt;br /&gt;
To facilitate the use of groups, I propose to extend Unit data to include a subtag [ai_groups]&lt;br /&gt;
====Basic Structure====&lt;br /&gt;
The basic structure of the [ai_groups] tag will be as follows&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=some_group_identifier&lt;br /&gt;
      ...&lt;br /&gt;
      n=yet_another_group_identifier&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
Each element shall be a number, associated with the id of an extant and valid [group] tag. The number shall be the priority of group membership, such that if two groups are issued conflicting orders, a unit with membership in both gruops will only follow commands issued to the group with the lowest priority number.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, assume an elven archer unit is assigned to a &amp;quot;forest_patrol&amp;quot; group and a &amp;quot;ranged_units&amp;quot; group such that&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
A command is issued to forest_patrol for all member units to move along a circular route within a particular patch of forest and a command is then issued to ranged_units to assault the enemy keep.&lt;br /&gt;
The elven archer in question will ignore the command issued to ranged_units and continue to walk along its circular patrol.&amp;lt;br/&amp;gt;&lt;br /&gt;
If, instead, the command issued to ranged_units was to prefer attacking swordsmen over archers, the elven archer in question would obey both orders, walking along its circular patrol, and attacking swordsmen in its range, but not archers.&lt;br /&gt;
&lt;br /&gt;
===[group] modification actions===&lt;br /&gt;
In addition to the wml extensions specified above, I propose a set of actions to allow WML authors to maintain groups manually.&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [delete_group]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/delete_group]&lt;br /&gt;
&lt;br /&gt;
    [set_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      [ai]&lt;br /&gt;
        [[AiWML|AI Specification]]&lt;br /&gt;
      [/ai]&lt;br /&gt;
    [/set_group_ai]&lt;br /&gt;
&lt;br /&gt;
    [clear_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/clear_group_ai]&lt;br /&gt;
&lt;br /&gt;
[add_to_group] adds a single unit (specified in unit_id), or all units matching a [filter] to a group (specified in group_id). If the group does not exist it will be created. The optional priority element specifies what priority level to mark the new group memberships, and defaults to 1. The new membership will take priority over existing memberships with equal or lesser priority value.&amp;lt;br/&amp;gt;&lt;br /&gt;
For instance, taking the elven_archer from our previous example, if we run&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=elven_archer&lt;br /&gt;
      group_id=test_group&lt;br /&gt;
      priority=2&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
the elven_archer's resulting memberships will be&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=test_group&lt;br /&gt;
      3=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
[remove_from_group] removes a single unit (specified in unit_id), or all units matching a [filter] from a group (specified in group_id). If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[clear_groups] removes a single unit (specified in unit_id), or all units matching a [filter] from all current groups.&lt;br /&gt;
spec&lt;br /&gt;
[delete_group] destroys a current group (specified in group_id) and removes all units from its membership. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[set_group_ai] changes the supplementary ai running in a current group (specified in group_id) to the one specified in the [ai] child tag. If the group does not exist, it will be created.&lt;br /&gt;
&lt;br /&gt;
[clear_group_ai] removes the supplementary ai running in a current group (specified in group_id) and reverts all members to the overall [side] ai. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
Additionally these actions shall all be callable from Lua.&lt;br /&gt;
&lt;br /&gt;
===[[StandardUnitFilter]] extension===&lt;br /&gt;
In order to address units by group membership, I propose to add a &amp;quot;group&amp;quot; attribute to allowable unit filters. A [filter] containing a group attribute will only return units that are members of the group whose id is specified in the attribute.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42192</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42192"/>
		<updated>2011-04-16T18:22:37Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49222] -- corrects a long-standing bug which caused MSVC9 compiled Wesnoth to crash when parsing a [trait] that lacks a description&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49223] -- exposes suitable_keep() c++ AI helper function to the Lua AI library.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 27th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile (by July 20th)&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from. (By July 27th)&lt;br /&gt;
**Milestone: By July 27th Lua scripts can be called in multiple modules with minimal additional overhead&lt;br /&gt;
*July 27th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications (By August 2nd)&lt;br /&gt;
*# Implement group tag (By August 19th)&lt;br /&gt;
*## Extend WML engine to parse and process [group] (By August 7th)&lt;br /&gt;
*## Extend Lua interface to support group-based commands (Due by August 14th)&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups (by August 19th)&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent(by August 26th)&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 20th: &lt;br /&gt;
*# Implement Lua script manager to track files loaded by wesnoth.require and wesnoth.dofile&lt;br /&gt;
*# Ensure that each such external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 20th - July 15th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by August 5th&lt;br /&gt;
#* Basic functionality of &amp;quot;source&amp;quot; element in [Lua] tags and [AI] tags with engine=&amp;quot;Lua&amp;quot; -- Due by July 25th&lt;br /&gt;
#** WML properly parses &amp;quot;source&amp;quot; element and passes file contents to Lua engine -- Due by July 22nd&lt;br /&gt;
#** Source element syntax and usage is thoroughly documented on -- Due by July 25th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by August 5th&lt;br /&gt;
#** Script manager to store path of scripts on first load, compare new requests to files already loaded, and return reference to the loaded file -- Due by August 5th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 10th&lt;br /&gt;
#* Implement grouping -- Due By August 22nd&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 12th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 17th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 22nd&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extensions==&lt;br /&gt;
===[group] tag===&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
My current thinking is that a group tag will look like this&lt;br /&gt;
    [group]&lt;br /&gt;
      id=some_group_identifier&lt;br /&gt;
      automatic=no&lt;br /&gt;
      [filter]&lt;br /&gt;
        {optional [[StandardUnitFilter]]}&lt;br /&gt;
      [/filter]&lt;br /&gt;
      [ai]&lt;br /&gt;
        {optional [[AiWML|AI specification]]}&lt;br /&gt;
      [/ai]      &lt;br /&gt;
    [/group]&lt;br /&gt;
&lt;br /&gt;
The id element is the only mandatory element of the group tag. The other tags specify certain automated behaviors that apply to the group. An explanation of each element follows:&lt;br /&gt;
&lt;br /&gt;
=====id=====&lt;br /&gt;
A group id will be some locally unique identifier for the group. This is the name that will be used to issue orders to members of the group, or to add or remove units from the group's membership.&lt;br /&gt;
&lt;br /&gt;
=====automatic=====&lt;br /&gt;
The element &amp;quot;automatic&amp;quot; is a boolean element that specifies whether the wesnoth game engine should track and update the group's membership according to a supplied [[StandardUnitFilter]].&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is &amp;quot;no&amp;quot;, and a value of &amp;quot;yes&amp;quot; requires that the group have a [[StandardUnitFilter]] associated.&lt;br /&gt;
&lt;br /&gt;
=====[filter]=====&lt;br /&gt;
This child tag will specify a [[StandardUnitFilter]] to which the group membership should be applied. &amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is yes, the [filter] tag is mandatory, and group membership will automatically be updated such that all units matching the filter are considered members, and no units not matching the filter are.&amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is no, units matching the filter will be added to the [group] at the time of the group's formation, but any further additions to or removals from the group will require an explicit WML or Lua command.&lt;br /&gt;
&lt;br /&gt;
=====[ai]=====&lt;br /&gt;
This optional child tag will specify a supplementary ai to control member units. Groups without an [ai] child tag will be controlled by the overall [side] ai.&lt;br /&gt;
&lt;br /&gt;
===[[UnitWML]] extension===&lt;br /&gt;
To facilitate the use of groups, I propose to extend Unit data to include a subtag [ai_groups]&lt;br /&gt;
====Basic Structure====&lt;br /&gt;
The basic structure of the [ai_groups] tag will be as follows&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=some_group_identifier&lt;br /&gt;
      ...&lt;br /&gt;
      n=yet_another_group_identifier&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
Each element shall be a number, associated with the id of an extant and valid [group] tag. The number shall be the priority of group membership, such that if two groups are issued conflicting orders, a unit with membership in both gruops will only follow commands issued to the group with the lowest priority number.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, assume an elven archer unit is assigned to a &amp;quot;forest_patrol&amp;quot; group and a &amp;quot;ranged_units&amp;quot; group such that&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
A command is issued to forest_patrol for all member units to move along a circular route within a particular patch of forest and a command is then issued to ranged_units to assault the enemy keep.&lt;br /&gt;
The elven archer in question will ignore the command issued to ranged_units and continue to walk along its circular patrol.&amp;lt;br/&amp;gt;&lt;br /&gt;
If, instead, the command issued to ranged_units was to prefer attacking swordsmen over archers, the elven archer in question would obey both orders, walking along its circular patrol, and attacking swordsmen in its range, but not archers.&lt;br /&gt;
&lt;br /&gt;
===[group] modification actions===&lt;br /&gt;
In addition to the wml extensions specified above, I propose a set of actions to allow WML authors to maintain groups manually.&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [delete_group]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/delete_group]&lt;br /&gt;
&lt;br /&gt;
    [set_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      [ai]&lt;br /&gt;
        [[AiWML|AI Specification]]&lt;br /&gt;
      [/ai]&lt;br /&gt;
    [/set_group_ai]&lt;br /&gt;
&lt;br /&gt;
    [clear_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/clear_group_ai]&lt;br /&gt;
&lt;br /&gt;
[add_to_group] adds a single unit (specified in unit_id), or all units matching a [filter] to a group (specified in group_id). If the group does not exist it will be created. The optional priority element specifies what priority level to mark the new group memberships, and defaults to 1. The new membership will take priority over existing memberships with equal or lesser priority value.&amp;lt;br/&amp;gt;&lt;br /&gt;
For instance, taking the elven_archer from our previous example, if we run&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=elven_archer&lt;br /&gt;
      group_id=test_group&lt;br /&gt;
      priority=2&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
the elven_archer's resulting memberships will be&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=test_group&lt;br /&gt;
      3=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
[remove_from_group] removes a single unit (specified in unit_id), or all units matching a [filter] from a group (specified in group_id). If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[clear_groups] removes a single unit (specified in unit_id), or all units matching a [filter] from all current groups.&lt;br /&gt;
spec&lt;br /&gt;
[delete_group] destroys a current group (specified in group_id) and removes all units from its membership. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[set_group_ai] changes the supplementary ai running in a current group (specified in group_id) to the one specified in the [ai] child tag. If the group does not exist, it will be created.&lt;br /&gt;
&lt;br /&gt;
[clear_group_ai] removes the supplementary ai running in a current group (specified in group_id) and reverts all members to the overall [side] ai. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
Additionally these actions shall all be callable from Lua.&lt;br /&gt;
&lt;br /&gt;
===[[StandardUnitFilter]] extension===&lt;br /&gt;
In order to address units by group membership, I propose to add a &amp;quot;group&amp;quot; attribute to allowable unit filters. A [filter] containing a group attribute will only return units that are members of the group whose id is specified in the attribute.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42183</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42183"/>
		<updated>2011-04-16T02:35:16Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49222] -- corrects a long-standing bug which caused MSVC9 compiled Wesnoth to crash when parsing a [trait] that lacks a description&lt;br /&gt;
* [http://svn.gna.org/viewcvs/wesnoth?view=rev&amp;amp;revision=49222 Revision 49223] -- exposes suitable_keep() c++ AI helper function to the Lua AI library.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 25th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements - By July 22nd&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete - By July 25th&lt;br /&gt;
**Milestone: By July 25th, WML authors can easily include Lua code that is not embedded directly in the WML file&lt;br /&gt;
*July 25th-August 5th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*August 5th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications -- By August 10th&lt;br /&gt;
*# Implement group tag -- By August 22nd&lt;br /&gt;
*## Extend WML engine to parse and process [group] -- By August 12th&lt;br /&gt;
*## Extend Lua interface to support group-based commands -- Due by August 17th&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups -- Due by August 22nd&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 19th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete&lt;br /&gt;
*June 19th - June 26th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 26th - July 15: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by August 5th&lt;br /&gt;
#* Basic functionality of &amp;quot;source&amp;quot; element in [Lua] tags and [AI] tags with engine=&amp;quot;Lua&amp;quot; -- Due by July 25th&lt;br /&gt;
#** WML properly parses &amp;quot;source&amp;quot; element and passes file contents to Lua engine -- Due by July 22nd&lt;br /&gt;
#** Source element syntax and usage is thoroughly documented on -- Due by July 25th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by August 5th&lt;br /&gt;
#** Script manager to store path of scripts on first load, compare new requests to files already loaded, and return reference to the loaded file -- Due by August 5th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 10th&lt;br /&gt;
#* Implement grouping -- Due By August 22nd&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 12th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 17th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 22nd&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extensions==&lt;br /&gt;
===[group] tag===&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
My current thinking is that a group tag will look like this&lt;br /&gt;
    [group]&lt;br /&gt;
      id=some_group_identifier&lt;br /&gt;
      automatic=no&lt;br /&gt;
      [filter]&lt;br /&gt;
        {optional [[StandardUnitFilter]]}&lt;br /&gt;
      [/filter]&lt;br /&gt;
      [ai]&lt;br /&gt;
        {optional [[AiWML|AI specification]]}&lt;br /&gt;
      [/ai]      &lt;br /&gt;
    [/group]&lt;br /&gt;
&lt;br /&gt;
The id element is the only mandatory element of the group tag. The other tags specify certain automated behaviors that apply to the group. An explanation of each element follows:&lt;br /&gt;
&lt;br /&gt;
=====id=====&lt;br /&gt;
A group id will be some locally unique identifier for the group. This is the name that will be used to issue orders to members of the group, or to add or remove units from the group's membership.&lt;br /&gt;
&lt;br /&gt;
=====automatic=====&lt;br /&gt;
The element &amp;quot;automatic&amp;quot; is a boolean element that specifies whether the wesnoth game engine should track and update the group's membership according to a supplied [[StandardUnitFilter]].&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is &amp;quot;no&amp;quot;, and a value of &amp;quot;yes&amp;quot; requires that the group have a [[StandardUnitFilter]] associated.&lt;br /&gt;
&lt;br /&gt;
=====[filter]=====&lt;br /&gt;
This child tag will specify a [[StandardUnitFilter]] to which the group membership should be applied. &amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is yes, the [filter] tag is mandatory, and group membership will automatically be updated such that all units matching the filter are considered members, and no units not matching the filter are.&amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is no, units matching the filter will be added to the [group] at the time of the group's formation, but any further additions to or removals from the group will require an explicit WML or Lua command.&lt;br /&gt;
&lt;br /&gt;
=====[ai]=====&lt;br /&gt;
This optional child tag will specify a supplementary ai to control member units. Groups without an [ai] child tag will be controlled by the overall [side] ai.&lt;br /&gt;
&lt;br /&gt;
===[[UnitWML]] extension===&lt;br /&gt;
To facilitate the use of groups, I propose to extend Unit data to include a subtag [ai_groups]&lt;br /&gt;
====Basic Structure====&lt;br /&gt;
The basic structure of the [ai_groups] tag will be as follows&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=some_group_identifier&lt;br /&gt;
      ...&lt;br /&gt;
      n=yet_another_group_identifier&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
Each element shall be a number, associated with the id of an extant and valid [group] tag. The number shall be the priority of group membership, such that if two groups are issued conflicting orders, a unit with membership in both gruops will only follow commands issued to the group with the lowest priority number.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, assume an elven archer unit is assigned to a &amp;quot;forest_patrol&amp;quot; group and a &amp;quot;ranged_units&amp;quot; group such that&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
A command is issued to forest_patrol for all member units to move along a circular route within a particular patch of forest and a command is then issued to ranged_units to assault the enemy keep.&lt;br /&gt;
The elven archer in question will ignore the command issued to ranged_units and continue to walk along its circular patrol.&amp;lt;br/&amp;gt;&lt;br /&gt;
If, instead, the command issued to ranged_units was to prefer attacking swordsmen over archers, the elven archer in question would obey both orders, walking along its circular patrol, and attacking swordsmen in its range, but not archers.&lt;br /&gt;
&lt;br /&gt;
===[group] modification actions===&lt;br /&gt;
In addition to the wml extensions specified above, I propose a set of actions to allow WML authors to maintain groups manually.&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [delete_group]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/delete_group]&lt;br /&gt;
&lt;br /&gt;
    [set_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      [ai]&lt;br /&gt;
        [[AiWML|AI Specification]]&lt;br /&gt;
      [/ai]&lt;br /&gt;
    [/set_group_ai]&lt;br /&gt;
&lt;br /&gt;
    [clear_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/clear_group_ai]&lt;br /&gt;
&lt;br /&gt;
[add_to_group] adds a single unit (specified in unit_id), or all units matching a [filter] to a group (specified in group_id). If the group does not exist it will be created. The optional priority element specifies what priority level to mark the new group memberships, and defaults to 1. The new membership will take priority over existing memberships with equal or lesser priority value.&amp;lt;br/&amp;gt;&lt;br /&gt;
For instance, taking the elven_archer from our previous example, if we run&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=elven_archer&lt;br /&gt;
      group_id=test_group&lt;br /&gt;
      priority=2&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
the elven_archer's resulting memberships will be&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=test_group&lt;br /&gt;
      3=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
[remove_from_group] removes a single unit (specified in unit_id), or all units matching a [filter] from a group (specified in group_id). If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[clear_groups] removes a single unit (specified in unit_id), or all units matching a [filter] from all current groups.&lt;br /&gt;
spec&lt;br /&gt;
[delete_group] destroys a current group (specified in group_id) and removes all units from its membership. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[set_group_ai] changes the supplementary ai running in a current group (specified in group_id) to the one specified in the [ai] child tag. If the group does not exist, it will be created.&lt;br /&gt;
&lt;br /&gt;
[clear_group_ai] removes the supplementary ai running in a current group (specified in group_id) and reverts all members to the overall [side] ai. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
Additionally these actions shall all be callable from Lua.&lt;br /&gt;
&lt;br /&gt;
===[[StandardUnitFilter]] extension===&lt;br /&gt;
In order to address units by group membership, I propose to add a &amp;quot;group&amp;quot; attribute to allowable unit filters. A [filter] containing a group attribute will only return units that are members of the group whose id is specified in the attribute.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42182</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42182"/>
		<updated>2011-04-16T02:27:23Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Proposed WML extension */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 25th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements - By July 22nd&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete - By July 25th&lt;br /&gt;
**Milestone: By July 25th, WML authors can easily include Lua code that is not embedded directly in the WML file&lt;br /&gt;
*July 25th-August 5th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*August 5th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications -- By August 10th&lt;br /&gt;
*# Implement group tag -- By August 22nd&lt;br /&gt;
*## Extend WML engine to parse and process [group] -- By August 12th&lt;br /&gt;
*## Extend Lua interface to support group-based commands -- Due by August 17th&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups -- Due by August 22nd&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 19th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete&lt;br /&gt;
*June 19th - June 26th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 26th - July 15: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by August 5th&lt;br /&gt;
#* Basic functionality of &amp;quot;source&amp;quot; element in [Lua] tags and [AI] tags with engine=&amp;quot;Lua&amp;quot; -- Due by July 25th&lt;br /&gt;
#** WML properly parses &amp;quot;source&amp;quot; element and passes file contents to Lua engine -- Due by July 22nd&lt;br /&gt;
#** Source element syntax and usage is thoroughly documented on -- Due by July 25th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by August 5th&lt;br /&gt;
#** Script manager to store path of scripts on first load, compare new requests to files already loaded, and return reference to the loaded file -- Due by August 5th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 10th&lt;br /&gt;
#* Implement grouping -- Due By August 22nd&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 12th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 17th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 22nd&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extensions==&lt;br /&gt;
===[group] tag===&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
My current thinking is that a group tag will look like this&lt;br /&gt;
    [group]&lt;br /&gt;
      id=some_group_identifier&lt;br /&gt;
      automatic=no&lt;br /&gt;
      [filter]&lt;br /&gt;
        {optional [[StandardUnitFilter]]}&lt;br /&gt;
      [/filter]&lt;br /&gt;
      [ai]&lt;br /&gt;
        {optional [[AiWML|AI specification]]}&lt;br /&gt;
      [/ai]      &lt;br /&gt;
    [/group]&lt;br /&gt;
&lt;br /&gt;
The id element is the only mandatory element of the group tag. The other tags specify certain automated behaviors that apply to the group. An explanation of each element follows:&lt;br /&gt;
&lt;br /&gt;
=====id=====&lt;br /&gt;
A group id will be some locally unique identifier for the group. This is the name that will be used to issue orders to members of the group, or to add or remove units from the group's membership.&lt;br /&gt;
&lt;br /&gt;
=====automatic=====&lt;br /&gt;
The element &amp;quot;automatic&amp;quot; is a boolean element that specifies whether the wesnoth game engine should track and update the group's membership according to a supplied [[StandardUnitFilter]].&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is &amp;quot;no&amp;quot;, and a value of &amp;quot;yes&amp;quot; requires that the group have a [[StandardUnitFilter]] associated.&lt;br /&gt;
&lt;br /&gt;
=====[filter]=====&lt;br /&gt;
This child tag will specify a [[StandardUnitFilter]] to which the group membership should be applied. &amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is yes, the [filter] tag is mandatory, and group membership will automatically be updated such that all units matching the filter are considered members, and no units not matching the filter are.&amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is no, units matching the filter will be added to the [group] at the time of the group's formation, but any further additions to or removals from the group will require an explicit WML or Lua command.&lt;br /&gt;
&lt;br /&gt;
=====[ai]=====&lt;br /&gt;
This optional child tag will specify a supplementary ai to control member units. Groups without an [ai] child tag will be controlled by the overall [side] ai.&lt;br /&gt;
&lt;br /&gt;
===[[UnitWML]] extension===&lt;br /&gt;
To facilitate the use of groups, I propose to extend Unit data to include a subtag [ai_groups]&lt;br /&gt;
====Basic Structure====&lt;br /&gt;
The basic structure of the [ai_groups] tag will be as follows&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=some_group_identifier&lt;br /&gt;
      ...&lt;br /&gt;
      n=yet_another_group_identifier&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
Each element shall be a number, associated with the id of an extant and valid [group] tag. The number shall be the priority of group membership, such that if two groups are issued conflicting orders, a unit with membership in both gruops will only follow commands issued to the group with the lowest priority number.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, assume an elven archer unit is assigned to a &amp;quot;forest_patrol&amp;quot; group and a &amp;quot;ranged_units&amp;quot; group such that&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
A command is issued to forest_patrol for all member units to move along a circular route within a particular patch of forest and a command is then issued to ranged_units to assault the enemy keep.&lt;br /&gt;
The elven archer in question will ignore the command issued to ranged_units and continue to walk along its circular patrol.&amp;lt;br/&amp;gt;&lt;br /&gt;
If, instead, the command issued to ranged_units was to prefer attacking swordsmen over archers, the elven archer in question would obey both orders, walking along its circular patrol, and attacking swordsmen in its range, but not archers.&lt;br /&gt;
&lt;br /&gt;
===[group] modification actions===&lt;br /&gt;
In addition to the wml extensions specified above, I propose a set of actions to allow WML authors to maintain groups manually.&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [delete_group]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/delete_group]&lt;br /&gt;
&lt;br /&gt;
    [set_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      [ai]&lt;br /&gt;
        [[AiWML|AI Specification]]&lt;br /&gt;
      [/ai]&lt;br /&gt;
    [/set_group_ai]&lt;br /&gt;
&lt;br /&gt;
    [clear_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/clear_group_ai]&lt;br /&gt;
&lt;br /&gt;
[add_to_group] adds a single unit (specified in unit_id), or all units matching a [filter] to a group (specified in group_id). If the group does not exist it will be created. The optional priority element specifies what priority level to mark the new group memberships, and defaults to 1. The new membership will take priority over existing memberships with equal or lesser priority value.&amp;lt;br/&amp;gt;&lt;br /&gt;
For instance, taking the elven_archer from our previous example, if we run&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=elven_archer&lt;br /&gt;
      group_id=test_group&lt;br /&gt;
      priority=2&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
the elven_archer's resulting memberships will be&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=test_group&lt;br /&gt;
      3=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
[remove_from_group] removes a single unit (specified in unit_id), or all units matching a [filter] from a group (specified in group_id). If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[clear_groups] removes a single unit (specified in unit_id), or all units matching a [filter] from all current groups.&lt;br /&gt;
spec&lt;br /&gt;
[delete_group] destroys a current group (specified in group_id) and removes all units from its membership. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[set_group_ai] changes the supplementary ai running in a current group (specified in group_id) to the one specified in the [ai] child tag. If the group does not exist, it will be created.&lt;br /&gt;
&lt;br /&gt;
[clear_group_ai] removes the supplementary ai running in a current group (specified in group_id) and reverts all members to the overall [side] ai. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
Additionally these actions shall all be callable from Lua.&lt;br /&gt;
&lt;br /&gt;
===[[StandardUnitFilter]] extension===&lt;br /&gt;
In order to address units by group membership, I propose to add a &amp;quot;group&amp;quot; attribute to allowable unit filters. A [filter] containing a group attribute will only return units that are members of the group whose id is specified in the attribute.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42181</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42181"/>
		<updated>2011-04-16T02:23:33Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Proposed WML extension */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 25th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements - By July 22nd&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete - By July 25th&lt;br /&gt;
**Milestone: By July 25th, WML authors can easily include Lua code that is not embedded directly in the WML file&lt;br /&gt;
*July 25th-August 5th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*August 5th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications -- By August 10th&lt;br /&gt;
*# Implement group tag -- By August 22nd&lt;br /&gt;
*## Extend WML engine to parse and process [group] -- By August 12th&lt;br /&gt;
*## Extend Lua interface to support group-based commands -- Due by August 17th&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups -- Due by August 22nd&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 19th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete&lt;br /&gt;
*June 19th - June 26th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 26th - July 15: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by August 5th&lt;br /&gt;
#* Basic functionality of &amp;quot;source&amp;quot; element in [Lua] tags and [AI] tags with engine=&amp;quot;Lua&amp;quot; -- Due by July 25th&lt;br /&gt;
#** WML properly parses &amp;quot;source&amp;quot; element and passes file contents to Lua engine -- Due by July 22nd&lt;br /&gt;
#** Source element syntax and usage is thoroughly documented on -- Due by July 25th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by August 5th&lt;br /&gt;
#** Script manager to store path of scripts on first load, compare new requests to files already loaded, and return reference to the loaded file -- Due by August 5th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 10th&lt;br /&gt;
#* Implement grouping -- Due By August 22nd&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 12th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 17th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 22nd&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extension==&lt;br /&gt;
===[group] tag===&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
My current thinking is that a group tag will look like this&lt;br /&gt;
    [group]&lt;br /&gt;
      id=some_group_identifier&lt;br /&gt;
      automatic=no&lt;br /&gt;
      [filter]&lt;br /&gt;
        {optional [[StandardUnitFilter]]}&lt;br /&gt;
      [/filter]&lt;br /&gt;
      [ai]&lt;br /&gt;
        {optional [[AiWML|AI specification]]}&lt;br /&gt;
      [/ai]      &lt;br /&gt;
    [/group]&lt;br /&gt;
&lt;br /&gt;
The id element is the only mandatory element of the group tag. The other tags specify certain automated behaviors that apply to the group. An explanation of each element follows:&lt;br /&gt;
&lt;br /&gt;
=====id=====&lt;br /&gt;
A group id will be some locally unique identifier for the group. This is the name that will be used to issue orders to members of the group, or to add or remove units from the group's membership.&lt;br /&gt;
&lt;br /&gt;
=====automatic=====&lt;br /&gt;
The element &amp;quot;automatic&amp;quot; is a boolean element that specifies whether the wesnoth game engine should track and update the group's membership according to a supplied [[StandardUnitFilter]].&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is &amp;quot;no&amp;quot;, and a value of &amp;quot;yes&amp;quot; requires that the group have a [[StandardUnitFilter]] associated.&lt;br /&gt;
&lt;br /&gt;
=====[filter]=====&lt;br /&gt;
This child tag will specify a [[StandardUnitFilter]] to which the group membership should be applied. &amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is yes, the [filter] tag is mandatory, and group membership will automatically be updated such that all units matching the filter are considered members, and no units not matching the filter are.&amp;lt;br/&amp;gt;&lt;br /&gt;
If automatic is no, units matching the filter will be added to the [group] at the time of the group's formation, but any further additions to or removals from the group will require an explicit WML or Lua command.&lt;br /&gt;
&lt;br /&gt;
=====[ai]=====&lt;br /&gt;
This optional child tag will specify a supplementary ai to control member units. Groups without an [ai] child tag will be controlled by the overall [side] ai.&lt;br /&gt;
&lt;br /&gt;
===[[UnitWML]] extension===&lt;br /&gt;
To facilitate the use of groups, I propose to extend Unit data to include a subtag [ai_groups]&lt;br /&gt;
====Basic Structure====&lt;br /&gt;
The basic structure of the [ai_groups] tag will be as follows&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=some_group_identifier&lt;br /&gt;
      ...&lt;br /&gt;
      n=yet_another_group_identifier&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
Each element shall be a number, associated with the id of an extant and valid [group] tag. The number shall be the priority of group membership, such that if two groups are issued conflicting orders, a unit with membership in both gruops will only follow commands issued to the group with the lowest priority number.&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, assume an elven archer unit is assigned to a &amp;quot;forest_patrol&amp;quot; group and a &amp;quot;ranged_units&amp;quot; group such that&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
A command is issued to forest_patrol for all member units to move along a circular route within a particular patch of forest and a command is then issued to ranged_units to assault the enemy keep.&lt;br /&gt;
The elven archer in question will ignore the command issued to ranged_units and continue to walk along its circular patrol.&amp;lt;br/&amp;gt;&lt;br /&gt;
If, instead, the command issued to ranged_units was to prefer attacking swordsmen over archers, the elven archer in question would obey both orders, walking along its circular patrol, and attacking swordsmen in its range, but not archers.&lt;br /&gt;
&lt;br /&gt;
===[group] modification actions===&lt;br /&gt;
In addition to the wml extensions specified above, I propose a set of actions to allow WML authors to maintain groups manually.&lt;br /&gt;
====Basic syntax====&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      priority=1&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [remove_from_group]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/remove_from_group]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      unit_id=some_unit&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [clear_groups]&lt;br /&gt;
      [filter]&lt;br /&gt;
        [[StandardUnitFilter]]&lt;br /&gt;
      [/filter]&lt;br /&gt;
    [/clear_groups]&lt;br /&gt;
&lt;br /&gt;
    [delete_group]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/delete_group]&lt;br /&gt;
&lt;br /&gt;
    [set_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
      [ai]&lt;br /&gt;
        [[AiWML|AI Specification]]&lt;br /&gt;
      [/ai]&lt;br /&gt;
    [/set_group_ai]&lt;br /&gt;
&lt;br /&gt;
    [clear_group_ai]&lt;br /&gt;
      group_id=some_group&lt;br /&gt;
    [/clear_group_ai]&lt;br /&gt;
&lt;br /&gt;
[add_to_group] adds a single unit (specified in unit_id), or all units matching a [filter] to a group (specified in group_id). If the group does not exist it will be created. The optional priority element specifies what priority level to mark the new group memberships, and defaults to 1. The new membership will take priority over existing memberships with equal or lesser priority value.&amp;lt;br/&amp;gt;&lt;br /&gt;
For instance, taking the elven_archer from our previous example, if we run&lt;br /&gt;
    [add_to_group]&lt;br /&gt;
      unit_id=elven_archer&lt;br /&gt;
      group_id=test_group&lt;br /&gt;
      priority=2&lt;br /&gt;
    [/add_to_group]&lt;br /&gt;
the elven_archer's resulting memberships will be&lt;br /&gt;
    [ai_groups]&lt;br /&gt;
      1=forest_patrol&lt;br /&gt;
      2=test_group&lt;br /&gt;
      3=ranged_units&lt;br /&gt;
    [/ai_groups]&lt;br /&gt;
&lt;br /&gt;
[remove_from_group] removes a single unit (specified in unit_id), or all units matching a [filter] from a group (specified in group_id). If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[clear_groups] removes a single unit (specified in unit_id), or all units matching a [filter] from all current groups.&lt;br /&gt;
spec&lt;br /&gt;
[delete_group] destroys a current group (specified in group_id) and removes all units from its membership. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
[set_group_ai] changes the supplementary ai running in a current group (specified in group_id) to the one specified in the [ai] child tag. If the group does not exist, it will be created.&lt;br /&gt;
&lt;br /&gt;
[clear_group_ai] removes the supplementary ai running in a current group (specified in group_id) and reverts all members to the overall [side] ai. If the group does not exist, nothing happens.&lt;br /&gt;
&lt;br /&gt;
Additionally these actions shall all be callable from Lua.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42063</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42063"/>
		<updated>2011-04-14T07:32:49Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: updated proposal as per gsoc comment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Bring Lua AI functionality up to par with C++&lt;br /&gt;
*# Expose C++ AI functions to Lua (by July 8th)&lt;br /&gt;
*# Provide thorough documentation for newly exposed Lua functions (by July 15th)&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has documented access to all C++ AI functionality.&lt;br /&gt;
*July 15 - July 25th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements - By July 22nd&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete - By July 25th&lt;br /&gt;
**Milestone: By July 25th, WML authors can easily include Lua code that is not embedded directly in the WML file&lt;br /&gt;
*July 25th-August 5th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*August 5th - August 26th: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications -- By August 10th&lt;br /&gt;
*# Implement group tag -- By August 22nd&lt;br /&gt;
*## Extend WML engine to parse and process [group] -- By August 12th&lt;br /&gt;
*## Extend Lua interface to support group-based commands -- Due by August 17th&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups -- Due by August 22nd&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - June 19th: WML enhancement for easy including of Lua scripts&lt;br /&gt;
*# Extend Lua-context tags to include &amp;quot;source&amp;quot; elements as alternative to &amp;quot;code&amp;quot; elements&lt;br /&gt;
*# Ensure that documentation for &amp;quot;source&amp;quot; element on wiki is thorough and complete&lt;br /&gt;
*June 19th - June 26th: Implement Lua script manager to ensure that each external Lua file is loaded into memory only once, regardless of how many modules it is called from.&lt;br /&gt;
*June 26th - July 15: Implement unit grouping concept for AIs &lt;br /&gt;
*# Fully determine [group] tag specifications&lt;br /&gt;
*# Implement group tag&lt;br /&gt;
*## Extend WML engine to parse and process [group]&lt;br /&gt;
*## Extend Lua interface to support group-based commands&lt;br /&gt;
*## Extend Lua interface to allow creation, deletion, and customization of groups&lt;br /&gt;
*## Update wiki documentation of GroupWML and Lua to be thorough and coherent&lt;br /&gt;
**Milestone: By July 15th (midterm), Lua AI can be scripted by UMC devs with full functionality of C++ AI, can be easily included in WML modules, and can make use of unit-grouping for fine-grained control of AI behavior. Additionally, all of these features are thoroughly documented on the wiki.&lt;br /&gt;
*July 15 - August 26: Use community input and iterative design/debugging to address perceived shortcomings in the Lua AI system, documenting solutions as I go.&lt;br /&gt;
**Milestone: By August 26th, Lua AI scripting is easy and useful to UMC community standards.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 8th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 15th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by August 5th&lt;br /&gt;
#* Basic functionality of &amp;quot;source&amp;quot; element in [Lua] tags and [AI] tags with engine=&amp;quot;Lua&amp;quot; -- Due by July 25th&lt;br /&gt;
#** WML properly parses &amp;quot;source&amp;quot; element and passes file contents to Lua engine -- Due by July 22nd&lt;br /&gt;
#** Source element syntax and usage is thoroughly documented on -- Due by July 25th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by August 5th&lt;br /&gt;
#** Script manager to store path of scripts on first load, compare new requests to files already loaded, and return reference to the loaded file -- Due by August 5th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Fully define [group] tag syntax specification-- Due by August 10th&lt;br /&gt;
#* Implement grouping -- Due By August 22nd&lt;br /&gt;
#** WML engine extensions to parse [group] tags and assign one-time [[StandardUnitFilter]] groups to relevant units. -- Due By August 12th&lt;br /&gt;
#** Lua interface extensions to support AI issuing commands by group (including continually updated [[StandardUnitFilter]] groups) -- Due by August 17th&lt;br /&gt;
#** Lua interface extensions to allow adding and removing of specific units and unit filters to and from specific groups -- Due by August 22nd&lt;br /&gt;
#** Update wiki documentation of GroupWML and Lua to be thorough and coherent -- Due by August 26th&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extension==&lt;br /&gt;
Specification in progress&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42042</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42042"/>
		<updated>2011-04-13T04:23:28Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Include as much technical detail about your implementation as you can */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - July 15: In cooperation with UMC development community, analyse Lua AI scripting problem space and design solutions to reduce or eliminate difficulties affecting the development of custom Lua AIs.&lt;br /&gt;
**Milestone: By July 15th (midterm), have preliminary specifications for a standard library of utility functions and WML extensions for Lua AI scripting.&lt;br /&gt;
*July 15 - August 15: In cooperation with UMC development community, refine and implement Lua AI function library and WML extension specifications.&lt;br /&gt;
**Milestone: By August 15th, UMC developers are, on average, content with the Lua AI scripting facilities provided to them.&lt;br /&gt;
*August 15 - August 26: Assess and correct gaps in documentation.&lt;br /&gt;
**Milestone: By August 26th, project is completed and thoroughly documented.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
As in [[SummerOfCodeProposal_JodyNorthup|my prior application]], I have moved this to [[#Project Details|Project Details]] for organization and ease of reading.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 5th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 12th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by August 5th&lt;br /&gt;
#* Basic functionality of &amp;quot;source&amp;quot; element in [Lua] tags and [AI] tags with engine=&amp;quot;Lua&amp;quot; -- Due by July 25th&lt;br /&gt;
#** WML properly parses &amp;quot;source&amp;quot; element and passes file contents to Lua engine -- Due by July 22nd&lt;br /&gt;
#** Source element syntax and usage is thoroughly documented on -- Due by July 25th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by August 5th&lt;br /&gt;
#** Script manager to store path of scripts on first load, compare new requests to files already loaded, and return reference to the loaded file -- Due by August 5th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Elaboration under progress&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extension==&lt;br /&gt;
In progress&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42041</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=42041"/>
		<updated>2011-04-13T04:23:22Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - July 15: In cooperation with UMC development community, analyse Lua AI scripting problem space and design solutions to reduce or eliminate difficulties affecting the development of custom Lua AIs.&lt;br /&gt;
**Milestone: By July 15th (midterm), have preliminary specifications for a standard library of utility functions and WML extensions for Lua AI scripting.&lt;br /&gt;
*July 15 - August 15: In cooperation with UMC development community, refine and implement Lua AI function library and WML extension specifications.&lt;br /&gt;
**Milestone: By August 15th, UMC developers are, on average, content with the Lua AI scripting facilities provided to them.&lt;br /&gt;
*August 15 - August 26: Assess and correct gaps in documentation.&lt;br /&gt;
**Milestone: By August 26th, project is completed and thoroughly documented.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs. I propose to create an &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will improve and extend wesnoth's support for custom Lua AI scripts in two major steps&amp;lt;br/&amp;gt;&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&amp;lt;br/&amp;gt;&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs, and is significantly more complex.&amp;lt;br/&amp;gt;&lt;br /&gt;
For step two, I propose a couple of extensions and modifications to WML&lt;br /&gt;
===[Lua] and [AI] tag enhancement===&lt;br /&gt;
I propose to add a &amp;quot;source&amp;quot; element to [Lua] and [AI] tags as an alternative to the &amp;quot;code&amp;quot; element. The source element will specify the relative path to a Lua file which contains the desired Lua code.&amp;lt;br/&amp;gt;&lt;br /&gt;
Files loaded from the &amp;quot;source&amp;quot; element in these tags will be indexed globally so that multiple WML modules can reference the same Lua script file without causing the file to be loaded into memory multiple times.&lt;br /&gt;
===[group] tag===&lt;br /&gt;
I propose to create a &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&amp;lt;br/&amp;gt;&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Proposed syntax for the [group] tag is provided below, in the [[#Proposed WML extension|proposed WML extension]] section.&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# Full exposure to Lua of C++ AI support functions. -- Due by July 15th&lt;br /&gt;
#* C++ AI support functions exposed to Lua interface -- Due by July 5th&lt;br /&gt;
#* Wiki documentation of all additions to Lua interface -- Due by July 12th&lt;br /&gt;
# Lua loadable non-redundantly into WML from external files -- Due by August 5th&lt;br /&gt;
#* Basic functionality of &amp;quot;source&amp;quot; element in [Lua] tags and [AI] tags with engine=&amp;quot;Lua&amp;quot; -- Due by July 25th&lt;br /&gt;
#** WML properly parses &amp;quot;source&amp;quot; element and passes file contents to Lua engine -- Due by July 22nd&lt;br /&gt;
#** Source element syntax and usage is thoroughly documented on -- Due by July 25th&lt;br /&gt;
#* Lua file-loading deduplication functionality -- Due by August 5th&lt;br /&gt;
#** Script manager to store path of scripts on first load, compare new requests to files already loaded, and return reference to the loaded file -- Due by August 5th&lt;br /&gt;
# [group] tag -- Due by August 26th&lt;br /&gt;
#* Elaboration under progress&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
To be determined via discussion with mentors and UMC development community.&lt;br /&gt;
&lt;br /&gt;
==Proposed WML extension==&lt;br /&gt;
In progress&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41622</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41622"/>
		<updated>2011-04-07T19:09:09Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including in&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - July 15: In cooperation with UMC development community, analyse Lua AI scripting problem space and design solutions to reduce or eliminate difficulties affecting the development of custom Lua AIs.&lt;br /&gt;
**Milestone: By July 15th (midterm), have preliminary specifications for a standard library of utility functions and WML extensions for Lua AI scripting.&lt;br /&gt;
*July 15 - August 15: In cooperation with UMC development community, refine and implement Lua AI function library and WML extension specifications.&lt;br /&gt;
**Milestone: By August 15th, UMC developers are, on average, content with the Lua AI scripting facilities provided to them.&lt;br /&gt;
*August 15 - August 26: Assess and correct gaps in documentation.&lt;br /&gt;
**Milestone: By August 26th, project is completed and thoroughly documented.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs. I propose to create an &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided my phone number in the application at google.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41601</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41601"/>
		<updated>2011-04-06T21:26:25Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* IRC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/upthorn/1 SoC Application]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - July 15: In cooperation with UMC development community, analyse Lua AI scripting problem space and design solutions to reduce or eliminate difficulties affecting the development of custom Lua AIs.&lt;br /&gt;
**Milestone: By July 15th (midterm), have preliminary specifications for a standard library of utility functions and WML extensions for Lua AI scripting.&lt;br /&gt;
*July 15 - August 15: In cooperation with UMC development community, refine and implement Lua AI function library and WML extension specifications.&lt;br /&gt;
**Milestone: By August 15th, UMC developers are, on average, content with the Lua AI scripting facilities provided to them.&lt;br /&gt;
*August 15 - August 26: Assess and correct gaps in documentation.&lt;br /&gt;
**Milestone: By August 26th, project is completed and thoroughly documented.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs. I propose to create an &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I am willing to communicate with a mentor by phone, but much prefer contact by IRC, IM, and forums.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41600</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41600"/>
		<updated>2011-04-06T21:20:12Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24th, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: &lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps. Begin correcting.&lt;br /&gt;
*May 23 - June 13: Finish exposing C++ AI functions to Lua&lt;br /&gt;
**Milestone: By June 13th, Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*June 13 - July 15: In cooperation with UMC development community, analyse Lua AI scripting problem space and design solutions to reduce or eliminate difficulties affecting the development of custom Lua AIs.&lt;br /&gt;
**Milestone: By July 15th (midterm), have preliminary specifications for a standard library of utility functions and WML extensions for Lua AI scripting.&lt;br /&gt;
*July 15 - August 15: In cooperation with UMC development community, refine and implement Lua AI function library and WML extension specifications.&lt;br /&gt;
**Milestone: By August 15th, UMC developers are, on average, content with the Lua AI scripting facilities provided to them.&lt;br /&gt;
*August 15 - August 26: Assess and correct gaps in documentation.&lt;br /&gt;
**Milestone: By August 26th, project is completed and thoroughly documented.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs. I propose to create an &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I am willing to communicate with a mentor by phone, but much prefer contact by IRC, IM, and forums.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41535</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41535"/>
		<updated>2011-04-03T19:12:11Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions. I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24rd, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the extension of WML and the Lua API in order to better facilitate creation and customization of AIs. I propose to create an &amp;quot;[group]&amp;quot; tag for scenario authors to specify AI scripts per-group of units. This would be accompanied by a &amp;quot;[groups]&amp;quot; subtag in unitWML, which contains a unit's group memberships in priority order. Additionally a group could be associated with a standard unit filter in order to automatically apply itself to all new units created which match the filter.&lt;br /&gt;
Additionally, the Lua API will be extended to allow Lua scripts to send messages to unit groups, so that groups can be dynamically created and commanded during the execution of a scenario. This will be accomplished by significant additions to the WML parsing engine to teach it about the new unit group concept, creation of an as-yet indeterminate number of Lua or Lua API functions yet to be named, and possibly a group-related extension to Standard Unit Filters.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I am willing to communicate with a mentor by phone, but much prefer contact by IRC, IM, and forums.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41397</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41397"/>
		<updated>2011-03-31T17:14:07Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24rd, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the definition and implementation of Lua AI inclusion specifications for WML, as well as additional faculties to prevent multiple-loading of AI scripts in the event that one script is called from multiple modules, and possibly support for per-unit AI scripts. I am still developing my understanding of the technical details for this step.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM in 2009. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I am willing to communicate with a mentor by phone, but much prefer contact by IRC, IM, and forums.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41396</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41396"/>
		<updated>2011-03-31T17:13:02Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24rd, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the definition and implementation of Lua AI inclusion specifications for WML, as well as additional faculties to prevent multiple-loading of AI scripts in the event that one script is called from multiple modules, and possibly support for per-unit AI scripts. I am still developing my understanding of the technical details for this step.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, my work on ScummVM in 2009, and my work on Wesnoth last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I am willing to communicate with a mentor by phone, but much prefer contact by IRC, IM, and forums.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41352</id>
		<title>SummerOfCodeProposal 2011 LuaAI JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_2011_LuaAI_JodyNorthup&amp;diff=41352"/>
		<updated>2011-03-31T06:01:35Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: Created page with '{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}  =Description= ====Jody Northup - Improve and extend Lua AI scripting facilities==== This is the [[SoC_Ideas_LuaAI_2011|Lua AI i…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Student_2|upthorn|SoC_Ideas_LuaAI_2011}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Improve and extend Lua AI scripting facilities====&lt;br /&gt;
This is the [[SoC_Ideas_LuaAI_2011|Lua AI improvement]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If I am accepted for this project, I will bring the Lua AI scripting functionality up to par with the current C++ AI programming functionality by first exposing all of the C++ AI support functions to Wesnoth's Lua API, and then adding WML utilities to include and handle custom Lua AI code in WML modules.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect the first step to involve an in-depth analysis of the C++ AI functions and an inventory of the gaps in the currently-implemented Lua AI API, followed by tedious Lua API programming to expose each of those functions.&amp;lt;br/&amp;gt;&lt;br /&gt;
I expect that the second step will involve communication with the development community to determine good WML specifications for the use of Lua AI code in UMC modules.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
Not yet submitted&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
(Largely copied from [[SummerOfCodeProposal_JodyNorthup|my successful application last year]])&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 26 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my fourth year, in terms of time spent I am in my 6th year, and in terms of the length of time remaining until I graduate, I might as well be halfway through my 2nd year.&lt;br /&gt;
In another year I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (UTC-7 during the summer), but my sleep schedule is fairy flexible. I am generally available on IRC between around 18:00 and 9:00 UTC, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will have limited availability on Mondays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I have a recurring social engagement all day every Wednesday, but this commitment can be cancelled if there is urgent work to be done. I also have D&amp;amp;D from 18:00 to 0:00 on Friday nights (1:00 to 7:00 Saturdays, UTC).&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64. Relevantly, my work on gens has included some additions/improvements to its Lua API.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code 2009, [http://wiki.scummvm.org/index.php/API-Truecolor implementing an API] to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
* I implemented [[PersistenceWML|Wesnoth's persistent data WML extension]] for Summer of Code last year.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for 2009's Summer of Code, as well as Battle for Wesnoth during 2010's.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in 2009's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games] (Note: dead link pending assistance from melange team to update). I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
I participated in 2010's summer of code as a student with Battle for Wesnoth. My project was to extend WML to support persistent data for UMC developers. I was assigned Crab as a mentor, and had a very positive experience, in which I learned a lot about WML parsing, and where the errors lie in my approach to software development. My project took the entire length of the coding period, and was completed successfully with his guidance.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation in 2009, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet (except to the extent of debugging Persistence WML in multiplayer contexts.)&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
* I gained commit access to the BfW SVN during (or slightly before) the coding period for last year's Summer of Code. It appears that I still retain this access.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I was unfortunately unable to learn Russian this year, due to scheduling conflicts.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In 2009's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
During last year's summer of code, the project specifications were almost entirly a collaboration between myself and my mentor, which allowed me to take a much more independent approach in designing my solution, therefore involving much less refactoring and wasted effort.&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
Yes: I selected [[http://wiki.wesnoth.org/SoC_Ideas_LuaAI_2011|the Lua AI improvement]] project from your ideas list. I would like to focus on ensuring that UMC authors can easily include custom Lua AI code in their modules.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
# AI is an interest of mine that has always felt unapproachable, and this seems like it would provide a good opportunity to learn how AI works in a game.&lt;br /&gt;
# Customizability seems like one of Wesnoth's strongest &amp;quot;selling point&amp;quot;s, and if scripted AI routines are second-class citizens, difficult to use and unable to replicate hard-coded functionality, it is a major hole in Wesnoth's support for customization. In other words: it seems like a very useful goal, and I would like to improve wesnoth in a meaningful way.&lt;br /&gt;
# I wanted to challenge myself more this year than I have on previous years. Working on or around AI scares me a little bit, and I want to find out if my fears are founded or not.&lt;br /&gt;
# I have worked on extending an application's Lua interface before, and am confident that I can accomplish that in a timely manner.&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the C++ AI functionality and the Lua AI functionality. Assess gaps.&lt;br /&gt;
**Milestone: By May 24rd, know which C++ functions are not yet exposed.&lt;br /&gt;
*May 23 - July 15: Expose C++ AI functions to Lua&lt;br /&gt;
**Milestone: By July 15th (Midterm), Lua AI has access to all C++ AI functionality.&lt;br /&gt;
*July 15 - August 15: Design and implement proof-of-concept WML extensions for &amp;quot;Lua AI standard library&amp;quot;&lt;br /&gt;
*August 15 - August 26: Refine WML extensions through iterative debugging&lt;br /&gt;
**Milestone: By August 26th (Final deadline) Lua AI can be scripted by UMC devs with full functionality of C++ AI, and Lua AIs can be easily included in WML modules.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
Step one involves use of the Lua API to create several Lua interface functions to invoke C++ functions from, and seems fairly straightforward.&lt;br /&gt;
Step two involves the definition and implementation of Lua AI inclusion specifications for WML, as well as additional faculties to prevent multiple-loading of AI scripts in the event that one script is called from multiple modules, and possibly support for per-unit AI scripts. I am still developing my understanding of the technical details for this step.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
A better understanding of AI concepts, experience working with game AI, a better understanding of my capacities as a programmer, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period, and the free time to make a meaningful commitment to wesnoth development.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
*Lua: I just use Crimson editor, because it has support for Lua syntax highlighting, and Lua is interpreted, not compiled.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I am willing to communicate with a mentor by phone, but much prefer contact by IRC, IM, and forums.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37956</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37956"/>
		<updated>2010-08-16T11:13:25Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Transactions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: in multiplayer, do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* During multiplayer, Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1, and will force a quit if they occur there.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
* Persistent Variables will retain their values after wesnoth is closed, until they are cleared or the file containing their namespace is erased or lost.&lt;br /&gt;
&lt;br /&gt;
== Transactions ==&lt;br /&gt;
For the purposes of efficiency, and gameplay consistency, persistent variables are usually not written out to file immediately. Instead, they are grouped into transactions which are sets of changes that are either all written at once, or not written at all. &amp;lt;br/&amp;gt;&lt;br /&gt;
The policy regarding persistent variables will be written is as follows:&lt;br /&gt;
*Transactions will be committed (written to permanent file) whenever the game autosaves, whenever the player saves the game manually, or whenever a scenario is completed in either victory or defeat.&lt;br /&gt;
*Transactions will be cancelled (ignored and wiped from memory) whenever the player loads an earlier savegame, or quits without saving.&lt;br /&gt;
*A WML author can mark a change as an exception to a transaction, to be committed immediately by itself, by using setting the attribute &amp;quot;immediate&amp;quot; to &amp;quot;yes&amp;quot; in a [set_global_variable] or [clear_global_variable] tag. Such operations will be written immediately, regardless of the transaction status, without committing any waiting transactions.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| NOTE: Because of the interaction between persistent variable transactions and user loading/saving of games, it is suggested that any variables a WML author wants to remain consistent for a single playthrough of a scenario should be read in immediately at the beginning of the scenario (side 1 turn 1), and set or cleared only in the victory and/or defeat events.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      side=1&lt;br /&gt;
      immediate=no&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
      immediate=no&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&amp;lt;br/&amp;gt;&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&amp;lt;br/&amp;gt;&lt;br /&gt;
This attribute is not used in single player, and may be omitted in single-player only scenarios.&amp;lt;br/&amp;gt;&lt;br /&gt;
If this attribute is equal to &amp;quot;global&amp;quot;, the currently active player's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] and [clear_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
==== immediate ====&lt;br /&gt;
This attribute is an optional boolean value that specifies whether the changes made by the [set_global_variable] or [clear_global_variable] should be stored permanently at the moment they occur.&amp;lt;br/&amp;gt;&lt;br /&gt;
If it is set to yes, the namespace's permanent storage will be updated with the change that occurred in the marked tag immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is no.&amp;lt;br/&amp;gt;&lt;br /&gt;
This attribute does not apply to [get_global_variable], which always occurs immediately.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37955</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37955"/>
		<updated>2010-08-16T11:12:19Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: in multiplayer, do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* During multiplayer, Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1, and will force a quit if they occur there.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
* Persistent Variables will retain their values after wesnoth is closed, until they are cleared or the file containing their namespace is erased or lost.&lt;br /&gt;
&lt;br /&gt;
== Transactions ==&lt;br /&gt;
For the purposes of efficiency, and gameplay consistency, persistent variables are usually not written out to file immediately. Instead, they are grouped into transactions which are sets of changes that are either all written at once, or not written at all. The policy regarding this is as follows.&lt;br /&gt;
*Transactions will be committed (written to permanent file) whenever the game autosaves, whenever the player saves the game manually, or whenever a scenario is completed in either victory or defeat.&lt;br /&gt;
*Transactions will be cancelled (ignored and wiped from memory) whenever the player loads an earlier savegame, or quits without saving.&lt;br /&gt;
*A WML author can mark a change as an exception to a transaction, to be committed immediately by itself, by using setting the attribute &amp;quot;immediate&amp;quot; to &amp;quot;yes&amp;quot; in a [set_global_variable] or [clear_global_variable] tag. Such operations will be written immediately, regardless of the transaction status, without committing any waiting transactions.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| NOTE: Because of the interaction between persistent variable transactions and user loading/saving of games, it is suggested that any variables a WML author wants to remain consistent for a single playthrough of a scenario should be read in immediately at the beginning of the scenario (side 1 turn 1), and set or cleared only in the victory and/or defeat events.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      side=1&lt;br /&gt;
      immediate=no&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
      immediate=no&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&amp;lt;br/&amp;gt;&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&amp;lt;br/&amp;gt;&lt;br /&gt;
This attribute is not used in single player, and may be omitted in single-player only scenarios.&amp;lt;br/&amp;gt;&lt;br /&gt;
If this attribute is equal to &amp;quot;global&amp;quot;, the currently active player's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] and [clear_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
==== immediate ====&lt;br /&gt;
This attribute is an optional boolean value that specifies whether the changes made by the [set_global_variable] or [clear_global_variable] should be stored permanently at the moment they occur.&amp;lt;br/&amp;gt;&lt;br /&gt;
If it is set to yes, the namespace's permanent storage will be updated with the change that occurred in the marked tag immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
The default value is no.&amp;lt;br/&amp;gt;&lt;br /&gt;
This attribute does not apply to [get_global_variable], which always occurs immediately.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37954</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37954"/>
		<updated>2010-08-16T10:43:06Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: in multiplayer, do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* During multiplayer, Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1, and will force a quit if they occur there.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
* Persistent Variables will retain their values after wesnoth is closed, until they are cleared or the file containing their namespace is erased or lost.&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      side=1&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
This attribute is not used in single player, and may be omitted in single-player only scenarios.&lt;br /&gt;
If this attribute is equal to &amp;quot;global&amp;quot;, the currently active player's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] and [clear_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37953</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37953"/>
		<updated>2010-08-15T22:42:33Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: in multiplayer, do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* During multiplayer, Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1, and will force a quit if they occur there.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      side=1&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
This attribute is not used in single player, and may be omitted in single-player only scenarios.&lt;br /&gt;
If this attribute is equal to &amp;quot;global&amp;quot;, the currently active player's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] and [clear_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37952</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37952"/>
		<updated>2010-08-15T22:41:31Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* WML Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      side=1&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      side=1&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
This attribute is not used in single player, and may be omitted in single-player only scenarios.&lt;br /&gt;
If this attribute is equal to &amp;quot;global&amp;quot;, the currently active player's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] and [clear_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Template:WML_Tags&amp;diff=37951</id>
		<title>Template:WML Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Template:WML_Tags&amp;diff=37951"/>
		<updated>2010-08-15T22:38:40Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;gallery&amp;quot; style=&amp;quot;width:225px;float: right;border: 1px solid #B48648; color:#B48648; font-size: 7pt;margin-left;10px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;span style=&amp;quot;float: right;&amp;quot;&amp;gt;&amp;lt;small class=&amp;quot;editlink noprint plainlinksneverexpand&amp;quot;&amp;gt;[{{SERVER}}{{localurl:Template:WML Tags|action=edit}} edit ]&amp;lt;/small&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
'''WML Tags'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|''A:'' &lt;br /&gt;
[[AbilitiesWML|abilities]],&lt;br /&gt;
[[CampaignWML|about]],&lt;br /&gt;
[[AdvancedPreferenceWML|advanced_preference]],&lt;br /&gt;
[[UnitTypeWML|advancefrom]],&lt;br /&gt;
[[UnitTypeWML|advancement]],&lt;br /&gt;
[[StatisticalScenarioWML|advances]],&lt;br /&gt;
[[AiWML|ai]],&lt;br /&gt;
[[DirectActionsWML#.5Ballow_recruit.5D|allow_recruit]],&lt;br /&gt;
[[DirectActionsWML#.5Ballow_undo.5D|allow_undo]],&lt;br /&gt;
[[ConditionalActionsWML#Meta_Condition_Tags|and]],&lt;br /&gt;
[[InterfaceActionsWML|animate_unit]],&lt;br /&gt;
[[AnimationWML|animation]],&lt;br /&gt;
[[VariablesWML|array]],&lt;br /&gt;
[[UnitTypeWML|attack]],&lt;br /&gt;
[[AnimationWML|attack_filter]], &lt;br /&gt;
[[StatisticalScenarioWML|attacks]],&lt;br /&gt;
[[AiWML|avoid]];&lt;br /&gt;
|-&lt;br /&gt;
|''B:'' &lt;br /&gt;
[[UnitTypeWML|base_unit]], [[BinaryPathWML|binary_path]], [[HelpWML|bold]], [[EditorWML|brush]];&lt;br /&gt;
|-&lt;br /&gt;
|''C:'' &lt;br /&gt;
[[CampaignWML#The_.5Bcampaign.5D_tag|campaign]],&lt;br /&gt;
[[DirectActionsWML#.5Bcapture_village.5D|capture_village]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bswitch.5D|case]],&lt;br /&gt;
[[ReplayWML|choose]],&lt;br /&gt;
[[PersistenceWML|clear_global_variable]],&lt;br /&gt;
[[InternalActionsWML|clear_variable]],&lt;br /&gt;
[[InterfaceActionsWML|colour_adjust]],&lt;br /&gt;
command([[InterfaceActionsWML|action]], [[ReplayWML|replay]]);&lt;br /&gt;
|-&lt;br /&gt;
|''D:'' &lt;br /&gt;
[[AbilitiesWML|damage]],&lt;br /&gt;
[[StatisticalScenarioWML|deaths]],&lt;br /&gt;
[[InterfaceActionsWML|debug_message]],&lt;br /&gt;
[[AnimationWML|defend]],&lt;br /&gt;
[[StatisticalScenarioWML|defends]],&lt;br /&gt;
[[UnitTypeWML|defense]],&lt;br /&gt;
[[InterfaceActionsWML|delay]],&lt;br /&gt;
[[ReplayWML|destination]],&lt;br /&gt;
[[DirectActionsWML#.5Bdisallow_recruit.5D|disallow_recruit]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bwhile.5D|do]];&lt;br /&gt;
|-&lt;br /&gt;
|''E:'' &lt;br /&gt;
[[EditorWML|editor_group]],&lt;br /&gt;
[[EditorWML|editor_music]], &lt;br /&gt;
[[EditorWML|editor_times]],&lt;br /&gt;
[[EditorWML|editor_tool_hint]],&lt;br /&gt;
[[EffectWML|effect]],&lt;br /&gt;
[[ConditionalActionsWML#Conditional_Actions|else]],&lt;br /&gt;
[[DirectActionsWML#.5Bendlevel.5D|endlevel]],&lt;br /&gt;
end_turn&amp;amp;nbsp;([[DirectActionsWML#.5Bend_turn.5D|action]], [[ReplayWML|replay]]),&lt;br /&gt;
[[EraWML|era]],&lt;br /&gt;
[[EventWML|event]],&lt;br /&gt;
[[ThemeWML|expenses]];&lt;br /&gt;
|-&lt;br /&gt;
|''F:'' &lt;br /&gt;
[[EventWML#.5Bfilter.5D|filter]],&lt;br /&gt;
[[FilterWML|filter]],&lt;br /&gt;
[[AnimationWML|filter_attack]],&lt;br /&gt;
[[EventWML#.5Bfilter_attack.5D|filter_attack]],&lt;br /&gt;
[[FilterWML|filter_location]],&lt;br /&gt;
[[EventWML#.5Bfilter_second.5D|filter_second]],&lt;br /&gt;
[[FilterWML|filter_second]],&lt;br /&gt;
[[AnimationWML|filter_second_attack]],&lt;br /&gt;
[[EventWML#.5Bfilter_second_attack.5D|filter_second_attack]],&lt;br /&gt;
[[FilterWML|filter_vision]],&lt;br /&gt;
[[StandardUnitFilter|filter_wml]],&lt;br /&gt;
[[InternalActionsWML|fire_event]],&lt;br /&gt;
[[HelpWML|format]],&lt;br /&gt;
[[AnimationWML|frame]];&lt;br /&gt;
|-&lt;br /&gt;
|''G:'' &lt;br /&gt;
[[GameConfigWML|game_config]],&lt;br /&gt;
[[ScenarioWML|generator]],&lt;br /&gt;
[[PersistenceWML|get_global_variable]],&lt;br /&gt;
[[DirectActionsWML|gold]],&lt;br /&gt;
[[ThemeWML|gold]];&lt;br /&gt;
|-&lt;br /&gt;
|''H:'' &lt;br /&gt;
[[ConditionalActionsWML#Condition_Tags|have_location]],&lt;br /&gt;
[[ConditionalActionsWML#Condition_Tags|have_unit]],&lt;br /&gt;
[[HelpWML|header]],&lt;br /&gt;
[[DirectActionsWML#.5Bheal_unit.5D|heal_unit]],&lt;br /&gt;
[[UnitsWML|hide_help]],&lt;br /&gt;
[[InterfaceActionsWML|hide_unit]];&lt;br /&gt;
|-&lt;br /&gt;
|''I:'' &lt;br /&gt;
[[ConditionalActionsWML#.5Bif.5D|if]],&lt;br /&gt;
[[TimeWML|illuminated_time]],&lt;br /&gt;
[[TerrainGraphicsWML|image]],&lt;br /&gt;
[[HelpWML|img]],&lt;br /&gt;
[[ThemeWML|income]],&lt;br /&gt;
[[ReplayWML|init_side]],&lt;br /&gt;
[[InternalActionsWML|insert_tag]],&lt;br /&gt;
[[InterfaceActionsWML#.5Binspect.5D|inspect]],&lt;br /&gt;
[[HelpWML|italic]],&lt;br /&gt;
[[InterfaceActionsWML|item]];&lt;br /&gt;
|-&lt;br /&gt;
|''J:''&lt;br /&gt;
[[HelpWML|jump]],&lt;br /&gt;
[[InternalActionsWML|join]];&lt;br /&gt;
|-&lt;br /&gt;
|''K:'' &lt;br /&gt;
[[DirectActionsWML#.5Bkill.5D|kill]],&lt;br /&gt;
[[StatisticalScenarioWML|killed]];&lt;br /&gt;
|-&lt;br /&gt;
|''L:'' &lt;br /&gt;
label&amp;amp;nbsp;([[InterfaceActionsWML|map]], [[ThemeWML|theme]]),&lt;br /&gt;
[[LanguageWML|language]],&lt;br /&gt;
[[AiWML|leader_goal]],&lt;br /&gt;
[[LuaWML|lua]];&lt;br /&gt;
|-&lt;br /&gt;
|''M:'' &lt;br /&gt;
[[ThemeWML|main_map]],&lt;br /&gt;
[[ThemeWML|menu]],&lt;br /&gt;
[[InterfaceActionsWML|message]],&lt;br /&gt;
[[ThemeWML|mini_map]],&lt;br /&gt;
[[AnimationWML|missile_frame]],&lt;br /&gt;
[[SingleUnitWML|modifications]],&lt;br /&gt;
[[DirectActionsWML#.5Bmodify_side.5D|modify_side]],&lt;br /&gt;
[[DirectActionsWML#.5Bmodify_turns.5D|modify_turns]],&lt;br /&gt;
[[ReplayWML|move]],&lt;br /&gt;
[[DirectActionsWML#.5Bmove_unit.5D|move_unit]],&lt;br /&gt;
[[InterfaceActionsWML|move_unit_fake]],&lt;br /&gt;
[[UnitTypeWML|movement costs]],&lt;br /&gt;
[[UnitsWML|movetype]],&lt;br /&gt;
[[ScenarioWML|multiplayer]],&lt;br /&gt;
[[EraWML|multiplayer_side]],&lt;br /&gt;
[[InterfaceActionsWML|music]];&lt;br /&gt;
|-&lt;br /&gt;
|''N:'' &lt;br /&gt;
[[ConditionalActionsWML#Meta_Condition_Tags|not]],&lt;br /&gt;
[[FilterWML|not]],&lt;br /&gt;
[[ThemeWML|num_units]];&lt;br /&gt;
|-&lt;br /&gt;
|''O:'' &lt;br /&gt;
[[DirectActionsWML#.5Bobject.5D|object]],&lt;br /&gt;
[[InterfaceActionsWML|objectives]],&lt;br /&gt;
[[InterfaceActionsWML|objective]],&lt;br /&gt;
[[ThemeWML|observers]],&lt;br /&gt;
[[InterfaceActionsWML|open_help]],&lt;br /&gt;
[[InterfaceActionsWML|option]],&lt;br /&gt;
[[ConditionalActionsWML#Meta_Condition_Tags|or]];&lt;br /&gt;
|-&lt;br /&gt;
|''P:'' &lt;br /&gt;
[[ThemeWML|panel]], [[IntroWML|part]], [[DirectActionsWML#.5Bpetrify.5D|petrify]], [[DirectActionsWML#.5Bplace_shroud.5D|place_shroud]], [[ThemeWML|position]],&lt;br /&gt;
[[InterfaceActionsWML|print]], [[AiWML|protect_location]], [[AiWML|protect_unit]];&lt;br /&gt;
|-&lt;br /&gt;
|''R:'' &lt;br /&gt;
[[UnitsWML|race]], [[ReplayWML|random]], recall&amp;amp;nbsp;([[DirectActionsWML#.5Brecall.5D|action]], &lt;br /&gt;
[[ReplayWML|replay]]), [[StatisticalScenarioWML|recalls]],&lt;br /&gt;
[[ReplayWML|recruit]], [[StatisticalScenarioWML|recruits]], [[InterfaceActionsWML|redraw]],&lt;br /&gt;
[[HelpWML|ref]], [[DirectActionsWML|remove_shroud]], [[InterfaceActionsWML|remove_unit_overlay]],&lt;br /&gt;
[[InterfaceActionsWML|removeitem]], [[InterfaceActionsWML|remove_sound_source]], &lt;br /&gt;
[[DirectActionsWML#.5Breplace_map.5D|replace_map]], [[DirectActionsWML#.5Breplace_schedule.5D|replace_schedule]], [[SavefileWML|replay]], [[SavefileWML|replay_start]],&lt;br /&gt;
[[UnitTypeWML|resistance]], [[ThemeWML|resolution]], [[ReplayWML|results]], [[InternalActionsWML|role]];&lt;br /&gt;
|-&lt;br /&gt;
|''S:'' &lt;br /&gt;
[[SavefileWML|save]], [[ScenarioWML|scenario]],&lt;br /&gt;
[[InterfaceActionsWML|scroll]], [[InterfaceActionsWML|scroll_to]],&lt;br /&gt;
[[InterfaceActionsWML|scroll_to_unit]], [[AnimationWML|secondary_attack_filter]], [[AnimationWML|secondary_unit_filter]], [[HelpWML|section]], [[PersistenceWML|set_global_variable]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bset_menu_item.5D_.28SVN_trunk_only.29|set_menu_item]], [[DirectActionsWML#.5Bset_recruit.5D|set_recruit]],&lt;br /&gt;
[[InternalActionsWML|set_variable]], [[InternalActionsWML|set_variables]], [[InterfaceActionsWML|show_objectives]],&lt;br /&gt;
[[SideWML|side]], [[ThemeWML|side_playing]], [[SavefileWML|snapshot]],&lt;br /&gt;
[[InterfaceActionsWML|sound]], [[InterfaceActionsWML|sound_source]], [[ReplayWML|source]], [[EventWML|special_filter]], [[EventWML|special_filter_second]],&lt;br /&gt;
[[InternalActionsWML|split]],&lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bstatistics.5D_tag|statistics]],&lt;br /&gt;
status([[SingleUnitWML|single unit]], [[ThemeWML|theme]]), [[InternalActionsWML|store_gold]], [[InternalActionsWML|store_locations]],&lt;br /&gt;
[[InternalActionsWML|store_map_dimensions]],&lt;br /&gt;
[[InternalActionsWML|store_side]], [[InternalActionsWML|store_starting_location]], [[InternalActionsWML|store_time_of_day]], [[InternalActionsWML|store_unit]], [[InternalActionsWML|store_villages]] [[IntroWML|story]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bswitch.5D|switch]];&lt;br /&gt;
|-&lt;br /&gt;
|''T:'' &lt;br /&gt;
[[AiWML|target]],&lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|team]],&lt;br /&gt;
teleport ([[DirectActionsWML#.5Bteleport.5D|action]], [[AbilitiesWML|ability]]), [[AnimationWML|teleport_anim]],&lt;br /&gt;
terrain([[TerrainWML|define]], [[DirectActionsWML#.5Bterrain.5D|create]]), [[TerrainGraphicsWML|terrain_graphics]], [[TerrainMaskWML|terrain_mask]], [[ScenarioWML#Test_scenario|test]],&lt;br /&gt;
[[WesCamp|textdomain]], [[InterfaceActionsWML|text_input]], [[ThemeWML|theme]], [[ConditionalActionsWML#.5Bif.5D|then]],&lt;br /&gt;
[[TerrainGraphicsWML|tile]], [[TimeWML|time]], time_area&amp;amp;nbsp;([[DirectActionsWML#.5Btime_area.5D|action]], [[ScenarioWML|scenario]]), &lt;br /&gt;
[[ThemeWML|time_of_day]],&lt;br /&gt;
[[HelpWML|topic]], [[HelpWML|toplevel]], [[SingleUnitWML|trait]], [[DirectActionsWML#.5Btunnel.5D|tunnel]] [[ThemeWML|turn]], [[ScenarioWML|tutorial]];&lt;br /&gt;
|-&lt;br /&gt;
|''U:'' &lt;br /&gt;
[[InterfaceActionsWML|unhide_unit]], [[SingleUnitWML|unit]],&lt;br /&gt;
[[ThemeWML|unit_abilities]], [[ThemeWML|unit_alignment]], [[ThemeWML|unit_description]], [[AnimationWML|unit_filter]], [[ThemeWML|unit_hp]], [[ThemeWML|unit_image]], [[ThemeWML|unit_level]], [[ThemeWML|unit_moves]],&lt;br /&gt;
[[InterfaceActionsWML|unit_overlay]], [[ThemeWML|unit_profile]], [[ThemeWML|unit_status]],&lt;br /&gt;
[[ThemeWML|unit_traits]], [[UnitTypeWML|unit_type]], [[ThemeWML|unit_weapons]], [[ThemeWML|unit_xp]],&lt;br /&gt;
[[UnitsWML|units]], [[DirectActionsWML#.5Bunpetrify.5D|unpetrify]], [[DirectActionsWML#.5Bunstore_unit.5D|unstore_unit]], [[ThemeWML|upkeep]];&lt;br /&gt;
|-&lt;br /&gt;
| ''V:'' &lt;br /&gt;
[[ConditionalActionsWML#Condition_Tags|variable]],&lt;br /&gt;
[[VariablesWML|variables]],&lt;br /&gt;
[[SideWML|village]],&lt;br /&gt;
[[ThemeWML|villages]];&lt;br /&gt;
|-&lt;br /&gt;
| ''W:'' &lt;br /&gt;
[[ConditionalActionsWML#.5Bwhile.5D|while]],&lt;br /&gt;
[[InterfaceActionsWML|wml_message]];&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;An box with all the WML tags, each linking to the page they are described in. This box should be included in each of the WML reference pages.&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37950</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37950"/>
		<updated>2010-08-15T22:36:33Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* WML Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      &amp;lt;side=1&amp;gt;&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      &amp;lt;side=1&amp;gt;&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      &amp;lt;side=1&amp;gt;&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is equal to &amp;quot;global&amp;quot;, the currently active player's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] and [clear_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37940</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37940"/>
		<updated>2010-08-15T16:38:39Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;text-align:center; color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is equal to &amp;quot;global&amp;quot;, the currently active player's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] and [clear_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37784</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37784"/>
		<updated>2010-08-05T06:08:47Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Internal Separation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;color:red; font-size: larger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| WARNING: do not use persistent variables in '''prestart''', '''start''', and other non-synchronized events.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is set equal to &amp;quot;host&amp;quot;, the game's current host's data will be used.&lt;br /&gt;
If this attribute is empty, omitted, or equal to &amp;quot;global&amp;quot;, the game's current host's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;, use namespace=&amp;quot;foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37782</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=37782"/>
		<updated>2010-08-05T06:05:01Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables '''''can not''''' be used in events that occur before side 1 turn 1.&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is set equal to &amp;quot;host&amp;quot;, the game's current host's data will be used.&lt;br /&gt;
If this attribute is empty, omitted, or equal to &amp;quot;global&amp;quot;, the game's current host's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
NOT YET IMPLEMENTED&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36735</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36735"/>
		<updated>2010-06-06T04:41:14Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* namespace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot;, must follow a namespace and may only be directly followed by a &amp;quot;.&amp;quot; or another &amp;quot;^&amp;quot;. And is provided so that content creators can easily use macros to eliminate data repitition for the most frequently used namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.rod&amp;quot; with the def macro of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^^.rod&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;{def}^.quiz&amp;quot; with the def macro &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace beginning with &amp;quot;^&amp;quot; is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is set equal to &amp;quot;host&amp;quot;, the game's current host's data will be used.&lt;br /&gt;
If this attribute is empty, omitted, or equal to &amp;quot;global&amp;quot;, the game's current host's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
NOT YET IMPLEMENTED&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36645</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36645"/>
		<updated>2010-05-26T01:20:48Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Mandatory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: &lt;br /&gt;
*#Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
*#Design and implement persistence data management features while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately. There is a persistence data management interface allowing users to backup, clear, and restore their persistence data.&lt;br /&gt;
*July 5 - July 12: &lt;br /&gt;
*#Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*#Document existing changes on wiki while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer, additionally Single Player implementation and persistence data management are documented on the wiki.&lt;br /&gt;
*July 13 - July 27: &lt;br /&gt;
*#Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
*#Present finalized persistence WML capabilities to UMC developers on forums.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO: Account for all mandatory goals in optimistic timeline.&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables. -- Completed by Aug 26&lt;br /&gt;
#* events and syntax -- Completed by June 2&lt;br /&gt;
#** bulletproof singleplayer implementation of WML persistence events -- Completed by July 4&lt;br /&gt;
#** multiplayer implementation of WML persistence events -- Completed by July 27&lt;br /&gt;
#*** error recovery in MP in case players drop/join. -- Completed by Aug 16&lt;br /&gt;
#*** transaction blocks for global variable operations. -- Completed by July 27&lt;br /&gt;
#** Wiki documentation of events and syntax -- Completed by July 12&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums. -- Completed by July 27&lt;br /&gt;
# User ability to manage persistence data -- Completed by July 12&lt;br /&gt;
#* Backup -- Completed by July 4&lt;br /&gt;
#* Clear -- Completed by July 4&lt;br /&gt;
#* Restore -- Completed by July 4&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog. -- Completed by July 4&lt;br /&gt;
#* wiki documentation/manual page -- Completed by July 12&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# Engine or built-in macro support for default namespace&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36642</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36642"/>
		<updated>2010-05-25T22:31:47Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Mandatory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: &lt;br /&gt;
*#Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
*#Design and implement persistence data management features while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately. There is a persistence data management interface allowing users to backup, clear, and restore their persistence data.&lt;br /&gt;
*July 5 - July 12: &lt;br /&gt;
*#Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*#Document existing changes on wiki while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer, additionally Single Player implementation and persistence data management are documented on the wiki.&lt;br /&gt;
*July 13 - July 27: &lt;br /&gt;
*#Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
*#Present finalized persistence WML capabilities to UMC developers on forums.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO: Account for all mandatory goals in optimistic timeline.&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables. -- Completed by Aug 26&lt;br /&gt;
#* events and syntax -- Completed by June 2&lt;br /&gt;
#** bulletproof singleplayer implementation of WML persistence events -- Completed by July 4&lt;br /&gt;
#** multiplayer implementation of WML persistence events -- Completed by July 27&lt;br /&gt;
#*** error recovery in MP in case players drop/join. -- Completed by Aug 16&lt;br /&gt;
#*** transaction blocks for global variable operations. -- Completed by July 27&lt;br /&gt;
#** Wiki documentation of events and syntax -- Completed by July 12&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums. -- Completed by July 12&lt;br /&gt;
# User ability to manage persistence data -- Completed by July 12&lt;br /&gt;
#* Backup -- Completed by July 4&lt;br /&gt;
#* Clear -- Completed by July 4&lt;br /&gt;
#* Restore -- Completed by July 4&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog. -- Completed by July 4&lt;br /&gt;
#* wiki documentation/manual page -- Completed by July 12&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# Engine or built-in macro support for default namespace&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36641</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36641"/>
		<updated>2010-05-25T22:31:18Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Mandatory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: &lt;br /&gt;
*#Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
*#Design and implement persistence data management features while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately. There is a persistence data management interface allowing users to backup, clear, and restore their persistence data.&lt;br /&gt;
*July 5 - July 12: &lt;br /&gt;
*#Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*#Document existing changes on wiki while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer, additionally Single Player implementation and persistence data management are documented on the wiki.&lt;br /&gt;
*July 13 - July 27: &lt;br /&gt;
*#Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
*#Present finalized persistence WML capabilities to UMC developers on forums.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO: Account for all mandatory goals in optimistic timeline.&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables.&lt;br /&gt;
#* events and syntax -- Completed by June 2&lt;br /&gt;
#** bulletproof singleplayer implementation of WML persistence events -- Completed by July 4&lt;br /&gt;
#** multiplayer implementation of WML persistence events -- Completed by July 27&lt;br /&gt;
#*** error recovery in MP in case players drop/join. -- Completed by Aug 16&lt;br /&gt;
#*** transaction blocks for global variable operations. -- Completed by July 27&lt;br /&gt;
#** Wiki documentation of events and syntax -- Completed by July 12&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums. -- Completed by July 12&lt;br /&gt;
# User ability to manage persistence data&lt;br /&gt;
#* Backup -- Completed by July 4&lt;br /&gt;
#* Clear -- Completed by July 4&lt;br /&gt;
#* Restore -- Completed by July 4&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog. -- Completed by July 4&lt;br /&gt;
#* wiki documentation/manual page -- Completed by July 12&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# Engine or built-in macro support for default namespace&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36640</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36640"/>
		<updated>2010-05-25T22:31:08Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: &lt;br /&gt;
*#Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
*#Design and implement persistence data management features while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately. There is a persistence data management interface allowing users to backup, clear, and restore their persistence data.&lt;br /&gt;
*July 5 - July 12: &lt;br /&gt;
*#Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*#Document existing changes on wiki while awaiting feedback during discussion periods.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer, additionally Single Player implementation and persistence data management are documented on the wiki.&lt;br /&gt;
*July 13 - July 27: &lt;br /&gt;
*#Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
*#Present finalized persistence WML capabilities to UMC developers on forums.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic: TODO: Account for all mandatory goals in optimistic timeline.&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables.&lt;br /&gt;
#* events and syntax&lt;br /&gt;
#** bulletproof singleplayer implementation of WML persistence events&lt;br /&gt;
#** multiplayer implementation of WML persistence events&lt;br /&gt;
#*** error recovery in MP in case players drop/join.&lt;br /&gt;
#*** transaction blocks for global variable operations.&lt;br /&gt;
#** Wiki documentation of events and syntax&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums.&lt;br /&gt;
# User ability to manage persistence data&lt;br /&gt;
#* Backup&lt;br /&gt;
#* Restore&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog.&lt;br /&gt;
#* wiki documentation/manual page&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# Engine or built-in macro support for default namespace&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36637</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36637"/>
		<updated>2010-05-25T11:33:06Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Optional */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables.&lt;br /&gt;
#* events and syntax&lt;br /&gt;
#** bulletproof singleplayer implementation of WML persistence events&lt;br /&gt;
#** multiplayer implementation of WML persistence events&lt;br /&gt;
#*** error recovery in MP in case players drop/join.&lt;br /&gt;
#*** transaction blocks for global variable operations.&lt;br /&gt;
#** Wiki documentation of events and syntax&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums.&lt;br /&gt;
# User ability to manage persistence data&lt;br /&gt;
#* Backup&lt;br /&gt;
#* Restore&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog.&lt;br /&gt;
#* wiki documentation/manual page&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# Engine or built-in macro support for default namespace&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36636</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36636"/>
		<updated>2010-05-25T11:31:42Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: Did not enroll in math over the summer.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables.&lt;br /&gt;
#* events and syntax&lt;br /&gt;
#** bulletproof singleplayer implementation of WML persistence events&lt;br /&gt;
#** multiplayer implementation of WML persistence events&lt;br /&gt;
#*** error recovery in MP in case players drop/join.&lt;br /&gt;
#*** transaction blocks for global variable operations.&lt;br /&gt;
#** Wiki documentation of events and syntax&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums.&lt;br /&gt;
# User ability to manage persistence data&lt;br /&gt;
#* Backup&lt;br /&gt;
#* Restore&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog.&lt;br /&gt;
#* wiki documentation/manual page&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36635</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36635"/>
		<updated>2010-05-25T11:27:33Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* namespace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
PLANNED&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot; and may only occur at the beginning of a namespace, before any &amp;quot;.&amp;quot; characters, or namespace names. &lt;br /&gt;
**TODO modify description of &amp;quot;^&amp;quot; to reflect recent decisions regarding handling of namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^&amp;quot;, &amp;quot;foo^&amp;quot;, &amp;quot;.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
*In this attribute, the sequence &amp;quot;^.&amp;quot; means &amp;quot;sibling of&amp;quot;, and may only occur as the last element in a sequence of &amp;quot;^&amp;quot; characters.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.quiz&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^.rod&amp;quot;, &amp;quot;.bar^.rod&amp;quot;, &amp;quot;^^.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is set equal to &amp;quot;host&amp;quot;, the game's current host's data will be used.&lt;br /&gt;
If this attribute is empty, omitted, or equal to &amp;quot;global&amp;quot;, the game's current host's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
NOT YET IMPLEMENTED&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36634</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36634"/>
		<updated>2010-05-25T11:18:04Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* namespace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
PLANNED&lt;br /&gt;
*If this attribute is omitted or left empty, the scenario or campaign's default namespace will be used.&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot; and may only occur at the beginning of a namespace, before any &amp;quot;.&amp;quot; characters, or namespace names. &lt;br /&gt;
**TODO modify description of &amp;quot;^&amp;quot; to reflect recent decisions regarding handling of namespaces.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^&amp;quot;, &amp;quot;foo^&amp;quot;, &amp;quot;.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
*In this attribute, the sequence &amp;quot;^.&amp;quot; means &amp;quot;sibling of&amp;quot;, and may only occur as the last element in a sequence of &amp;quot;^&amp;quot; characters.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.quiz&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^.rod&amp;quot;, &amp;quot;.bar^.rod&amp;quot;, &amp;quot;^^.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is set equal to &amp;quot;host&amp;quot;, the game's current host's data will be used.&lt;br /&gt;
If this attribute is empty, omitted, or equal to &amp;quot;global&amp;quot;, the game's current host's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
NOT YET IMPLEMENTED&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36384</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36384"/>
		<updated>2010-05-03T02:32:04Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
PLANNED&lt;br /&gt;
*If this attribute is omitted or left empty, the scenario or campaign's default namespace will be used.&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot; and may only occur at the beginning of a namespace, before any &amp;quot;.&amp;quot; characters, or namespace names.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^&amp;quot;, &amp;quot;foo^&amp;quot;, &amp;quot;.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
*In this attribute, the sequence &amp;quot;^.&amp;quot; means &amp;quot;sibling of&amp;quot;, and may only occur as the last element in a sequence of &amp;quot;^&amp;quot; characters.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.quiz&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^.rod&amp;quot;, &amp;quot;.bar^.rod&amp;quot;, &amp;quot;^^.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is set equal to &amp;quot;host&amp;quot;, the game's current host's data will be used.&lt;br /&gt;
If this attribute is empty, omitted, or equal to &amp;quot;global&amp;quot;, the game's current host's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
NOT YET IMPLEMENTED&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36383</id>
		<title>PersistenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PersistenceWML&amp;diff=36383"/>
		<updated>2010-05-03T02:31:34Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: Created page with '{{DevFeature1.9}} {{WML Tags}}  == Purpose == NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
NOTE: This feature is currently under active development for Summer of Code. Information contained in this page is not guaranteed to be accurate, may concern planned future developments, and may change significantly without warning.&lt;br /&gt;
Persistent Variables are used to record information that can be accessed across savegames and session instances. &lt;br /&gt;
&lt;br /&gt;
For instance, assume that completing a campaign on hard mode should unlock a special item in subsequent playthroughs of this campaign. With a persistent variable, that can be recorded, and made available to the campaign on later plays.&lt;br /&gt;
&lt;br /&gt;
This can also be used to allow two or more related campaigns to communicate with each other about what has happened in each, allowing the player's choices in one campaign to influence the state of another.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Persistent Variables work like [[VariablesWML|normal Variables]], with a few differences.&lt;br /&gt;
&lt;br /&gt;
* Persistent Variables may be assigned, retrieved, or cleared, but not directly queried.&lt;br /&gt;
* Persistent Variables may only be assigned from an existing variable, not directly from a constant&lt;br /&gt;
* In addition to a name, each Persistent Variable must have a namespace&lt;br /&gt;
* In multiplayer campaigns, each Persistent Variable also requires a side&lt;br /&gt;
&lt;br /&gt;
== WML Syntax ==&lt;br /&gt;
The following WML Tags are provided.&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
Assigns a persistent variable with the contents of a standard variable&lt;br /&gt;
&lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
Retrieves the contents of a persistent variable and stores them in a standard variable.&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
      {side=1}&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
Clears a persistent variable entirely.&lt;br /&gt;
=== Attribute information ===&lt;br /&gt;
==== namespace ====&lt;br /&gt;
This atribute specifies the name of the namespace that the persistent variable resides in.&lt;br /&gt;
&lt;br /&gt;
PLANNED&lt;br /&gt;
*If this attribute is omitted or left empty, the scenario or campaign's default namespace will be used.&lt;br /&gt;
*In this attribute, the character &amp;quot;.&amp;quot; means &amp;quot;child of&amp;quot;, &lt;br /&gt;
**A namespace equal to &amp;quot;foo.bar&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside &amp;quot;foo&amp;quot;, creating it if it doesn't already exist, and store the peristent variable inside &amp;quot;bar&amp;quot;.&lt;br /&gt;
**If this attribute begins with &amp;quot;.&amp;quot; it will access a child namespace of the default namespace.&lt;br /&gt;
***A namespace equal to &amp;quot;.bar&amp;quot; with the default namespace of &amp;quot;foo&amp;quot; will access a &amp;quot;bar&amp;quot; namespace inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
*In this attribute, the character &amp;quot;^&amp;quot; means &amp;quot;parent of&amp;quot; and may only occur at the beginning of a namespace, before any &amp;quot;.&amp;quot; characters, or namespace names.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;bar&amp;quot; namespace. inside the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^&amp;quot; with the default namespace &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^&amp;quot;, &amp;quot;foo^&amp;quot;, &amp;quot;.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
*In this attribute, the sequence &amp;quot;^.&amp;quot; means &amp;quot;sibling of&amp;quot;, and may only occur as the last element in a sequence of &amp;quot;^&amp;quot; characters.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^^.rod&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.quiz&amp;quot; with the default namespace of &amp;quot;foo.bar.test&amp;quot; will access the &amp;quot;quiz&amp;quot; namespace within the &amp;quot;rod&amp;quot; namespace within the &amp;quot;foo&amp;quot; namespace.&lt;br /&gt;
**a namespace equal to &amp;quot;^.rod&amp;quot; with no default namespace defined is invalid and will generate a WML error, because it is impossible to determine the parent of nothing.&lt;br /&gt;
**a namespace equal to &amp;quot;foo.bar^.rod&amp;quot;, &amp;quot;.bar^.rod&amp;quot;, &amp;quot;^^.bar^&amp;quot;, or the like is invalid and will generate a WML syntax error, because &amp;quot;^&amp;quot; may only be used before the namespace name begins.&lt;br /&gt;
&lt;br /&gt;
==== *global ====&lt;br /&gt;
These attributes (from_global, to_global, and global) specify the name of the persistent variable to be worked with.&lt;br /&gt;
The name of the persistent variable must be a valid variable name, as defined in [[VariablesWML]]&lt;br /&gt;
&lt;br /&gt;
==== *local ====&lt;br /&gt;
These attributes (from_local, to_local) specify the name of the standard variable to be worked with.&lt;br /&gt;
&lt;br /&gt;
==== side ====&lt;br /&gt;
This attribute specifies which player client's persistence data should read from or written to in multiplayer.&lt;br /&gt;
It is not used in single player.&lt;br /&gt;
If this attribute is set equal to &amp;quot;host&amp;quot;, the game's current host's data will be used.&lt;br /&gt;
If this attribute is empty, omitted, or equal to &amp;quot;global&amp;quot;, the game's current host's data will be read in [get_global_variable] operations, and all player's data will be written to in [set_global_variable] operations.&lt;br /&gt;
&lt;br /&gt;
== About Namespaces ==&lt;br /&gt;
Namespaces exist in order to prevent variable collisions from occuring when two or more unrelated campaigns use the same name for some of their persistent variables.&lt;br /&gt;
A namespace is simply a name that identifies one set of variables. A namespace may contain only alphabetic characters, digits, and underscores.&lt;br /&gt;
&lt;br /&gt;
=== Internal Separation ===&lt;br /&gt;
NOT YET IMPLEMENTED&lt;br /&gt;
Just as variables can contain other variables, namespaces may contain other namespaces. The syntax for this works just like container variables: to refer to a namespace &amp;quot;bar&amp;quot; contained within a namespace &amp;quot;foo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Uniqueness ===&lt;br /&gt;
Because situations may arise where persistent variables from campaigns that are not installed concurrently have to coexist, a namespace should be unique per-context. This means that two unrelated campaigns with the same name should use different namespaces, but two or more related campaigns with different names may use the same namespace.&lt;br /&gt;
&lt;br /&gt;
The following guidelines are provided in order to facilitate this:&lt;br /&gt;
==== Single Standalone Campaign ====&lt;br /&gt;
For a single campaign which is not intended to interact with other campaigns, the format &amp;quot;(author_handle)_(campaign_name)&amp;quot; is suggested for namespaces.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; in the community were to create a campaign named &amp;quot;foo&amp;quot;, the suggested namespace would be &amp;quot;upthorn_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In cases where the author wishes to remain anonymous, or there are many contributing authors (more than say, two or three), the alternate format &amp;quot;(campaign_name)_(month)(year)&amp;quot; is suggested.&lt;br /&gt;
Using the above example, assuming that upthorn began work on the campaign on the day this wiki page was created, the resulting namespace would be &amp;quot;foo_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Multiple Related Campaigns ====&lt;br /&gt;
For multiple related campaigns, there are a few different suggested namespace options depending on order of development and the intended level of interaction.&lt;br /&gt;
&lt;br /&gt;
===== Developed or Conceived Concurrently =====&lt;br /&gt;
If a campaign is intended from the beginning to be part of a larger world of related campaigns, it is recommended that a namespace be created for the overall world, using the format &amp;quot;(author_handle)_(world_name)&amp;quot; for a named author, or &amp;quot;(world_name)_(month)(year)&amp;quot; for an unnamed author.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; were to begin development on a &amp;quot;hypothetical&amp;quot; world the day this page was created, this would result in a namespace of either &amp;quot;upthorn_hypothetical&amp;quot; or &amp;quot;hypothetical_may2010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a high level of interaction, it is recommended that the campaign simply uses the world's namespace as default, and stores any information that it needs to be kept separate in a child namespace of the format &amp;quot;(campaign_name)&amp;quot;.&lt;br /&gt;
Building on the above example, if upthorn made a &amp;quot;foo&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with high level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical&amp;quot; as its default namespace, perhaps occasionally storing information in &amp;quot;upthorn_hypothetical.foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a medium level of interaction, it is recommended that the campaign creates a child namespace of the format &amp;quot;(campaign_name)&amp;quot; in the world's overall namespace, and uses it as default, accessing the parent namespace when it needs to get information from the overall world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;bar&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with mid level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical.bar&amp;quot; as its default namespace, and somewhat frequently access information in &amp;quot;upthorn_hypothetical&amp;quot;, by using the namespace &amp;quot;^&amp;quot; or explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If a campaign in this world is intended to have a low level of interaction, it is recommended that the campaign uses an entirely separate namespace, of the format &amp;quot;(world_namespace)_(campaign)&amp;quot; as its default, and accesses the overall world's namespace when it needs to communicate with the world.&lt;br /&gt;
Continuing with the above examples, if upthorn made a &amp;quot;fnord&amp;quot; campaign in the &amp;quot;hypothetical&amp;quot; world, with a low level of intended interactivity with the world, it would use &amp;quot;upthorn_hypothetical_fnord&amp;quot; as its default namespace, and occasionally access information in &amp;quot;upthorn_hypothetical&amp;quot;, by explicitly naming &amp;quot;upthorn_hypothetical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== Developed Sequentially =====&lt;br /&gt;
In cases where the first campaign is intended as a standalone, but some time after its release the same author, or other authors decide to make other campaigns in the same overall continuity, the first campaign's namespace cannot be changed.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a high level of interaction, it is recommended that the later campaign uses the namespace of the prior campaign, and makes a child namespace for itself 'if' it needs to save any of its variables separately.&lt;br /&gt;
As an example, if an author going by &amp;quot;upthorn&amp;quot; developed a campaign &amp;quot;foo&amp;quot; and later developed a related campaign &amp;quot;bar&amp;quot;, the &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo&amp;quot; as its default namespace, and perhaps occasionally store information in &amp;quot;upthorn_foo.bar&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a medium level of interaction, it is recommended that the later campaign makes its default namespace a child inside the namespace of the prior campaign that it is most heavily realted to, and accesses the parent namespace when it needs to work with variables from the prior campaign(s).&lt;br /&gt;
Working from the above example, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_foo.bar&amp;quot; as its default namespace, and somewhat frequently access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, either by setting the namespace attribute to &amp;quot;upthorn_foo&amp;quot; explicitly, or by using &amp;quot;^&amp;quot; to get &amp;quot;upthorn_foo.bar&amp;quot;'s parent.&lt;br /&gt;
&lt;br /&gt;
If campaigns are intended to have a low level of interaction, it is recommended that the later campaign(s) has its own separate namespace using the &amp;quot;Single Standalone Campaign&amp;quot; guideline format, and explicitly name the prior campaign(s)'s namespace(s) for the few times it needs to access them.&lt;br /&gt;
Working from the above examples, upthorn's &amp;quot;bar&amp;quot; campaign would use &amp;quot;upthorn_bar&amp;quot; as its default namespace, and occasionally access the &amp;quot;foo&amp;quot; campaign's information in &amp;quot;upthorn_foo&amp;quot;, by explicitly naming &amp;quot;upthorn_foo&amp;quot; as the namespace.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36137</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36137"/>
		<updated>2010-04-17T11:18:05Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Mandatory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables.&lt;br /&gt;
#* events and syntax&lt;br /&gt;
#** bulletproof singleplayer implementation of WML persistence events&lt;br /&gt;
#** multiplayer implementation of WML persistence events&lt;br /&gt;
#*** error recovery in MP in case players drop/join.&lt;br /&gt;
#*** transaction blocks for global variable operations.&lt;br /&gt;
#** Wiki documentation of events and syntax&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums.&lt;br /&gt;
# User ability to manage persistence data&lt;br /&gt;
#* Backup&lt;br /&gt;
#* Restore&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog.&lt;br /&gt;
#* wiki documentation/manual page&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36136</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36136"/>
		<updated>2010-04-17T11:15:23Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Project Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deliverables==&lt;br /&gt;
===Mandatory===&lt;br /&gt;
# WML extension to provide events for persistent variables.&lt;br /&gt;
#* set_global_variable&lt;br /&gt;
#* get_global_variable&lt;br /&gt;
#* clear_global_variable&lt;br /&gt;
#* Wiki documentation of events and syntax&lt;br /&gt;
#* bulletproof singleplayer implementation of WML persistence events&lt;br /&gt;
#* multiplayer implementation of WML persistence events&lt;br /&gt;
#** error recovery in MP in case players drop/join.&lt;br /&gt;
#** transaction blocks for global variable operations.&lt;br /&gt;
#* present new WML capabilities to UMC authors on wesnoth's forums.&lt;br /&gt;
# User ability to manage persistence data&lt;br /&gt;
#* Backup&lt;br /&gt;
#* Restore&lt;br /&gt;
#* User Interface (probably modified from &amp;quot;save game&amp;quot; or &amp;quot;load game&amp;quot; dialog.&lt;br /&gt;
#* wiki documentation/manual page&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
# gamemaster mode multiplayer&lt;br /&gt;
#* UI&lt;br /&gt;
#** button, checkbox, or list option somewhere in the multiplayer interface&lt;br /&gt;
#** ???&lt;br /&gt;
#* Backend&lt;br /&gt;
#** Separate gamemaster persistence from standard SP and MP persistence&lt;br /&gt;
#*** SQL storage backend?&lt;br /&gt;
#*** player profiles?&lt;br /&gt;
#* Wiki documentation/manual page&lt;br /&gt;
# Player profiles&lt;br /&gt;
#*UI&lt;br /&gt;
#**a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
#**a select profile dialog&lt;br /&gt;
#***a list of profiles that currently exist&lt;br /&gt;
#***an option to create a new profile&lt;br /&gt;
#**dialog allowing the user to specify a profile name&lt;br /&gt;
#***option to migrate previous (non-profiled) data into new profile&lt;br /&gt;
#****dialog allowing player to select which savegames to migrate&lt;br /&gt;
#*Backend implementation&lt;br /&gt;
#**Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
#**Save selected profile to config on exit (or profile selection)&lt;br /&gt;
#**Load selected profile from config on startup&lt;br /&gt;
#*Wiki documentation/manual page&lt;br /&gt;
# SQL backend for global variable storage&lt;br /&gt;
# First massively multiplayer campaign &lt;br /&gt;
#* Collaborate with UMC authors and playtesters from Wesnoth's MP community&lt;br /&gt;
#* ???&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36059</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36059"/>
		<updated>2010-04-13T08:52:27Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Basic Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
and&lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36042</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36042"/>
		<updated>2010-04-12T20:06:42Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Uniqueness */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
====Importance of Uniqueness====&lt;br /&gt;
Multiple addons can possibly have the same name if at least one does not come from the addon server. So the addon name alone is insufficient. It is important that a namespace is globally unique, because even if it is not possible for two addons with the same name to be installed and operating at the same time, a player may wish to retain persistence data when uninstalling an addon.&lt;br /&gt;
If a player uninstalls an addon, retains persistence data, and then installs a different addon with the same name, that addon should probably not be loading the old one's persistence data, and almost certainly should not be overwriting it.&lt;br /&gt;
&lt;br /&gt;
Consider this cautionary tale:&lt;br /&gt;
=====Example A =====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo and plank::foo both use &amp;quot;foo&amp;quot; as the namespace for global variables, because it is the name of the addon, and two addons with the same name cannot be installed at the same time.&lt;br /&gt;
Adam, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Adam knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Adam fully intends to return to bar::foo at some point, and so leaves the persistence data intact. Furthermore, he does not realize that both addons use the namespace &amp;quot;foo&amp;quot;, or does not understand how the namespace is relevant to the file choice, and does not think to back up his persistence data from bar::foo.&lt;br /&gt;
Adam installs plank::foo, and starts a game with it.&lt;br /&gt;
plank::foo unintentionally loads the persistence data from bar::foo, and because some of plank::foo's persistent variables coincidentally have the same names as some of bar::foo's persistent variables, right from the beginning, Adam gets confusing messages referring to events in plank::foo that haven't happened yet. &lt;br /&gt;
Adam decides he does not like plank::foo, and so uninstalls it and reinstalls bar::foo. Adam starts a game with bar::foo, and discovers that, because of corruption from plank::foo, he has lost access to several of the unlockable units.&lt;br /&gt;
&lt;br /&gt;
=====Example B=====&lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;bar&amp;quot;  (henceforth referred to as &amp;quot;bar::foo&amp;quot;) has persistence data. &lt;br /&gt;
Addon &amp;quot;foo&amp;quot; by author &amp;quot;plank&amp;quot; (henceforth referred to as &amp;quot;plank::foo&amp;quot;) also has persistence data.&lt;br /&gt;
bar::foo uses the namespace &amp;quot;foo_bar&amp;quot;, because it is recommended that wml authors use their own handle in addition to the addon title, to avoid collision.&lt;br /&gt;
plank::foo violates spec and simply uses &amp;quot;foo&amp;quot;.&lt;br /&gt;
Brian, a user, has played bar::foo extensively, likes it well, and has unlocked a number of special units in it, but has heard that plank::foo is well made, and would like to try it out.&lt;br /&gt;
Brian knows that two addons with the same name cannot be installed happily at the same time, and so he uninstalls bar::foo. Brian fully intends to return to bar::foo at some point, and so leaves the persistence data intact.&lt;br /&gt;
Brian installs plank::foo, and starts a game with it.&lt;br /&gt;
Brian discovers that plank::foo is a lovingly rendered campaign with a cohesive story and an engaging metanarrative thread tha reveals itself on subsequent playthroughs.&lt;br /&gt;
After many happy hours with plank::foo, Brian has done all there is to do in it, and seen all there is to see in it, and decides to return to bar::foo to finish rounding out his unlockables/achievements.&lt;br /&gt;
Brian uninstalls plank::foo and reinstalls bar::foo, and starts a game with bar::foo. Brian sees that all the data is intact and happily resumes his progress from just where he left it.&lt;br /&gt;
&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36037</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36037"/>
		<updated>2010-04-12T18:32:09Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Standard Multiplayer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; during [get_global_variable] will be loaded from the client of the initial host player. If the initial host player has been dropped from the connection, they will read from the current host. Persistent variables with &amp;quot;side=global&amp;quot; during [set_global_variable] will be stored to all players. Persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side.&lt;br /&gt;
&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36035</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36035"/>
		<updated>2010-04-12T14:01:42Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Namespace Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
===Uniqueness===&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle), to maximize uniqueness.&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
===Filesystem===&lt;br /&gt;
Because (the first section) of a namespace will be the cfg file name, all characters in a namespace must be filename safe. That is, they cannot include '*', '?', ' ', '/', '\', '&amp;lt;', '&amp;gt;', '|', or '&amp;quot;'. Additionally, '.' will be interpreted specially, so WML authors should be aware of that.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; will be stored and loaded from the client of the initial host player, and persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side. &amp;lt;br/&amp;gt;&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36034</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36034"/>
		<updated>2010-04-12T13:53:24Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Namespace Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
Tentatively, I am suggesting that namespaces be of the format (addon-name)_(author-handle)&lt;br /&gt;
For example, (judging by info in its _main.cfg) the &amp;quot;Love to Death&amp;quot; UMC campaign would use the namespace &amp;quot;Love_to_Death_Geos_PP2_etc&amp;quot;.&lt;br /&gt;
However, this is extremely open to suggestion and revision.&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; will be stored and loaded from the client of the initial host player, and persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side. &amp;lt;br/&amp;gt;&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36033</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36033"/>
		<updated>2010-04-12T13:26:40Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Persistence Config Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
TODO: Determine suggested format for namespace to minimize chances of collision. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; will be stored and loaded from the client of the initial host player, and persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side. &amp;lt;br/&amp;gt;&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. I believe it would be useful to provide facilities for further structure, allowing [variables] blocks to be enclosed within further tags.&lt;br /&gt;
====Example====&lt;br /&gt;
    [variables]&lt;br /&gt;
      scalar=&amp;quot;value&amp;quot;&lt;br /&gt;
      [some_container]&lt;br /&gt;
        someint=&amp;quot;42&amp;quot;&lt;br /&gt;
        somestring=&amp;quot;m-theory&amp;quot;&lt;br /&gt;
      [/container]&lt;br /&gt;
    [/variables]&lt;br /&gt;
    [arbitrary_namespace]&lt;br /&gt;
      [variables]&lt;br /&gt;
        thing=&amp;quot;boring&amp;quot;&lt;br /&gt;
      [/variables]&lt;br /&gt;
    [/arbitrary_namespace]&lt;br /&gt;
    [pirates]&lt;br /&gt;
      [ninjas]&lt;br /&gt;
        [variables]&lt;br /&gt;
          ninjapirate=&amp;quot;robotzombie&amp;quot;&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/ninjas]&lt;br /&gt;
    [/pirates]&lt;br /&gt;
====Proposed Syntax====&lt;br /&gt;
In order to allow WML authors to structure their persistence file in an arbitrarily defined manner, I suggest an extension to the parsing of the namespace attribute in global_variable tags: . should be used to denote sub-namespace access in the same way that, in variables, . denotes access to member variables of a container. This will allow WML authors to keep their variables organized in specific ways that make sense to them, as well as allowing for reuse of variable names in different contexts.&lt;br /&gt;
=====An example=====&lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      from_local=boring&lt;br /&gt;
      to_global=thing&lt;br /&gt;
      namespace=&amp;quot;filename.arbitrary_namespace&amp;quot;&lt;br /&gt;
      side=1&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
=====Special Namespaces=====&lt;br /&gt;
Obviously, &amp;quot;variables&amp;quot; and any other automatically generated tags would have to be reserved, and therefore invalid as sections in the namespace attribute. However, we could also provide keyword namespaces that have specific effects on their contained variables. For instance, as a an example the [single_player] namespace could be provided to specify variables that are not to be used during multiplayer.&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36032</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36032"/>
		<updated>2010-04-12T12:30:19Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
TODO: Determine suggested format for namespace to minimize chances of collision. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; will be stored and loaded from the client of the initial host player, and persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side. &amp;lt;br/&amp;gt;&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. Further structure may be defined in the future. It is likely that the [variables][/variables] block(s) will be nested within some other tags to specify what aspect of the addon the persistent data pertains to.&lt;br /&gt;
===Example===&lt;br /&gt;
    [campaign]&lt;br /&gt;
      id=&amp;quot;somecampaign&amp;quot;&lt;br /&gt;
      ...&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario1&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario2&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      ...&lt;br /&gt;
    [/campaign]&lt;br /&gt;
===User Defined vs Automatic===&lt;br /&gt;
Should the persistence configuration structure be user-definable, or automatically generated? If it is user definable, what syntax should be used to denote blocks and block names?&lt;br /&gt;
If it is automatically generated, how does wesnoth determine what block any given variable should go in?&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36026</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36026"/>
		<updated>2010-04-12T06:41:43Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619 Patch 1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
 and/or design and implement solutions for other contexts of multiplayer games. (E.g. dedicated server mode, game-master mode, peer-to-peer or 'normal' mode)&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
TODO: Determine suggested format for namespace to minimize chances of collision. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; will be stored and loaded from the client of the initial host player, and persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side. &amp;lt;br/&amp;gt;&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. Further structure may be defined in the future. It is likely that the [variables][/variables] block(s) will be nested within some other tags to specify what aspect of the addon the persistent data pertains to.&lt;br /&gt;
===Example===&lt;br /&gt;
    [campaign]&lt;br /&gt;
      id=&amp;quot;somecampaign&amp;quot;&lt;br /&gt;
      ...&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario1&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario2&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      ...&lt;br /&gt;
    [/campaign]&lt;br /&gt;
===User Defined vs Automatic===&lt;br /&gt;
Should the persistence configuration structure be user-definable, or automatically generated? If it is user definable, what syntax should be used to denote blocks and block names?&lt;br /&gt;
If it is automatically generated, how does wesnoth determine what block any given variable should go in?&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36025</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36025"/>
		<updated>2010-04-12T06:07:49Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, preliminary specification for persistence handling is complete for single player purposes.&lt;br /&gt;
*May 24 - June 2: Implement prototype solution for single player context.&lt;br /&gt;
**Milestone: By June 2, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By July 4th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
**Milestone: By July 12th (Midterm), there is a complete specification addressing all concerns for standard multiplayer.&lt;br /&gt;
*July 13 - July 27: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading.&lt;br /&gt;
**Milestone: By July 27th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By August 16th, multiplayer handling of persistence data is satisfactory to majority of players and developers.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Design and implement preliminary specification while researching the internal workings of scenario/campaign design, and discussing with mentors and UMC developers to determine needs.&lt;br /&gt;
**Milestone: By May 23rd, SP mode handles persistence data accurately to preliminary spec.&lt;br /&gt;
*May 24 - June 7: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
**Milestone: By June 7th, specification for persistence handling in SP contexts is finalized and implemented accurately.&lt;br /&gt;
*June 8 - June 13: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*June 14 - June 28: Implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading. &lt;br /&gt;
**Milestone: By June 28th, persistence data works and syncs in standard MP mode to preliminary spec.&lt;br /&gt;
*June 29 - July 12: Refine solution through iterative design and implementation with continued discussion.&lt;br /&gt;
**Milestone: By July 12th (Midterm), specification for standard MP handling of persistence data is finalized and implemented.&lt;br /&gt;
*July 13 - July 27: Discuss with player, software dev, and UMC dev community to determine details about needs for gamemaster mode.&lt;br /&gt;
*July 28 - August 11: Implement proof of concept gamemaster mode.&lt;br /&gt;
**Milestone: By August 11th, game master mode is functioning.&lt;br /&gt;
*August 11 - August 16: Refine game master mode iteratively via mentor, player, and UMC dev feedback.&lt;br /&gt;
**Milestone: By August 16th (final), game master mode is satisfactory to player needs.&lt;br /&gt;
&lt;br /&gt;
 and/or design and implement solutions for other contexts of multiplayer games. (E.g. dedicated server mode, game-master mode, peer-to-peer or 'normal' mode)&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
TODO: Determine suggested format for namespace to minimize chances of collision. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; will be stored and loaded from the client of the initial host player, and persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side. &amp;lt;br/&amp;gt;&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. Further structure may be defined in the future. It is likely that the [variables][/variables] block(s) will be nested within some other tags to specify what aspect of the addon the persistent data pertains to.&lt;br /&gt;
===Example===&lt;br /&gt;
    [campaign]&lt;br /&gt;
      id=&amp;quot;somecampaign&amp;quot;&lt;br /&gt;
      ...&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario1&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario2&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      ...&lt;br /&gt;
    [/campaign]&lt;br /&gt;
===User Defined vs Automatic===&lt;br /&gt;
Should the persistence configuration structure be user-definable, or automatically generated? If it is user definable, what syntax should be used to denote blocks and block names?&lt;br /&gt;
If it is automatically generated, how does wesnoth determine what block any given variable should go in?&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36023</id>
		<title>SummerOfCodeProposal JodyNorthup</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SummerOfCodeProposal_JodyNorthup&amp;diff=36023"/>
		<updated>2010-04-12T04:16:47Z</updated>

		<summary type="html">&lt;p&gt;Upthorn: /* If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2010Student_2|upthorn|SoC Ideas Persistent Gameworld}}&lt;br /&gt;
[[Category:SoC Ideas Persistent Gameworld]]&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
====Jody Northup - Implement gameworld data persistence====&lt;br /&gt;
This is the [[SoC_Ideas_Persistent_Gameworld|Persistent Gameworld]] idea.&amp;lt;br/&amp;gt;&lt;br /&gt;
If accepted, I would communicate extensively with the community to determine a solution that provides gameworld persistence with the greatest ease of access and implementation for the established community of world and campaign builders for Wesnoth.&amp;lt;br/&amp;gt;&lt;br /&gt;
Currently, I expect that this will involve extending WML, and creation of some system of communication about the extended WML for multiplayer games.&lt;br /&gt;
&lt;br /&gt;
=IRC=&lt;br /&gt;
Upthorn, Upth&lt;br /&gt;
&lt;br /&gt;
=SoC Application=&lt;br /&gt;
[http://socghop.appspot.com/gsoc/student_proposal/review/google/gsoc2010/upthorn/t127026899399 Upthorn - Data saving for persistent game worlds]&lt;br /&gt;
&lt;br /&gt;
=Questionnaire=&lt;br /&gt;
===Basics===&lt;br /&gt;
&lt;br /&gt;
====Write a small introduction to yourself.====&lt;br /&gt;
My name is Jody Northup. I am a 25 year old college student from the United States. Under normal circumstances, I should have graduated by now, but there have been a number of obstacles on my route to academic success.&lt;br /&gt;
&lt;br /&gt;
I have been programming since I was introduced to C++ in the summer of 1999.&lt;br /&gt;
&lt;br /&gt;
====State your preferred email address.====&lt;br /&gt;
upthorn@gmail.com&lt;br /&gt;
&lt;br /&gt;
====If you have chosen a nick for IRC and Wesnoth forums, what is it?====&lt;br /&gt;
*irc: Upthorn&lt;br /&gt;
*irc alternate: Upth&lt;br /&gt;
*Wesnoth forums: Upthorn&lt;br /&gt;
*gna.org: Upthorn&lt;br /&gt;
&lt;br /&gt;
====Why do you want to participate in summer of code?====&lt;br /&gt;
It is a good opportunity to gain experience in aspects of programming that aren't covered in classes, it is a great way to contribute to the open source community on projects that I believe in or even make use of myself, being able to contribute usefully to something gives me a great sense of accomplishment, and it is much more fun than any other summer job opportunity I know of.&lt;br /&gt;
&lt;br /&gt;
====What are you studying, subject, level and school?====&lt;br /&gt;
I'm an undergrad with an undeclared major at Sacramento City College. In terms of credit earned, I am in my third year, in terms of time spent I am in my 5th year, and in terms of the length of time remaining until I graduate, I might as well just be starting my 2nd year.&lt;br /&gt;
In another year or two I hope to transfer to the University of Maryland, where I plan to double-major in Computer Science and Linguistics, getting a simultaneous degree in both if possible.&lt;br /&gt;
&lt;br /&gt;
====What country are you from, at what time are you most likely to be able to join IRC?====&lt;br /&gt;
I live on the west coast of the United States (GMT-7 during the summer), but my sleep schedule is very flexible. I am generally available on between around 19:00 and 11:00 GMT, but I can change this during the coding period if it is inconvenient to my mentor. Until my class period ends, I will be completely unavailable on Wednesdays.&lt;br /&gt;
&lt;br /&gt;
====Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.====&lt;br /&gt;
I may be unavailable from 23:00 Wednesday to 19:00 or later on Thursdays (GMT), but this commitment can be cancelled if there is urgent work to be done.&lt;br /&gt;
Additionally, I would like to take up an additional part-time job during the summer if I can fit one into the schedule, but there are no definite plans around this at the moment.&lt;br /&gt;
I forgot to mention this earlier, but I plan to enroll in a math class during summer session, I do not yet know what schedule it will be, but it should not interfere greatly.&lt;br /&gt;
&lt;br /&gt;
===Experience===&lt;br /&gt;
&lt;br /&gt;
====What programs/software have you worked on before?====&lt;br /&gt;
* A variety of programming projects for high school and college classes&lt;br /&gt;
* I have hacked around quite a bit on open source emulators. Primarily the [http://code.google.com/p/gens-rerecording/ rerecording branch of gens] (see [http://tasvideos.org/WelcomeToTASVideos.html#How TASVideos.org introduction] and these [http://tasvideos.org/forum/viewtopic.php?p=77913#779136 forum] [http://tasvideos.org/forum/viewtopic.php?t=7465 threads] for more information, with some work also being done on snes9x and mupen64.&lt;br /&gt;
* I have done a great deal of feature programming and debugging work on the [http://info.sonicretro.org/Sonic_Megamix Sonic 1 MegaMix] romhacking project for the sega genesis.&lt;br /&gt;
* I have done some simple reverse engineering work to examine a simple archive file format and help create a translation patch for the Japanese indie game Bunny Must Die.&lt;br /&gt;
* I have done some minor testing and debugging work on a project to encapsulate windows games in a deterministic environment, allowing input to be recorded and replayed without concern for RNG input from the system clock, or other sources.&lt;br /&gt;
* I worked on ScummVM for Summer of Code last year, implementing an API to allow engine modules to negotiate with backend modules to determine color depth.&lt;br /&gt;
&lt;br /&gt;
====Have you developed software in a team environment before? (As opposed to hacking on something on your own)====&lt;br /&gt;
Yes, I frequently collaborate with other developers in my development of gens, and Sonic 1 Megamix, as well as having worked in pair and group projects for classes. And, of course, I contributed to ScummVM for last year's Summer of Code.&lt;br /&gt;
&lt;br /&gt;
====Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?====&lt;br /&gt;
I participated in last year's summer of code as a student for ScummVM. My project was [http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2009/scummvm/t124024841147 providing support for RGB color games]. I was successful, but had a great snag towards the end as I completed my project as proposed before the midterm, went on a pre-arranged 2-week vacation, and had a great deal of difficulty with the project I was assigned to work on for the remainder of the summer of code period.&lt;br /&gt;
&lt;br /&gt;
====Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.====&lt;br /&gt;
I have been the project maintainer and coordinator of the Gens-rerecording project since about mid-2006, having produced many new features, created a google code project page, and organized the development of many more during that time.&lt;br /&gt;
&lt;br /&gt;
====Gaming experience - Are you a gamer?====&lt;br /&gt;
Yes, I enjoy games, although lately I haven't been playing them as much as I used to.&lt;br /&gt;
&lt;br /&gt;
====What type of gamer are you?====&lt;br /&gt;
I am an obsessive perfectionist when it comes to gaming. I always try again and again until I get the best possible outcome, and I've collected all the items. Sometimes the frustration from this will drive me to save-scum, or edit my saves outright.&lt;br /&gt;
&lt;br /&gt;
====What type of games?====&lt;br /&gt;
I love all types of games, from real time strategy (command &amp;amp; conquer, starcraft, total annihilation) and turn-based strategy (wesnoth, civilization) to RPGs (Planescape: Torment, Skies of Arcadia), adventures (King's Quest, Space Quest, The Void/Тургор), platformers (Sonic the Hedgehog, Mario) and racing games (Virtua Racing, Burnout) and even to First person shooters (Deus Ex, Unreal Tournament) and simulations (Escape Velocity, Dwarf Fortress)&lt;br /&gt;
&lt;br /&gt;
====What type of opponents do you prefer?====&lt;br /&gt;
I prefer opponents that are on the same level or slightly better than me (so, generally, ones that are not very good).&lt;br /&gt;
&lt;br /&gt;
====Are you more interested in story or gameplay?====&lt;br /&gt;
I cannot choose between story and gameplay. In the best games, there is no separation between the two, but either can hold up a good game on its own.&lt;br /&gt;
&lt;br /&gt;
====Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.====&lt;br /&gt;
Yes, I got hooked on wesnoth during my vacation last summer, and the Heir to the Throne campaign became one of the greatest difficulties I had in accomplishing additional work for ScummVM.&lt;br /&gt;
I am not very good at strategy games, so I have not even attempted multiplayer yet.&lt;br /&gt;
&lt;br /&gt;
====If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.====&lt;br /&gt;
* I did submit a patch to correct the VC9 project files, but then I realized it was a duplicate of one from three weeks earlier.&lt;br /&gt;
* [https://gna.org/patch/index.php?1612 Patch 1612] -- implements [http://www.wesnoth.org/forum/viewtopic.php?f=15&amp;amp;t=15880 Sapient's proposed changes to allied healing].&lt;br /&gt;
* [https://gna.org/patch/?1619] -- provides prototype implementation of [[SoC Ideas Persistent Gameworld#WML_Syntax|Crab's proposed WML syntax]] for saving/loading persistence data.&lt;br /&gt;
&lt;br /&gt;
===3) Communication skills===&lt;br /&gt;
&lt;br /&gt;
====Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.====&lt;br /&gt;
I am a native English speaker, and my proficiency with written English is better than average.&lt;br /&gt;
&lt;br /&gt;
====What spoken languages are you fluent in?====&lt;br /&gt;
I am a fluent native speaker of English, can communicate alright in Japanese, and am at a basic level in Mandarin and Korean. I hope to learn Russian next year.&lt;br /&gt;
&lt;br /&gt;
====Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.====&lt;br /&gt;
I do not know about wesnoth players specifically, but I am fairly good at interacting with players of other games. I tend to be friendly and open, and I understand that the other players' insults and other such things are just for fun and don't mean anything.&lt;br /&gt;
&lt;br /&gt;
====Do you give constructive advice?====&lt;br /&gt;
I do give constructive advice whenever I can, although sometimes I think I cause offense by mistake. I always try to think my criticism through so that there is a clear indication of how the aspect could be improved.&lt;br /&gt;
&lt;br /&gt;
====Do you receive advice well?====&lt;br /&gt;
I believe so, as long as it is clear and helpful.&lt;br /&gt;
&lt;br /&gt;
====Are you good at sorting useful criticisms from useless ones?====&lt;br /&gt;
I think I am pretty good at sorting helpful criticism from [http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/misc.html#BIKESHED-PAINTING bikeshed painting], yes.&lt;br /&gt;
&lt;br /&gt;
====How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want====&lt;br /&gt;
I like to keep a good balance between discussing changes and coding proof of concepts. In last year's summer of code, I had to interact extensively with the development community in order to design a useful API for them, but at times when it wasn't clear what the community preference was, I would make a proof of concept to demonstrate the features and drawbacks of a given method.&lt;br /&gt;
Some of the work would be thrown out, but I did my best to maximize the amount of work that could be reused on a different method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Project===&lt;br /&gt;
&lt;br /&gt;
====Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?====&lt;br /&gt;
I did select a project from your list. Specifically, I selected [[SoC_Ideas_Persistent_Gameworld|the persistent gameworld]] project.&lt;br /&gt;
I would like to concentrate on the necessary modifications to WML to make it work in single player, and add multiplayer support as time permits.&lt;br /&gt;
&lt;br /&gt;
====Why did you choose this project?====&lt;br /&gt;
It seemed like something that I am farely likely to be able to accomplish at my current skill level, but is large enough that I shouldn't have to worry about completing it too early as happened last summer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.====&lt;br /&gt;
Pessimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design.&lt;br /&gt;
*May 24 - June 2: Discuss with mentors and UMC developers to determine precise needs of world persistence project&lt;br /&gt;
*June 3 - July 12: Design a solution that addresses needs of UMC developers&lt;br /&gt;
*July 13 - August 16: Implement solution for saving and loading in single player context.&lt;br /&gt;
&lt;br /&gt;
Optimistic:&lt;br /&gt;
*Now - May 23: Research the internal workings of WML, and scenario/campaign design, discuss with mentors and UMC developers to determine needs.&lt;br /&gt;
*May 24 - June 2: Design and implement proof of concept solution for this in single player context.&lt;br /&gt;
*June 3 - July 4: Refine solution through iterative design and implementation with continuous discussion with community members.&lt;br /&gt;
*July 5 - July 12: Discuss with player, software dev, and UMC dev community to determine details about needs for world persistence in multiplayer context.&lt;br /&gt;
*July 13 - July 27: Design and implement proof of concept solution for addressing multiplayer needs in persistence data saving/loading&lt;br /&gt;
*July 28 - August 16: Refine solution through iterative design and implementation with continued discussion and/or design and implement solutions for other contexts of multiplayer games. (E.g. dedicated server mode, game-master mode, peer-to-peer or 'normal' mode)&lt;br /&gt;
&lt;br /&gt;
====Include as much technical detail about your implementation as you can====&lt;br /&gt;
I have relocated this content to [[#Project Details|Project Details]] for ease of organization.&lt;br /&gt;
&lt;br /&gt;
====What do you expect to gain from this project?====&lt;br /&gt;
Experience with custom scripting language implementations, understanding of how to process XML-style languages efficiently, a sense of having been able to do something useful for someone besides myself, and a nifty t-shirt from google.&lt;br /&gt;
&lt;br /&gt;
====What would make you stay in the Wesnoth community after the conclusion of SOC?====&lt;br /&gt;
My interest in the project itself, and any relationships I might forge with community members during the coding period.&lt;br /&gt;
&lt;br /&gt;
===Practical considerations===&lt;br /&gt;
&lt;br /&gt;
====Are you familiar with any of the following tools or languages?====&lt;br /&gt;
&lt;br /&gt;
    * Subversion (used for all commits)&lt;br /&gt;
Yes, I have used it extensively for gens development, megamix development, and my work on ScummVM last summer.&lt;br /&gt;
    * C++ (language used for all the normal source code)&lt;br /&gt;
Yes, I have been working with C++ for nearly 11 years now.&lt;br /&gt;
    * STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
I am fairly familiar with the STL, and worked almost exclusively with SDL on ScummVM last summer. I am new to Boost, but in the past I have been able to catch on to these things fairly quickly with a little bit of practice.&lt;br /&gt;
    * Python (optional, mainly used for tools)&lt;br /&gt;
I have worked with python somewhat, contributing a few minor bugfixes to the Civilization 4 mod &amp;quot;Fall From Heaven II&amp;quot;&lt;br /&gt;
    * build environments (eg cmake/autotools/scons)&lt;br /&gt;
I do not have any experience with cmake, autotools, or scons.&lt;br /&gt;
    * WML (the wesnoth specific scenario language)&lt;br /&gt;
I have some minor experience with WML, from editing my own wesnoth savegames last summer.&lt;br /&gt;
    * Lua (used in combination with WML to create scenarios)&lt;br /&gt;
I have experience both in scripting Lua, and in working with the Lua C API to provide hooks and bindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Which tools do you normally use for development? Why do you use them?====&lt;br /&gt;
*C/C++: I generally use Microsoft Visual C/C++, because I am familiar with it from classes, and because it provides a very useful debugger that allows me to trace problems to their source quite quickly. I have used Dev-C++ in the past, though.&lt;br /&gt;
*Java: Eclipse, because it was recommended to me and I do not know anything about the others, and also because it provides a very useful debugger facility.&lt;br /&gt;
 &lt;br /&gt;
====What programming languages are you fluent in?====&lt;br /&gt;
C, C++, Lua, Java, Javascript.&lt;br /&gt;
&lt;br /&gt;
====Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!====&lt;br /&gt;
I have provided a telephone contact in [http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/upthorn/t127026899399 my SoC application.]&lt;br /&gt;
&lt;br /&gt;
=Project Details=&lt;br /&gt;
==Overview==&lt;br /&gt;
I will extend WML to provide for events that can save persistent data about what has occured in a scenario or campaign. This data will be accessible to the scenario and campaign in all future plays from the same machine (or related ones that ask for it by name), even if all normal savegames have been deleted. If I have time remaining once this is completed, I will attempt to extend this functionality into mult-player contexts in a meaningful way.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WML Syntax==&lt;br /&gt;
===Basic Syntax===&lt;br /&gt;
Crab has suggested &lt;br /&gt;
    [get_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_global=my_variable_name&lt;br /&gt;
      to_local=foo&lt;br /&gt;
    [/get_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [set_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      from_local=foo&lt;br /&gt;
      to_global=my_variable_name&lt;br /&gt;
    [/set_global_variable]&lt;br /&gt;
    &lt;br /&gt;
    [clear_global_variable]&lt;br /&gt;
      side=1&lt;br /&gt;
      namespace=my_addon&lt;br /&gt;
      global=my_variable_name&lt;br /&gt;
    [/clear_global_variable]&lt;br /&gt;
&lt;br /&gt;
====Additions====&lt;br /&gt;
=====Keyword: global=====&lt;br /&gt;
    side=global&lt;br /&gt;
Allows wml author to specify that the variable is not associated with a specific side, and is to be loaded from host during multiplayer.&lt;br /&gt;
&lt;br /&gt;
=====Default namespace=====&lt;br /&gt;
    namespace=my_addon&lt;br /&gt;
May be placed in addon cfg files to specify a default namespace for global variables set by this campaign. This namespace will be used if a &amp;quot;namespace=&amp;quot; line is not specified in [*_global_variable] tags.&lt;br /&gt;
&lt;br /&gt;
===General Thoughts===&lt;br /&gt;
Crab's syntax for WML events seems reasonable, so I will be using it as the base on which to build. Currently, to set a persistent variable with a constant value, it is recommended to make a temporary variable with that value, and then set the global variable from that. However, syntax may be defined later to directly set a global variable with a constant value.&amp;lt;br/&amp;gt;&lt;br /&gt;
In general, any deviation I make from crab's suggested syntax will be done in order to make persistent &amp;quot;global variables&amp;quot; work more like regular WML variables from the standpoint of a WML author.&lt;br /&gt;
==Namespace Format==&lt;br /&gt;
TODO: Determine suggested format for namespace to minimize chances of collision. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Storage==&lt;br /&gt;
===Single Player===&lt;br /&gt;
Persistent data will be stored in &amp;quot;(user data directory)/persist/(namespace).cfg&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Standard Multiplayer===&lt;br /&gt;
Persistent data will be stored locally to each player. Persistent variables with &amp;quot;side=global&amp;quot; will be stored and loaded from the client of the initial host player, and persistent variables that are side-specific will be stored and loaded from the client of the player that has taken the specific side. &amp;lt;br/&amp;gt;&lt;br /&gt;
===Dedicated Game Master Multiplayer===&lt;br /&gt;
In the case of a dedicated game master, persistent variables from all sides will be stored and loaded from the game master. However, due to the nature of game master mode, it is unlikely that the standard single-player storage location will be sufficient.&lt;br /&gt;
TODO: Define storage location for game master.&lt;br /&gt;
&lt;br /&gt;
==Persistence Config Format==&lt;br /&gt;
===Overview===&lt;br /&gt;
Internally, persistence cfg data will primarily be collections a [variables][/variables] block surrounding valid [[VariablesWML#Kinds_of_Variables|variable definitions]]. Further structure may be defined in the future. It is likely that the [variables][/variables] block(s) will be nested within some other tags to specify what aspect of the addon the persistent data pertains to.&lt;br /&gt;
===Example===&lt;br /&gt;
    [campaign]&lt;br /&gt;
      id=&amp;quot;somecampaign&amp;quot;&lt;br /&gt;
      ...&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario1&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      [scenario]&lt;br /&gt;
        id=&amp;quot;scenario2&amp;quot;&lt;br /&gt;
        ...&lt;br /&gt;
        [variables]&lt;br /&gt;
          ...&lt;br /&gt;
        [/variables]&lt;br /&gt;
      [/scenario]&lt;br /&gt;
      ...&lt;br /&gt;
    [/campaign]&lt;br /&gt;
===User Defined vs Automatic===&lt;br /&gt;
Should the persistence configuration structure be user-definable, or automatically generated? If it is user definable, what syntax should be used to denote blocks and block names?&lt;br /&gt;
If it is automatically generated, how does wesnoth determine what block any given variable should go in?&lt;br /&gt;
&lt;br /&gt;
==Handling Of Eras==&lt;br /&gt;
Era add-ons will also be allowed to save persistence data, but it has not yet been determined how era persistence and scenario persistence will interact. &lt;br /&gt;
&lt;br /&gt;
See below for detailed consideration of this:&lt;br /&gt;
==Addon interaction==&lt;br /&gt;
If a user runs a campaign that saves persistence data with an era active, which of the following options should be the result?&lt;br /&gt;
===Continue as normal===&lt;br /&gt;
The campaign doesn't know or care that the era is active, and loads and saves persistence data as usual. &lt;br /&gt;
&lt;br /&gt;
This is the easiest to implement, but seems like it has potentially undesirable implications for players and UMC developers.&lt;br /&gt;
===Disable persistence functionality===&lt;br /&gt;
Campaigns have their persistence functionality disabled while the era is active.&lt;br /&gt;
&lt;br /&gt;
This option preserves data integrity, but seems overly limiting. Additionally, this seems to shut eras out of the whole world persistence scene. Not a good solution.&lt;br /&gt;
===Second set of data===&lt;br /&gt;
Campaign loads and saves a different second set of persistence data.&lt;br /&gt;
&lt;br /&gt;
This preserves data integrity while maintaining flexibility, but comes with a whole host of additional considerations:&lt;br /&gt;
&lt;br /&gt;
====On a campaign's first run under the active era, what should happen?====&lt;br /&gt;
#Campaign copies existing persistence data into second set.&lt;br /&gt;
#Campaign saves and loads an entirely new version of persistence data for use with this era.&lt;br /&gt;
My gut instinct says that 2 is the better option, but I can easily imagine a significant set of players being upset with either decision. Perhaps we should prompt the player and allow them to decide.&lt;br /&gt;
&lt;br /&gt;
====Where do we store the second set of data?====&lt;br /&gt;
=====(user_data_directory)\persist\(era_id)\(namespace).cfg=====&lt;br /&gt;
This is a simple solution, but it may cause tons of clutter in the user's persistence data directory.&lt;br /&gt;
=====The same persistence .cfg file as normal, but enclosed in an [era][/era] block.=====&lt;br /&gt;
I like this option better, but it brings its own set of questions -- what about persistence data that the era wants to save, does it get enclosed into [campaign][/campaign] blocks? If so, how do we know what files to put [era][/era] in and what ones to put [campaign][/campaign]?&lt;br /&gt;
I propose that persistence .cfg files don't care what type of addon made them, and may have any number of [campaign][/campaign] blocks in them. If an era is active, it should make an [era][/era] block at the level between [campaign][/campaign] and [scenario][/scenario].&lt;br /&gt;
&lt;br /&gt;
====What if era is irrelevant to the purpose of a persistent variable?====&lt;br /&gt;
For example, a variable that just keeps track of how many times this campaign has been played total?&lt;br /&gt;
=====User specifies interaction=====&lt;br /&gt;
Provide some method allowing campaign authors to specify whether any given variable should be duplicated when eras are active.&lt;br /&gt;
This would require syntax to be defined for [*_global_variable] blocks.&lt;br /&gt;
I suggest an optional &amp;quot;era=&amp;quot; line, with the following effects:&lt;br /&gt;
&lt;br /&gt;
    era=all&lt;br /&gt;
There is only one copy made of this variable, all eras use it.&lt;br /&gt;
&lt;br /&gt;
    era=any&lt;br /&gt;
This is the default if the line is not provided. A copy of this variable is made for each era that this campaign is used with.&lt;br /&gt;
&lt;br /&gt;
Additionally, this can be extended to allow for&lt;br /&gt;
    era=&amp;quot;era_name&amp;quot;,&amp;quot;era_name2&amp;quot;&lt;br /&gt;
which would allow campaign authors to specify global variables that only exist in certain eras, thereby allowing an easy path for UMC developers to build in era/campaign interactions.&lt;br /&gt;
&lt;br /&gt;
Of course, there are plenty of other options we could take to allow user-specified era/campaign interaction, and this option would practically necessitate the addition of a &amp;quot;campaign=&amp;quot; for era addons to use.&lt;br /&gt;
=====Don't worry about it, it's not that important=====&lt;br /&gt;
Allow this one instance of eras interacting poorly with campaign persistence data, since it isn't ever going to be that big a deal if an era-campaign config keeps a separate play count from the campaign alone. And players can always edit the persistence files without much difficulty if it troubles them.&lt;br /&gt;
==Optional Subtasks==&lt;br /&gt;
===User profile===&lt;br /&gt;
Add user profiles, so that multiple users can share the same wesnoth installation without having to share persistence data and savegames.&lt;br /&gt;
&lt;br /&gt;
For this we will need a &lt;br /&gt;
====UI====&lt;br /&gt;
*a menu option to select profile (perhaps a &amp;quot;tab&amp;quot; in preferences, along with graphics, sound, etc)&lt;br /&gt;
*a select profile dialog&lt;br /&gt;
**a list of profiles that currently exist&lt;br /&gt;
**an option to create a new profile&lt;br /&gt;
*dialog allowing the user to specify a profile name&lt;br /&gt;
**option to migrate previous data into new profile&lt;br /&gt;
====backend====&lt;br /&gt;
*Append profile name as subdirectory to user_data directory path.&lt;br /&gt;
*Save selected profile to config on exit (or profile selection)&lt;br /&gt;
*Load selected profile from config on startup&lt;/div&gt;</summary>
		<author><name>Upthorn</name></author>
		
	</entry>
</feed>