https://wiki.wesnoth.org/api.php?action=feedcontributions&user=Aethaeryn&feedformat=atomThe Battle for Wesnoth Wiki - User contributions [en]2024-03-28T18:19:18ZUser contributionsMediaWiki 1.31.16https://wiki.wesnoth.org/index.php?title=Lore&diff=72527Lore2024-03-25T00:24:22Z<p>Aethaeryn: Rename "Timeline" to "History" and rewrite the section</p>
<hr />
<div>{{Template: Stub}}<br />
<br />
The '''lore''' of Wesnoth is primarily in the story of the mainline campaigns. Additionally, secondary information about the units, factions, and races are available in the in-game help.<br />
<br />
==History==<br />
<br />
''Main article: [[Timeline of Wesnoth]]''<br />
<br />
The history of Wesnoth uses the "YW" ("Years Wesnoth") calendar, where events taking place before the founding of Wesnoth are in years that are counting down and described as "BW" ("Before Wesnoth"), while events afterward are in years that are "YW" and counting up. There is no year zero. [[Mainline Campaigns#The Rise of Wesnoth|The Rise of Wesnoth]] (TRoW) is a campaign that takes place primarily in the BW years while most other campaigns are given YW dates. The far future does not use this calendar system.<br />
<br />
The events concerning Wesnoth mostly take place between 12 BW (right before the 5 BW start of TRoW) and 858 YW (when [[Mainline Campaigns#Son of the Black-Eye|Son of the Black-Eye]] ends).<br />
<br />
One of the most central campaigns to the history of Wesnoth, [[Mainline Campaigns#Heir to the Throne|Heir to the Throne]] (HttT), takes place 517-518 YW.<br />
<br />
Another pivotal period for Wesnoth is depicted in [[Mainline Campaigns#Eastern Invasion|Eastern Invasion]], which takes place 625-627 YW, when the lich Mal-Ravanal invades Wesnoth.<br />
<br />
===Multiplayer===<br />
<br />
The multiplayer [[Default Era]] and its factions are roughly from around the HttT time period of history (circa 500-550 YW). However, the Default Era (besides some of the faction names) should mostly still apply for the entire covered YW time span of 1 to 858 YW. The Default Era is especially applicable for the broad 350-700 YW period of history where most of the mainline campaigns take place.<br />
<br />
The far future, as depicted in [[Mainline Campaigns#Under the Burning Suns|Under the Burning Suns]], does not use the same units or factions as the Default Era. These units are not available in a mainline multiplayer era.<br />
<br />
==Geography==<br />
<br />
''Main article: [[Geography of Wesnoth]]''<br />
<br />
The geography of the game ''The Battle for Wesnoth'' takes place almost entirely on a planet called Irdya and most campaigns take place on the Great Continent, in the areas in and surrounding the Kingdom of Wesnoth. The Great Continent is never pictured in its entirety and Wesnoth is located on the west coast of the Great Continent toward the north, but not in the far north.<br />
<br />
==Notable Figures==<br />
<br />
''Main article: [[WesnothFigures]]''<br />
<br />
The main people of note are the protagonists and antagonists of the mainline campaigns.<br />
<br />
[[Haldric I]] is the founder of the Kingdom of Wesnoth, as depicted in the Rise of Wesnoth. [[Konrad]] is a prince of the kingdom of Wesnoth five centuries later, as depicted in [[Mainline Campaigns#Heir to the Throne|Heir to the Throne]].<br />
<br />
==See also==<br />
* [[Mainline Campaigns]]<br />
* [[Races]]<br />
* [[Factions and Eras]]<br />
* [[SecretLore]] (spoilers)<br />
* [[Poetry of Wesnoth]]<br />
<br />
[[Category:World of Wesnoth]]<br />
[[Category:History]]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=Lore&diff=72526Lore2024-03-24T23:51:02Z<p>Aethaeryn: Add two more "see also" links and two categories</p>
<hr />
<div>{{Template: Stub}}<br />
<br />
The '''lore''' of Wesnoth is primarily in the story of the mainline campaigns. Additionally, secondary information about the units, factions, and races are available in the in-game help.<br />
<br />
==Timeline==<br />
<br />
''Main article: [[Timeline of Wesnoth]]''<br />
<br />
The history of Wesnoth uses the "YW" ("Years Wesnoth") calendar, where events taking place before the founding of Wesnoth are in years that are counting down and described as "BW" ("Before Wesnoth"), while events afterward are in years that are "YW" and counting up. There is no year zero. [[Mainline Campaigns#The Rise of Wesnoth|The Rise of Wesnoth]] (TRoW) is a campaign that takes place primarily in the BW years while most other campaigns are given YW dates. The far future does not use this system.<br />
<br />
The events concerning Wesnoth mostly take place between 12 BW (right before the 5 BW start of TRoW) and 858 YW (when [[Mainline Campaigns#Son of the Black-Eye|Son of the Black-Eye]] ends.<br />
<br />
One of the most central campaigns, [[Mainline Campaigns#Heir to the Throne|Heir to the Throne]] (HttT), takes place 517-518 YW.<br />
<br />
The multiplayer [[Default Era]] and its factions are roughly from around this HttT time period of history (circa 500-550 YW), but the Default Era (besides perhaps the faction names) should mostly still apply for the entire covered YW time span of 1 to 858 YW. The far future does not use the same calendar system or the same units.<br />
<br />
==Geography==<br />
<br />
''Main article: [[Geography of Wesnoth]]''<br />
<br />
The geography of the game ''The Battle for Wesnoth'' takes place almost entirely on a planet called Irdya and most campaigns take place on the Great Continent, in the areas in and surrounding the Kingdom of Wesnoth. The Great Continent is never pictured in its entirety and Wesnoth is located on the west coast of the Great Continent toward the north, but not in the far north.<br />
<br />
==Notable Figures==<br />
<br />
''Main article: [[WesnothFigures]]''<br />
<br />
The main people of note are the protagonists and antagonists of the mainline campaigns.<br />
<br />
[[Haldric I]] is the founder of the Kingdom of Wesnoth, as depicted in the Rise of Wesnoth. [[Konrad]] is a prince of the kingdom of Wesnoth five centuries later, as depicted in [[Mainline Campaigns#Heir to the Throne|Heir to the Throne]].<br />
<br />
==See also==<br />
* [[Mainline Campaigns]]<br />
* [[Races]]<br />
* [[Factions and Eras]]<br />
* [[SecretLore]] (spoilers)<br />
* [[Poetry of Wesnoth]]<br />
<br />
[[Category:World of Wesnoth]]<br />
[[Category:History]]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=Lore&diff=72525Lore2024-03-24T23:45:49Z<p>Aethaeryn: Add a central summary of Wesnoth lore in response to an IRC/Discord question</p>
<hr />
<div>{{Template: Stub}}<br />
<br />
The '''lore''' of Wesnoth is primarily in the story of the mainline campaigns. Additionally, secondary information about the units, factions, and races are available in the in-game help.<br />
<br />
==Timeline==<br />
<br />
''Main article: [[Timeline of Wesnoth]]''<br />
<br />
The history of Wesnoth uses the "YW" ("Years Wesnoth") calendar, where events taking place before the founding of Wesnoth are in years that are counting down and described as "BW" ("Before Wesnoth"), while events afterward are in years that are "YW" and counting up. There is no year zero. [[Mainline Campaigns#The Rise of Wesnoth|The Rise of Wesnoth]] (TRoW) is a campaign that takes place primarily in the BW years while most other campaigns are given YW dates. The far future does not use this system.<br />
<br />
The events concerning Wesnoth mostly take place between 12 BW (right before the 5 BW start of TRoW) and 858 YW (when [[Mainline Campaigns#Son of the Black-Eye|Son of the Black-Eye]] ends.<br />
<br />
One of the most central campaigns, [[Mainline Campaigns#Heir to the Throne|Heir to the Throne]] (HttT), takes place 517-518 YW.<br />
<br />
The multiplayer [[Default Era]] and its factions are roughly from around this HttT time period of history (circa 500-550 YW), but the Default Era (besides perhaps the faction names) should mostly still apply for the entire covered YW time span of 1 to 858 YW. The far future does not use the same calendar system or the same units.<br />
<br />
==Geography==<br />
<br />
''Main article: [[Geography of Wesnoth]]''<br />
<br />
The geography of the game ''The Battle for Wesnoth'' takes place almost entirely on a planet called Irdya and most campaigns take place on the Great Continent, in the areas in and surrounding the Kingdom of Wesnoth. The Great Continent is never pictured in its entirety and Wesnoth is located on the west coast of the Great Continent toward the north, but not in the far north.<br />
<br />
==Notable Figures==<br />
<br />
''Main article: [[WesnothFigures]]''<br />
<br />
The main people of note are the protagonists and antagonists of the mainline campaigns.<br />
<br />
[[Haldric I]] is the founder of the Kingdom of Wesnoth, as depicted in the Rise of Wesnoth. [[Konrad]] is a prince of the kingdom of Wesnoth five centuries later, as depicted in [[Mainline Campaigns#Heir to the Throne|Heir to the Throne]].<br />
<br />
==See also==<br />
* [[Mainline Campaigns]]<br />
* [[Races]]<br />
* [[Factions and Eras]]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=Aethaeryn%27s_Maps&diff=68016Aethaeryn's Maps2021-05-31T17:49:14Z<p>Aethaeryn: Update the status of the maps</p>
<hr />
<div>''The forum thread for Aethaeryn's Maps is located '''[http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 here]'''.<br />
<br />
'''''Note:''' The current version contains several maps that are broken on the current version of Wesnoth, and so it hasn't been uploaded to the add-ons server. Those maps might be temporarily removed if there's the demand to see it uploaded. The current location is [https://github.com/Aethaeryn/wesnoth-umc/tree/master/Aethaeryns_Maps on Github].''<br />
<br />
A collection of various multiplayer maps that I have worked on over the years and will continue to work on, Aethaeryn's Maps is my flagship add-on. Aethaeryn's Maps is a variety pack of many different kinds of maps whose only common denominator is that I made them. The latest version, 0.5, contains the following maps:<br />
<br />
===Current Maps===<br />
<br />
===2p Twin Rivers===<br />
'''Version:''' 0.5<br />
<br />
'''Type:''' Duel (Mainline Style)<br />
<br />
'''Description:''' As winter descends on a calm mountain valley, two factions wage a bloody war.<br />
<br />
===3p Fortress Defense===<br />
'''Version:''' 0.7<br />
<br />
'''Type:''' Team Survival<br />
<br />
'''Description:''' ''Three great armies stand up against an insurmountable alliance of humans and orcs.<br />
<br />
===4p Chambers===<br />
'''Version:''' 0.5<br />
<br />
'''Type:''' Free-For-All<br />
<br />
'''Description:''' ''Four small armies infiltrating an old temple fight over the overgrown ruins.<br />
<br />
===4p Fortress Assault===<br />
'''Version:''' 1.1<br />
<br />
'''Type:''' Team (3v1)<br />
<br />
'''Description:''' ''Three armies gather to assault a seemingly insurmountable fortress after a long siege. A variety of attack routes leads to a strategical challenge for both sides in this tactically difficult map.<br />
<br />
===4p Four Bases===<br />
'''Version:''' 0.4<br />
<br />
'''Type:''' Free-For-All<br />
<br />
'''Description:''' ''Four nobles fight over the rich valley in between their four bases.<br />
<br />
===5p Aethaeryn's Empires===<br />
''This map will be temporarily removed until the scripts are updated.''<br />
<br />
'''Version:''' 0.2<br />
<br />
'''Type:''' Free-For-All (Special Gameplay)<br />
<br />
'''Description:''' ''The human kingdom is in crisis as four invaders scheme to split it up!<br />
<br />
===5p Dwarven Fortress===<br />
''This map will be temporarily removed until the scripts are updated.''<br />
<br />
'''Version:''' 0.2<br />
<br />
'''Type:''' Team (3v2)<br />
<br />
'''Description:''' ''Two Dwarven clans struggle desperately to defend their native lands from greedy outsiders.<br />
<br />
===Removed Maps===<br />
<br />
These experimental maps were problematic in various ways and have currently been removed.<br />
<br />
===2p - Gladiator Arena===<br />
''This map has been removed,'' '''but will be restored with standard gameplay.'''<br />
<br />
'''Version:''' 0.5<br />
<br />
'''Type:''' Duel (Special Gameplay)<br />
<br />
'''Description:''' ''Two recently deceased necromancers gather in an unholy arena of the Underworld to entertain their overlords. Only one will earn his freedom.<br />
<br />
===3p Hide and Seek===<br />
''This map has been removed'', '''but the removal will be reverted.'''<br />
<br />
'''Version:''' 0.1<br />
<br />
'''Type:''' Team (2v1)<br />
<br />
'''Description:''' ''Elves struggle to defend their native forest from foreign invaders.<br />
<br />
===6p Random Rumble===<br />
''This map has been removed.''<br />
<br />
'''Version:''' 0.3<br />
<br />
'''Type:''' Free-For-All (Rumble-Style)<br />
<br />
'''Description:''' ''Six armies fight over an enchanted ruin where anything can happen.<br />
<br />
[[Category: Maps]]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=Aethaeryn%27s_Maps&diff=65582Aethaeryn's Maps2020-05-15T02:13:04Z<p>Aethaeryn: Update the page with current information so it's no longer obsolete.</p>
<hr />
<div>''The forum thread for Aethaeryn's Maps is located '''[http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 here]'''.<br />
<br />
'''''Note:''' The current version contains several maps that are broken on the current version of Wesnoth, and so it hasn't been uploaded to the add-ons server. Those maps might be temporarily removed if there's the demand to see it uploaded. The current location is [https://github.com/Aethaeryn/wesnoth-umc/tree/master/Aethaeryns_Maps on Github].''<br />
<br />
A collection of various multiplayer maps that I have worked on over the years and will continue to work on, Aethaeryn's Maps is my flagship add-on. Aethaeryn's Maps is a variety pack of many different kinds of maps whose only common denominator is that I made them. The latest version, 0.5, contains the following maps:<br />
<br />
===Current Maps===<br />
<br />
===2p Twin Rivers===<br />
'''Version:''' 0.5<br />
<br />
'''Type:''' Duel (Mainline Style)<br />
<br />
'''Description:''' As winter descends on a calm mountain valley, two factions wage a bloody war.<br />
<br />
===3p Fortress Defense===<br />
'''Version:''' 0.7<br />
<br />
'''Type:''' Team Survival<br />
<br />
'''Description:''' ''Three great armies stand up against an insurmountable alliance of humans and orcs.<br />
<br />
===4p Chambers===<br />
'''Version:''' 0.5<br />
<br />
'''Type:''' Free-For-All<br />
<br />
'''Description:''' ''Four small armies infiltrating an old temple fight over the overgrown ruins.<br />
<br />
===4p Fortress Assault===<br />
'''Version:''' 1.1<br />
<br />
'''Type:''' Team (3v1)<br />
<br />
'''Description:''' ''Three armies gather to assault a seemingly insurmountable fortress after a long siege. A variety of attack routes leads to a strategical challenge for both sides in this tactically difficult map.<br />
<br />
===4p Four Bases===<br />
'''Version:''' 0.4<br />
<br />
'''Type:''' Free-For-All<br />
<br />
'''Description:''' ''Four nobles fight over the rich valley in between their four bases.<br />
<br />
===5p Aethaeryn's Empires===<br />
'''Version:''' 0.2<br />
<br />
'''Type:''' Free-For-All (Special Gameplay)<br />
<br />
'''Description:''' ''The human kingdom is in crisis as four invaders scheme to split it up!<br />
<br />
===5p Dwarven Fortress===<br />
'''Version:''' 0.2<br />
<br />
'''Type:''' Team (3v2)<br />
<br />
'''Description:''' ''Two Dwarven clans struggle desperately to defend their native lands from greedy outsiders.<br />
<br />
===Removed Maps===<br />
<br />
These experimental maps were problematic in various ways and have currently been removed.<br />
<br />
===2p - Gladiator Arena===<br />
''This map has been removed.''<br />
<br />
'''Version:''' 0.5<br />
<br />
'''Type:''' Duel (Special Gameplay)<br />
<br />
'''Description:''' ''Two recently deceased necromancers gather in an unholy arena of the Underworld to entertain their overlords. Only one will earn his freedom.<br />
<br />
===3p Hide and Seek===<br />
''This map has been removed.''<br />
<br />
'''Version:''' 0.1<br />
<br />
'''Type:''' Team (2v1)<br />
<br />
'''Description:''' ''Elves struggle to defend their native forest from foreign invaders.<br />
<br />
===6p Random Rumble===<br />
''This map has been removed.''<br />
<br />
'''Version:''' 0.3<br />
<br />
'''Type:''' Free-For-All (Rumble-Style)<br />
<br />
'''Description:''' ''Six armies fight over an enchanted ruin where anything can happen.<br />
<br />
[[Category: Maps]]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=User:Aethaeryn&diff=57647User:Aethaeryn2016-03-27T02:38:11Z<p>Aethaeryn: /* Current Wesnoth Content */ updating add-on progress</p>
<hr />
<div>My username is '''Aethaeryn''' and this is my wiki user page. I'm a wiki sysop (moderator), and I'm also a regular on [[Support#IRC|IRC]] and the forums. Most of the wiki articles I maintain and work on are listed on this page. My biggest Wesnoth talent is probably in mapmaking, but I can do some WML coding and some sprite art.<br />
<br />
I have three ongoing Wesnoth projects: [[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)], [[Thunderstone]], and the [[Latin Translation]] ([http://www.wesnoth.org/forum/viewtopic.php?f=7&t=16158 thread], [http://www.wesnoth.org/gettext/index.lang.php?lang=la&version=trunk stats]).<br />
<br />
If you need to contact me, I'm "Aethaeryn" on the forums as well as on IRC ([http://freenode.net/ freenode]). This user-page lists my Wesnoth projects as well as pages I maintain for the Wesnoth wiki.<br />
<br />
==Current Wesnoth Content==<br />
<b><font size="3" color="#FF8000">(49.73% Avg. Completion)</font></b><br><br />
<!-- Use these colors<br />
<font color="#FF0000"><b>0% to 32% Complete</b></font><br />
<font color="#FF8000"><b>33% to 66% Complete</b></font><br />
<font color="#FFBF00"><b>67% to 89% Complete</b></font><br />
<font color="#00BF00"><b>90% to 99% Complete</b></font><br />
<font color="#00BF00"><b><i>100% Complete</i></b></font><br />
--><br />
===Published Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00427_ink.png</td><br />
<td><b>[[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)] (0.5.2)<br><br />
<font size="2" color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
</table><br />
<br />
===Unpublished Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00394_frenzy.png</td><br />
<td><b>[[Thunderstone|Thunderstone Era]]<br><br />
<font size="2" color="#FF0000">(12.5% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00433_lightning.png</td><br />
<td><b>Thunderstone Trilogy<br><br />
<font size="2" color="#FF0000">(2% Complete) (Wesnoth 1.9)</font></b><br></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00362_hammer-dwarven-runic.png</td><br />
<td><b>Era of Tyrants<br><br />
<font color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00418_staff-plague.png</td><br />
<td><b>Aethaeryn's MoD<br><br />
<font color="#FFBF00">(84.15% Complete) (Wesnoth 1.12)</font></b></td></tr><br />
</table><br />
<br />
==Maintained/Watched Wiki Pages==<br />
As a wiki moderator, I patrol the whole wiki for things such as vandalism and spam. These are the pages I particularly focus on for content and/or design.<br />
<br />
<div style="float: left; width: 50%"><br />
====Factions and Eras====<br />
*'''[[Factions and Eras]]'''<br />
*'''[[Default Era]]<br />
*[[Drakes]]<br />
*[[Knalgan Alliance]]<br />
*[[Loyalists]]<br />
*[[Northerners]]<br />
*[[Rebels]]<br />
*[[Undead]]<br />
<br />
=====Faction Strategy=====<br />
*[[How to play...]]<br />
*[[How to play Drakes]]<br />
*[[How to play Knalgans]]<br />
*[[How to play Loyalists]]<br />
*[[How to play Northerners]]<br />
*[[How to play Rebels]]<br />
*[[How to play Undead]]<br />
<br />
====Races====<br />
*'''[[Races]]'''<br />
*[[Drakes (race)]]<br />
*[[Dwarves]]<br />
*[[Elves]]<br />
*[[Humans]]<br />
*[[Orcs]]<br />
*[[Trolls]]<br />
*[[Undead (race)]]<br />
<br />
</div><div style="float: left; width: 50%"><br />
====Latin Translation====<br />
*'''[[Latin Translation]]'''<br />
*[[Vocabula Vesnotei]]<br />
*[[Versus Vesnotei]]<br />
<br />
====Other====<br />
*[[Aethaeryn's Maps]]<br />
*[[Future History]]<br />
*<b>[[Thunderstone]]</b><br />
*[[Thunderstone Territories]]<br />
<br />
====Templates====<br />
*[[:Template:Faction]]<br />
*[[:Template:Race]]<br />
*[[:Template:Era]]<br />
*[[:Template:Factionbox]]<br />
*[[:Template:Racebox]]<br />
<br />
<br />
<br />
http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/data/core/images/wesnoth-icon.png<br />
<br />
<br />
<br />
<br />
</div></div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=User:Aethaeryn&diff=56646User:Aethaeryn2015-08-05T01:32:50Z<p>Aethaeryn: /* Current Wesnoth Content */ new name for it</p>
<hr />
<div>My username is '''Aethaeryn''' and this is my wiki user page. I'm a wiki sysop (moderator), and I'm also a regular on [[Support#IRC|IRC]] and the forums. Most of the wiki articles I maintain and work on are listed on this page. My biggest Wesnoth talent is probably in mapmaking, but I can do some WML coding and some sprite art.<br />
<br />
I have three ongoing Wesnoth projects: [[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)], [[Thunderstone]], and the [[Latin Translation]] ([http://www.wesnoth.org/forum/viewtopic.php?f=7&t=16158 thread], [http://www.wesnoth.org/gettext/index.lang.php?lang=la&version=trunk stats]).<br />
<br />
If you need to contact me, I'm "Aethaeryn" on the forums as well as on IRC ([http://freenode.net/ freenode]). This user-page lists my Wesnoth projects as well as pages I maintain for the Wesnoth wiki.<br />
<br />
==Current Wesnoth Content==<br />
<b><font size="3" color="#FF8000">(48.9% Avg. Completion)</font></b><br><br />
<!-- Use these colors<br />
<font color="#FF0000"><b>0% to 32% Complete</b></font><br />
<font color="#FF8000"><b>33% to 66% Complete</b></font><br />
<font color="#FFBF00"><b>67% to 89% Complete</b></font><br />
<font color="#00BF00"><b>90% to 99% Complete</b></font><br />
<font color="#00BF00"><b><i>100% Complete</i></b></font><br />
--><br />
===Published Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00427_ink.png</td><br />
<td><b>[[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)] (0.5.2)<br><br />
<font size="2" color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
</table><br />
<br />
===Unpublished Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00394_frenzy.png</td><br />
<td><b>[[Thunderstone|Thunderstone Era]]<br><br />
<font size="2" color="#FF0000">(12.5% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00433_lightning.png</td><br />
<td><b>Thunderstone Trilogy<br><br />
<font size="2" color="#FF0000">(2% Complete) (Wesnoth 1.9)</font></b><br></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00362_hammer-dwarven-runic.png</td><br />
<td><b>Era of Tyrants<br><br />
<font color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00418_staff-plague.png</td><br />
<td><b>Aethaeryn's MoD<br><br />
<font color="#FFBF00">(80% Complete) (Wesnoth 1.12)</font></b></td></tr><br />
</table><br />
<br />
==Maintained/Watched Wiki Pages==<br />
As a wiki moderator, I patrol the whole wiki for things such as vandalism and spam. These are the pages I particularly focus on for content and/or design.<br />
<br />
<div style="float: left; width: 50%"><br />
====Factions and Eras====<br />
*'''[[Factions and Eras]]'''<br />
*'''[[Default Era]]<br />
*[[Drakes]]<br />
*[[Knalgan Alliance]]<br />
*[[Loyalists]]<br />
*[[Northerners]]<br />
*[[Rebels]]<br />
*[[Undead]]<br />
<br />
=====Faction Strategy=====<br />
*[[How to play...]]<br />
*[[How to play Drakes]]<br />
*[[How to play Knalgans]]<br />
*[[How to play Loyalists]]<br />
*[[How to play Northerners]]<br />
*[[How to play Rebels]]<br />
*[[How to play Undead]]<br />
<br />
====Races====<br />
*'''[[Races]]'''<br />
*[[Drakes (race)]]<br />
*[[Dwarves]]<br />
*[[Elves]]<br />
*[[Humans]]<br />
*[[Orcs]]<br />
*[[Trolls]]<br />
*[[Undead (race)]]<br />
<br />
</div><div style="float: left; width: 50%"><br />
====Latin Translation====<br />
*'''[[Latin Translation]]'''<br />
*[[Vocabula Vesnotei]]<br />
*[[Versus Vesnotei]]<br />
<br />
====Other====<br />
*[[Aethaeryn's Maps]]<br />
*[[Future History]]<br />
*<b>[[Thunderstone]]</b><br />
*[[Thunderstone Territories]]<br />
<br />
====Templates====<br />
*[[:Template:Faction]]<br />
*[[:Template:Race]]<br />
*[[:Template:Era]]<br />
*[[:Template:Factionbox]]<br />
*[[:Template:Racebox]]<br />
<br />
<br />
<br />
http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/data/core/images/wesnoth-icon.png<br />
<br />
<br />
<br />
<br />
</div></div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=User:Aethaeryn&diff=56645User:Aethaeryn2015-08-05T01:30:56Z<p>Aethaeryn: updating</p>
<hr />
<div>My username is '''Aethaeryn''' and this is my wiki user page. I'm a wiki sysop (moderator), and I'm also a regular on [[Support#IRC|IRC]] and the forums. Most of the wiki articles I maintain and work on are listed on this page. My biggest Wesnoth talent is probably in mapmaking, but I can do some WML coding and some sprite art.<br />
<br />
I have three ongoing Wesnoth projects: [[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)], [[Thunderstone]], and the [[Latin Translation]] ([http://www.wesnoth.org/forum/viewtopic.php?f=7&t=16158 thread], [http://www.wesnoth.org/gettext/index.lang.php?lang=la&version=trunk stats]).<br />
<br />
If you need to contact me, I'm "Aethaeryn" on the forums as well as on IRC ([http://freenode.net/ freenode]). This user-page lists my Wesnoth projects as well as pages I maintain for the Wesnoth wiki.<br />
<br />
==Current Wesnoth Content==<br />
<b><font size="3" color="#FF8000">(48.9% Avg. Completion)</font></b><br><br />
<!-- Use these colors<br />
<font color="#FF0000"><b>0% to 32% Complete</b></font><br />
<font color="#FF8000"><b>33% to 66% Complete</b></font><br />
<font color="#FFBF00"><b>67% to 89% Complete</b></font><br />
<font color="#00BF00"><b>90% to 99% Complete</b></font><br />
<font color="#00BF00"><b><i>100% Complete</i></b></font><br />
--><br />
===Published Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00427_ink.png</td><br />
<td><b>[[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)] (0.5.2)<br><br />
<font size="2" color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
</table><br />
<br />
===Unpublished Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00394_frenzy.png</td><br />
<td><b>[[Thunderstone|Thunderstone Era]]<br><br />
<font size="2" color="#FF0000">(12.5% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00433_lightning.png</td><br />
<td><b>Thunderstone Trilogy<br><br />
<font size="2" color="#FF0000">(2% Complete) (Wesnoth 1.9)</font></b><br></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00362_hammer-dwarven-runic.png</td><br />
<td><b>Era of Tyrants<br><br />
<font color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00418_staff-plague.png</td><br />
<td><b>Master of Dungeons<br><br />
<font color="#FFBF00">(80% Complete) (Wesnoth 1.12)</font></b></td></tr><br />
</table><br />
<br />
==Maintained/Watched Wiki Pages==<br />
As a wiki moderator, I patrol the whole wiki for things such as vandalism and spam. These are the pages I particularly focus on for content and/or design.<br />
<br />
<div style="float: left; width: 50%"><br />
====Factions and Eras====<br />
*'''[[Factions and Eras]]'''<br />
*'''[[Default Era]]<br />
*[[Drakes]]<br />
*[[Knalgan Alliance]]<br />
*[[Loyalists]]<br />
*[[Northerners]]<br />
*[[Rebels]]<br />
*[[Undead]]<br />
<br />
=====Faction Strategy=====<br />
*[[How to play...]]<br />
*[[How to play Drakes]]<br />
*[[How to play Knalgans]]<br />
*[[How to play Loyalists]]<br />
*[[How to play Northerners]]<br />
*[[How to play Rebels]]<br />
*[[How to play Undead]]<br />
<br />
====Races====<br />
*'''[[Races]]'''<br />
*[[Drakes (race)]]<br />
*[[Dwarves]]<br />
*[[Elves]]<br />
*[[Humans]]<br />
*[[Orcs]]<br />
*[[Trolls]]<br />
*[[Undead (race)]]<br />
<br />
</div><div style="float: left; width: 50%"><br />
====Latin Translation====<br />
*'''[[Latin Translation]]'''<br />
*[[Vocabula Vesnotei]]<br />
*[[Versus Vesnotei]]<br />
<br />
====Other====<br />
*[[Aethaeryn's Maps]]<br />
*[[Future History]]<br />
*<b>[[Thunderstone]]</b><br />
*[[Thunderstone Territories]]<br />
<br />
====Templates====<br />
*[[:Template:Faction]]<br />
*[[:Template:Race]]<br />
*[[:Template:Era]]<br />
*[[:Template:Factionbox]]<br />
*[[:Template:Racebox]]<br />
<br />
<br />
<br />
http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/data/core/images/wesnoth-icon.png<br />
<br />
<br />
<br />
<br />
</div></div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=Thunderstone&diff=44836Thunderstone2012-01-24T09:41:13Z<p>Aethaeryn: /* Major Release Roadmap: What is needed for...? */ The numbering system was overly complex.</p>
<hr />
<div>{{Era |<br />
era = Thunderstone |<br />
maintainer = Aethaeryn |<br />
factions = Human Troopers, Elvish Mystics, Dwarvish Guardians, Orcish Raiders, [[Shaxthals]] |<br />
version = ''[[#Subversion|SVN]] |<br />
w_version = 1.7.5 or [[SVN|SVN trunk]] |<br />
thread = N/A |<br />
trees = [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/unit_tree.txt?view=log SVN unit tree]<br />
}}<br />
<br />
A ''post''-post-apocalyptic world where fantasy and science fiction collide, [[Thunderstone]] is the far future of Wesnoth's world Irdya. The core of the Thunderstone add-on is an era, consisting of five all-new factions - Human Troopers, Elvish Mystics, Dwarvish Guardians, Orcish Raiders, and [[Shaxthals]]. The add-on also introduces new terrains, the electric damage type, new weaponry and a new attack range, vehicles, and special units. Altogether, Thunderstone hopes to be the core for scenarios and campaigns set in the far future of the world of Wesnoth.<br />
<br />
<noinclude><br />
==Story==<br />
Thunderstone is set in the future, long after the "apocalypse" wiped out much of the world. In the years following Under the Burning Suns and [http://www.wesnoth.org/forum/viewtopic.php?f=8&t=17827 Invasion from the Unknown], the remnants of civilization have come in contact with high technology. Combined with over a hundred years of stability, a new era of innovation has made this rebuilding world far more advanced than before. In this age of mixed magic and science, the first powerful spacecraft have been developed and the elves, dwarves, humans, and orcs of the world of Irdya have ended their isolation from the galaxy at large...<br />
<br />
==Era Features==<br />
===Terrains===<br />
Thunderstone introduces new sets of terrain on top of the traditional Wesnoth terrains. The two major terrain sets are '''Uninhabited''' and '''Space'''. Space is the void between the heavenly bodies. Only spacecraft, robotic or semi-robotic creatures that do not need to breathe oxygen, and creatures shielded and given oxygen with a specialized suit can travel through space. Uninhabited is a similar environment except on a planet or moon, one hostile to most living creatures. The major difference is that only fliers can travel in Space while any machine small enough to enter the atmosphere (all except the biggest spaceships) can travel on or directly above Uninhabited terrain. <br />
<br />
===Electric Damage Type===<br />
Thunderstone also introduces a new damage type called "Electric." Electric is similar to fire, but is usually produced from high-tech weapons. Electric's main specialty is that it does extra damage against high-tech machinery such as vehicles, thus making it an effective counter for otherwise powerful units.<br />
<br />
===Weaponry and Ranges===<br />
Thunderstone introduces many new weapons of a higher technology level than standard Wesnoth, including guns. It also introduces a new attack range, '''long ranged''', that is mostly used in spaceships and other weaponry capable of much higher range than bows or most guns, such as sniper rifles. Because of long ranged's rarity, it usually provides no retaliation to the attacker which is a key strategic advantage.<br />
<br />
'''Guns''' are portable machines that shoot projectiles at people and have replaced the bow as the ranged weapons of choice. Thunderstone is the dawn of the space-traveling age for the sentient races of Irdya, so guns vary from bullets to bursts of harmful electricity. Unlike bows, the rapid-fire capability of guns enables many guns span two ranges. For example, a shotgun is able to be used in both melee in ranged. Other guns can be used as blunt objects close up to still do melee damage. All standard guns that can be shot in melee have the first strike ability there, while those that are not shot do not have first strike.<br />
<br />
Despite the abandonment of the bow for the gun, some close-ranged weapons are still used. These varied objects are not necessarily disadvantaged because they are usually unanticipated.<br />
<br />
===Vehicles===<br />
Most factions in Thunderstone will have several vehicles. Vehicles typically are so powerful and expensive that they are usually recruited at level 2 or higher. Vehicles are not living and thus have the mechanical trait (unpoisonable, undrainable, and unplaugeable). Vehicles can be flying or ground-based, and tend to be stronger than infantry. Their superiority comes with major weaknesses: electric-based attacks, and high prices and upkeep. In addition to the recruitable flying vehicles, there are also unrecruitable spaceships that are much stronger, but can only travel in space terrain. These units are non-standard and much rarer than the normal vehicles.<br />
<br />
===Five All-New Factions===<br />
====Human Troopers====<br />
<div class="thumb tright"><div><br />
[http://www.wesnoth.org/forum/download/file.php?id=34916.png http://www.wesnoth.org/forum/download/file.php?id=34916.png]<br />
<div class="thumbcaption">Draft sprites of some Human Troopers.<br />
</div></div><br />
</div><br />
<br />
Humans are still the jack-of-all-trades race. Balancing magic and science, humans are generalists who adapt to novelty more effectively than the other races of Irdya. Their technical strength area is computers and miniaturization. They, more than the other speaking peoples, tend to win by luring opponents into fatal mistakes.<br />
<br />
====Elvish Mystics====<br />
Elves are still in touch with nature and in the years of peace they have greatly enhanced their magical skills. Elves focus heavily on this magic, rejecting technologies which they find disharmonious, and excel at biology and medicine. Much of their technology is magically-enhanced. Tactically, elves focus on mobility and precision fire.<br />
<br />
====Dwarvish Guardians====<br />
The dwarves are the master technologists and builders of Irdya, especially in the areas of power, weapons, propulsion, and large-scale engineering. They remain intensely conservative, and their technology is ultra-reliable even if it lacks the finesse and efficiency of human or elven work.<br />
<br />
====Orcish Raiders====<br />
Orcs have stolen most of what they have from the more civilized species, but focus mostly on war. Their technology tends towards the crude, overpowered hack, and is notoriously (and sometimes comically) unreliable. The flip side of this is that in any environment that doesn't outright kill them, orcs are less helpless without their tech than the other speaking peoples.<br />
<br />
====Shaxthals (Biomechs)====<br />
''Main article: [[Shaxthals]]<br />
<br />
The Shaxthals are an ancient race created by the original inhabitants of Irdya. These combinations of bioengineering and magic were made to aid in a war, but they soon became out-of-control. They were defeated, however, and only revived recently under the Chaos Empire. When the Chaos Empire was destroyed, the Shaxthals became free to do what they do best - kill.<br />
<br />
==Add-ons==<br />
Thunderstone will eventually publish the following add-ons:<br />
<br />
'''Thunderstone Era''' will be the core add-on for the Thunderstone project and will provide the units, terrain, and other files necessary for every other Thunderstone-based add-on. This will be the only add-on necessary to play normal multiplayer.<br />
<br />
'''Thunderstone Trilogy''' will focus on the main Thunderstone plot arc, and is designed to be the main set of campaigns for the Thunderstone Era. The trilogy will provide the most epic saga in the Thunderstone timeline, and attempt to showcase many key plot elements and factions.<br />
<br />
==Versions==<br />
Thunderstone will use a versioning system that is designed to help users of the era. The version will be contain three numbers (e.g. 0.1.1). The first number is the major milestone (see roadmap below). The second number indicates incompatible releases, and users cannot play multiplayer between these versions. Content designed to use Thunderstone might also use features not found in previous versions and thus it is recommended to update when a new incompatible release is released. The third number indicates compatible releases. This means that content for Thunderstone and MP games using Thunderstone will still work with each other. Someone with 0.1.1 could play with someone else who used 0.1.0.<br />
<br />
===Major Release Roadmap: What is needed for...?===<br />
====0.1.x (Demo)====<br />
*Playable. <br />
<br />
====0.2.x (Alpha)====<br />
*Unit art: can be placeholder/draft; higher levels can share art with lower levels;<br />
*Unit WML: every faction's units; non-buggy playing; balance not guaranteed.<br />
<br />
====0.3.x (Beta) ====<br />
*Unit art: can be placeholder/draft; none shared<br />
*Unit WML: balancing begins;<br />
*Extra features (terrain, items, other units, etc.) for everything planned are all included.<br />
<br />
====Release 0.4.x====<br />
*Unit art: all base frames included;<br />
*Unit WML: balanced to the point of somewhat fair multiplayer;<br />
*Extra features (terrain, items, other units, etc.) are mostly polished.<br />
*The two additional add-ons are released.<br />
<br />
====Release 1.0====<br />
*Unit art: complete base frames, most basic animations;<br />
*Unit WML: balanced as best as possible;<br />
*Extra features (terrains, items, other units, etc.) completed;<br />
*Other official add-ons also completed and also at 1.0. <br />
<br />
====Release 2.0====<br />
*On par with, or close to, Default Era and mainline.<br />
<br />
===Subversion===<br />
Thunderstone also uses [[SVN|Subversion]] (SVN) to coordinate work between the released versions. You can browse the Thunderstone SVN repository to see the latest draft of Thunderstone Era [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ here] and Thunderstone Trilogy [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ here]. Thunderstone is part of [[Wesnoth UMC Dev]], which hosts the project's SVN. You can download Thunderstone with the commands:<br />
<br />
svn co https://wesnoth-umc-dev.svn.sourceforge.net/svnroot/wesnoth-umc-dev/trunk/Thunderstone_Era Thunderstone_Era<br />
(For the Thunderstone Era)<br />
<br />
svn co https://wesnoth-umc-dev.svn.sourceforge.net/svnroot/wesnoth-umc-dev/trunk/Thunderstone_Trilogy Thunderstone_Trilogy<br />
(For the Thunderstone Trilogy of campaigns)<br />
<br />
Please note that Thunderstone, like all add-ons, goes in data/add-ons/ in the Wesnoth userdata directory. SVN tends to be unstable and is generally not compatible with a release of Thunderstone on the add-ons server, so use it with caution and do not expect to be able to use it for multiplayer.<br />
<br />
==Coordination==<br />
If you would like to help with Thunderstone, you can coordinate on the #wesnoth-thunderstone IRC channel (for real-time chat and to keep updated on the SVN revisions) and in our forum threads for general discussion and art.<br />
<br />
====IRC Channel====<br />
[irc://irc.freenode.net/wesnoth-thunderstone #wesnoth-thunderstone] (irc.freenode.net)<br />
<br />
====Forum Threads====<br />
''A forum thread for general discussion will be released as soon as Thunderstone is officially published on the add-ons server. Until then, IRC is a suitable place for communication.<br />
*[http://www.wesnoth.org/forum/viewtopic.php?f=23&t=26018 Thunderstone Art Thread]<br />
<br />
====Wiki Pages====<br />
'''[[Thunderstone art]]''' is used to keep track of what art is needed and what art is done.<br />
<br />
[[Category:Eras]]<br />
[[Category:Thunderstone|*]]<br />
</noinclude></div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=User:Aethaeryn&diff=44835User:Aethaeryn2012-01-24T07:56:25Z<p>Aethaeryn: /* Current Wesnoth Content */ Only showing the add-ons that I am focusing on currently.</p>
<hr />
<div>''For my GSOC page, please see [[SoC2011 Student Page Aethaeryn]].<br />
<br />
My username is '''Aethaeryn''' and this is my wiki user page. I'm a wiki sysop (moderator), and I'm also a regular on [[Support#IRC|IRC]] and the forums. Most of the wiki articles I maintain and work on are listed on this page. My biggest Wesnoth talent is probably in mapmaking, but I can do some WML coding and some sprite art.<br />
<br />
I have three ongoing Wesnoth projects: [[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)], [[Thunderstone]], and the [[Latin Translation]] ([http://www.wesnoth.org/forum/viewtopic.php?f=7&t=16158 thread], [http://www.wesnoth.org/gettext/index.lang.php?lang=la&version=trunk stats]).<br />
<br />
If you need to contact me, I'm "Aethaeryn" on the forums as well as on IRC ([http://freenode.net/ freenode]). This user-page lists my Wesnoth projects as well as pages I maintain for the Wesnoth wiki.<br />
<br />
==Current Wesnoth Content==<br />
<b><font size="3" color="#FF8000">(48.9% Avg. Completion)</font></b><br><br />
<!-- Use these colors<br />
<font color="#FF0000"><b>0% to 32% Complete</b></font><br />
<font color="#FF8000"><b>33% to 66% Complete</b></font><br />
<font color="#FFBF00"><b>67% to 89% Complete</b></font><br />
<font color="#00BF00"><b>90% to 99% Complete</b></font><br />
<font color="#00BF00"><b><i>100% Complete</i></b></font><br />
--><br />
===Published Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00427_ink.png</td><br />
<td><b>[[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)] (0.5.2)<br><br />
<font size="2" color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
</table><br />
<br />
===Unpublished Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00394_frenzy.png</td><br />
<td><b>[[Thunderstone|Thunderstone Era]]<br><br />
<font size="2" color="#FF0000">(12.5% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00433_lightning.png</td><br />
<td><b>Thunderstone Trilogy<br><br />
<font size="2" color="#FF0000">(2% Complete) (Wesnoth 1.9)</font></b><br></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00362_hammer-dwarven-runic.png</td><br />
<td><b>Era of Tyrants<br><br />
<font color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00418_staff-plague.png</td><br />
<td><b>Master of Dungeons<br><br />
<font color="#FFBF00">(80% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
</table><br />
<br />
==Maintained/Watched Wiki Pages==<br />
As a wiki moderator, I patrol the whole wiki for things such as vandalism and spam. These are the pages I particularly focus on for content and/or design.<br />
<br />
<div style="float: left; width: 50%"><br />
====Factions and Eras====<br />
*'''[[Factions and Eras]]'''<br />
*'''[[Default Era]]<br />
*[[Drakes]]<br />
*[[Knalgan Alliance]]<br />
*[[Loyalists]]<br />
*[[Northerners]]<br />
*[[Rebels]]<br />
*[[Undead]]<br />
<br />
=====Faction Strategy=====<br />
*[[How to play...]]<br />
*[[How to play Drakes]]<br />
*[[How to play Knalgans]]<br />
*[[How to play Loyalists]]<br />
*[[How to play Northerners]]<br />
*[[How to play Rebels]]<br />
*[[How to play Undead]]<br />
<br />
====Races====<br />
*'''[[Races]]'''<br />
*[[Drakes (race)]]<br />
*[[Dwarves]]<br />
*[[Elves]]<br />
*[[Humans]]<br />
*[[Orcs]]<br />
*[[Trolls]]<br />
*[[Undead (race)]]<br />
<br />
</div><div style="float: left; width: 50%"><br />
====Latin Translation====<br />
*'''[[Latin Translation]]'''<br />
*[[Vocabula Vesnotei]]<br />
*[[Versus Vesnotei]]<br />
<br />
====Other====<br />
*[[Aethaeryn's Maps]]<br />
*[[Future History]]<br />
*<b>[[Thunderstone]]</b><br />
*[[Thunderstone Territories]]<br />
<br />
====Templates====<br />
*[[:Template:Faction]]<br />
*[[:Template:Race]]<br />
*[[:Template:Era]]<br />
*[[:Template:Factionbox]]<br />
*[[:Template:Racebox]]<br />
<br />
<br />
<br />
http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/data/core/images/wesnoth-icon.png<br />
<br />
<br />
<br />
<br />
</div></div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=User:Aethaeryn&diff=44834User:Aethaeryn2012-01-24T07:55:30Z<p>Aethaeryn: /* Current Wesnoth Content */ my add-ons are not dead, updating progress</p>
<hr />
<div>''For my GSOC page, please see [[SoC2011 Student Page Aethaeryn]].<br />
<br />
My username is '''Aethaeryn''' and this is my wiki user page. I'm a wiki sysop (moderator), and I'm also a regular on [[Support#IRC|IRC]] and the forums. Most of the wiki articles I maintain and work on are listed on this page. My biggest Wesnoth talent is probably in mapmaking, but I can do some WML coding and some sprite art.<br />
<br />
I have three ongoing Wesnoth projects: [[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)], [[Thunderstone]], and the [[Latin Translation]] ([http://www.wesnoth.org/forum/viewtopic.php?f=7&t=16158 thread], [http://www.wesnoth.org/gettext/index.lang.php?lang=la&version=trunk stats]).<br />
<br />
If you need to contact me, I'm "Aethaeryn" on the forums as well as on IRC ([http://freenode.net/ freenode]). This user-page lists my Wesnoth projects as well as pages I maintain for the Wesnoth wiki.<br />
<br />
==Current Wesnoth Content==<br />
<b><font size="3" color="#FF8000">(45.75% Avg. Completion)</font></b><br><br />
<!-- Use these colors<br />
<font color="#FF0000"><b>0% to 32% Complete</b></font><br />
<font color="#FF8000"><b>33% to 66% Complete</b></font><br />
<font color="#FFBF00"><b>67% to 89% Complete</b></font><br />
<font color="#00BF00"><b>90% to 99% Complete</b></font><br />
<font color="#00BF00"><b><i>100% Complete</i></b></font><br />
--><br />
===Published Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00427_ink.png</td><br />
<td><b>[[Aethaeryn's Maps]] [http://www.wesnoth.org/forum/viewtopic.php?f=15&t=27742 (thread)] (0.5.2)<br><br />
<font size="2" color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
</table><br />
<br />
===Unpublished Add-ons===<br />
<table><br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00394_frenzy.png</td><br />
<td><b>[[Thunderstone|Thunderstone Era]]<br><br />
<font size="2" color="#FF0000">(12.5% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00433_lightning.png</td><br />
<td><b>Thunderstone Trilogy<br><br />
<font size="2" color="#FF0000">(2% Complete) (Wesnoth 1.9)</font></b><br></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00362_hammer-dwarven-runic.png</td><br />
<td><b>Era of Tyrants<br><br />
<font color="#FFBF00">(75% Complete) (Wesnoth 1.8)</font></b></td></tr><br />
<br />
<tr><td>http://www.wesnoth.org/units/1.8/pics/00418_staff-plague.png</td><br />
<td><b>Master of Dungeons<br><br />
<font color="#FFBF00">(80% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
<br />
<tr><td>http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/data/core/images/icons/letter_and_ale.png</td><br />
<td><b>Underlands RPG<br><br />
<font size="2" color="#FF0000">(30% Complete) (Wesnoth 1.9)</font></b></td></tr><br />
</table><br />
<br />
==Maintained/Watched Wiki Pages==<br />
As a wiki moderator, I patrol the whole wiki for things such as vandalism and spam. These are the pages I particularly focus on for content and/or design.<br />
<br />
<div style="float: left; width: 50%"><br />
====Factions and Eras====<br />
*'''[[Factions and Eras]]'''<br />
*'''[[Default Era]]<br />
*[[Drakes]]<br />
*[[Knalgan Alliance]]<br />
*[[Loyalists]]<br />
*[[Northerners]]<br />
*[[Rebels]]<br />
*[[Undead]]<br />
<br />
=====Faction Strategy=====<br />
*[[How to play...]]<br />
*[[How to play Drakes]]<br />
*[[How to play Knalgans]]<br />
*[[How to play Loyalists]]<br />
*[[How to play Northerners]]<br />
*[[How to play Rebels]]<br />
*[[How to play Undead]]<br />
<br />
====Races====<br />
*'''[[Races]]'''<br />
*[[Drakes (race)]]<br />
*[[Dwarves]]<br />
*[[Elves]]<br />
*[[Humans]]<br />
*[[Orcs]]<br />
*[[Trolls]]<br />
*[[Undead (race)]]<br />
<br />
</div><div style="float: left; width: 50%"><br />
====Latin Translation====<br />
*'''[[Latin Translation]]'''<br />
*[[Vocabula Vesnotei]]<br />
*[[Versus Vesnotei]]<br />
<br />
====Other====<br />
*[[Aethaeryn's Maps]]<br />
*[[Future History]]<br />
*<b>[[Thunderstone]]</b><br />
*[[Thunderstone Territories]]<br />
<br />
====Templates====<br />
*[[:Template:Faction]]<br />
*[[:Template:Race]]<br />
*[[:Template:Era]]<br />
*[[:Template:Factionbox]]<br />
*[[:Template:Racebox]]<br />
<br />
<br />
<br />
http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/data/core/images/wesnoth-icon.png<br />
<br />
<br />
<br />
<br />
</div></div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42257SoC2011 Student Page Aethaeryn2011-04-17T16:40:16Z<p>Aethaeryn: /* The Implementation: Timeline */ slight revision, more to come</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn, Aeth<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
''Note: This section is outdated, I know, but I have to get to it after I actually write the wesnoth.gui_message{} function so I get a feel for the C API and how much time is necessary to do these tasks. I'm probably going to have to add at least two more weeks worth of work on top of what I originally intended.<br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
-- The function can be triggered directly by defining the table in the function call to gui_message{}.<br />
gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
-- The function can be used indirectly by setting it to a table first, and then using the table's<br />
-- reference variable as an argument for gui_message().<br />
msg = {<br />
message = "What's your name?",<br />
-- if the tag is not there, reasonable defaults are set<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
<br />
function foobar()<br />
gui_message(msg)<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string,<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
''Note: This timeline will be rewritten because I have to get Phase 0 in sooner than I anticipated, thus requiring me to shift up and expand Phase 1, as well as elaborate it in subtasks on the timeline.<br />
<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Finalize design.<br />
<br />
Get most of Phase 0 working.<br />
|-<br />
| || April 23 - May 08 ||<br />
Finish Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 1 beings.''' (My schedule is be ''entirely'' free in this time span.)<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
My summer semester starts. I should still have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42236SoC2011 Student Page Aethaeryn2011-04-17T05:32:48Z<p>Aethaeryn: /* IRC */ adding one of my alternate nicks now that it's running on a remote server irssi</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn, Aeth<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
''Note: This section is outdated, I know, but I have to get to it after I actually write the wesnoth.gui_message{} function so I get a feel for the C API and how much time is necessary to do these tasks. I'm probably going to have to add at least two more weeks worth of work on top of what I originally intended.<br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
-- The function can be triggered directly by defining the table in the function call to gui_message{}.<br />
gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
-- The function can be used indirectly by setting it to a table first, and then using the table's<br />
-- reference variable as an argument for gui_message().<br />
msg = {<br />
message = "What's your name?",<br />
-- if the tag is not there, reasonable defaults are set<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
<br />
function foobar()<br />
gui_message(msg)<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string,<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
''Note: This timeline will be rewritten because I have to get Phase 0 in sooner than I anticipated, thus requiring me to shift up and expand Phase 1, as well as elaborate it in subtasks on the timeline.<br />
<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42233SoC2011 Student Page Aethaeryn2011-04-16T23:25:57Z<p>Aethaeryn: /* gui_message{} */ removing comment on a Lua code line</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
''Note: This section is outdated, I know, but I have to get to it after I actually write the wesnoth.gui_message{} function so I get a feel for the C API and how much time is necessary to do these tasks. I'm probably going to have to add at least two more weeks worth of work on top of what I originally intended.<br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
-- The function can be triggered directly by defining the table in the function call to gui_message{}.<br />
gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
-- The function can be used indirectly by setting it to a table first, and then using the table's<br />
-- reference variable as an argument for gui_message().<br />
msg = {<br />
message = "What's your name?",<br />
-- if the tag is not there, reasonable defaults are set<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
<br />
function foobar()<br />
gui_message(msg)<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string,<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
''Note: This timeline will be rewritten because I have to get Phase 0 in sooner than I anticipated, thus requiring me to shift up and expand Phase 1, as well as elaborate it in subtasks on the timeline.<br />
<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42220SoC2011 Student Page Aethaeryn2011-04-16T21:04:44Z<p>Aethaeryn: /* gui_message{} */ the function will now directly show since it takes a table as its sole input</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
''Note: This section is outdated, I know, but I have to get to it after I actually write the wesnoth.gui_message{} function so I get a feel for the C API and how much time is necessary to do these tasks. I'm probably going to have to add at least two more weeks worth of work on top of what I originally intended.<br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
-- The function can be triggered directly by defining the table in the function call to gui_message{}.<br />
gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
-- The function can be used indirectly by setting it to a table first, and then using the table's<br />
-- reference variable as an argument for gui_message().<br />
msg = {<br />
message = "What's your name?",<br />
-- if the tag is not there, reasonable defaults are set<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
<br />
function foobar()<br />
gui_message(msg)<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string, -- "narrator", "unit" or "second_unit"<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
''Note: This timeline will be rewritten because I have to get Phase 0 in sooner than I anticipated, thus requiring me to shift up and expand Phase 1, as well as elaborate it in subtasks on the timeline.<br />
<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42219SoC2011 Student Page Aethaeryn2011-04-16T21:04:08Z<p>Aethaeryn: /* Sample Syntax */ slight change in syntax</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
''Note: This section is outdated, I know, but I have to get to it after I actually write the wesnoth.gui_message{} function so I get a feel for the C API and how much time is necessary to do these tasks. I'm probably going to have to add at least two more weeks worth of work on top of what I originally intended.<br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
-- The function can be triggered directly by defining the table in the function call to gui_message{}.<br />
gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
-- The function can be used indirectly by setting it to a table first, and then using the table's<br />
-- reference variable as an argument for gui_message().<br />
msg = {<br />
message = "What's your name?",<br />
-- if the tag is not there, reasonable defaults are set<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
<br />
function foobar()<br />
gui_message(msg)<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string, -- "narrator", "unit" or "second_unit"<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
''Note: This timeline will be rewritten because I have to get Phase 0 in sooner than I anticipated, thus requiring me to shift up and expand Phase 1, as well as elaborate it in subtasks on the timeline.<br />
<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42195SoC2011 Student Page Aethaeryn2011-04-16T18:31:22Z<p>Aethaeryn: /* The Implementation: Timeline */ note</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
''Note: This section is outdated, I know, but I have to get to it after I actually write the wesnoth.gui_message{} function so I get a feel for the C API and how much time is necessary to do these tasks. I'm probably going to have to add at least two more weeks worth of work on top of what I originally intended.<br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string, -- "narrator", "unit" or "second_unit"<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
''Note: This timeline will be rewritten because I have to get Phase 0 in sooner than I anticipated, thus requiring me to shift up and expand Phase 1, as well as elaborate it in subtasks on the timeline.<br />
<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42194SoC2011 Student Page Aethaeryn2011-04-16T18:30:28Z<p>Aethaeryn: /* Phase 1: Complex Interface Changes */ note</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
''Note: This section is outdated, I know, but I have to get to it after I actually write the wesnoth.gui_message{} function so I get a feel for the C API and how much time is necessary to do these tasks. I'm probably going to have to add at least two more weeks worth of work on top of what I originally intended.<br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string, -- "narrator", "unit" or "second_unit"<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=MP_CodeOfConduct/de&diff=42162MP CodeOfConduct/de2011-04-15T16:35:50Z<p>Aethaeryn: moved MP CodeOfConduct/ge to MP CodeOfConduct/de:&#32;Move requested by mystic_x</p>
<hr />
<div>==Sprache==<br />
{{CodeOfConduct_Languages}}<br />
<br />
==Einführung==<br />
<br />
<div class="thumb tright"><div><br />
[http://hdvirtual.freewebhostx.com/files/battleforwesnothmultijogador004.png http://hdvirtual.freewebhostx.com/files/180px-Battleforwesnothmultijogador011.png]<br />
<div class="thumbcaption">Die Mehrspielerlobby</div></div><br />
</div><br />
<br />
Am Anfang gab es nichts außer [[HeirToTheThrone|einer Einzelspieler-Kampagne]]. Jetzt haben wir einen Mehrspieler-Server, der bis zu 1000 Spieler auf einmal hosten kann.<br />
<br />
Obwohl Wesnoth ein Open-Source-Spiel ist und der Mehrspieler-Server von jedem genutzt werden kann, bedeutet das noch lange nicht, dass wir keine Regeln brauchen. Die folgenden Regeln sind dazu gedacht, den Aufenthalt im Mehrspieler-Server so angenehm wie möglich zu machen.<br><br />
'''''Anmerkung:''' Dies ist eine Übersetzung aus dem Englischen. Wenn du dir unsicher über etwas bist, ziehe das [[MP_CodeOfConduct|englische Original]] zu Rate oder sende über das Forum eine Nachricht an den [http://forums.wesnoth.org/ucp.php?i=pm&mode=compose&u=123590| momentanen Betreuer] dieser Seite ('''Ceres''').''<br />
<br />
==Allgemein==<br />
<br />
* Sei höflich, insbesondere zu Leuten, die du nicht kennst.<br />
* Halte dich an die allgemeinen Chatregeln: Nicht spammen oder <span style="font-size:108%">IN GROßBUCHSTABEN</span> schreiben.<br />
* Benutze keine potentiell beleidigenden Namen, Kartentitel, Beschriftungen, oder Nachrichten. Das beinhaltet auch Flüche/Verwünschungen, beleidigende religiöse Kommentare, Rassismus, oder Sexismus.<br />
* Missbrauche den Server nicht, um (nicht-)kommerzielle Unternehmungen zu vermarkten. Er ist nicht für Werbung gedacht.<br />
:: ''Es sind häufig Kinder auf dem Server, was die oben genannten Regeln noch wichtiger macht.''<br />
=== &nbsp;In der Lobby===<br />
* Der [[MP_Tutorial#The_lobby|Chat in der Lobby]] wird zum Arrangieren von Spielen verwendet, also versuche, ihn nicht für allgemeines/persönliches Chatten zu verwenden. Dafür solltest du den Chat während eines Spiels oder [[#command_head|persönliche Nachrichten]] benutzen.&nbsp;<br />
* Lies die Titel von Spielen. Sie enthalten manchmal wichtige Informationen (z.B. "reserviert", "wird sehr lange dauern", ...) und könnten deine Entscheidung, ob du einem Spiel beitrittst oder nicht, beeinflussen.<br />
* Trete nur Spielen bei, die du auch beenden willst.<br />
=== &nbsp;Als Mitspieler===<br />
* Verlasse Spiele nicht ohne Vorwarnung/Begründung (es kann passieren, dass man während eines Spiels manchmal aufhören will/muss, aber bitte lass das die anderen Spieler vorher wissen).<br />
* [[Competitive_Gaming#Cheating|Cheate]] nicht.<br />
=== &nbsp;Als Beobachter===<br />
* Respektiere die Spieler. Wenn du über die Partie reden möchtest, benutze den Chat für Beobachter. <br />
* Gib keine Informationen an die anderen Spieler weiter.<br />
<br />
==Ausnahme==<br />
<br />
Eins ist vom oben Genannten ausgenommen: &nbsp;''wenn du hundertprozentig sicher bist, dass du dieses Verhalten nur bei Leuten an den Tag legst, die du kennst'' '''''und''''' ''du weißt, dass es sie nicht stören wird, lass dich nicht aufhalten...''<br />
==Sanktionen==<br />
<br />
* Alle Spieler dürfen andere Spieler auf ihre Liste der Leute setzen, die sie ignorieren.<br />
* Alle [[#Liste der Server-Moderatoren|Server-Moderatoren]] können dich vom Server verbannen, bis du bewiesen hast, dass du dein beleidigendes Verhalten nicht wiederholen wirst.<br />
===<span style="font-size:95%">&nbsp;In Spielen</span>===<br />
* Der [[MP_Tutorial#Hosts|Host]] hat die Verantwortung über sein Spiel und kann jeden daraus hinauswerfen/verbannen. Das bedeutet aber nicht, dass er Spieler hinauswerfen darf, bloß weil er verloren hat oder ähnliches.<br />
* Die Server-Moderatoren sind die Polizei der Lobby, aber sie moderieren normalerweise nicht in einzelnen Partien, solange sie nicht überzeugt sind, dass der Verstoß über ein einzelnes Spiel hinausgeht.<br />
''Um entbannt zu werden, musst du [[#Liste der Server-Moderatoren|den Moderator]], der dich verbannt hat, als erstes benachrichtigen und erklären, warum er/sie dich entbannen sollte. Aber bitte versichere, dass er/sie einen Grund dazu hat: Entweder, indem du dich entschuldigst, oder, indem du zeigst, dass du es nicht wieder tun wirst.''<br />
<br />
==Hilfe==<br />
<br />
* Wenn du bei der Benutzung des Mehrspieler-Servers Beratung benötigst, wirf mal ein Auge auf unsere [[MP_Tutorial|Mehrspieler-Einführung]].<br />
* Um in der Lobby/im Spiel um den Beistand eines Moderators zu bitten (oder jemanden zu melden, der ausfallend/beleidigend wird), benutze das [[#command_head|/query adminmsg]]-Kommando.<br />
===<span style="font-size:96%">&nbsp;Hilfe auf IRC</span>===<br />
Der #wesnoth-mp-Kanal auf irc.freenode.net ist ein guter Platz, um Fragen rund um den Multiplayer-Server zu stellen.<br />
<br>Für Hilfe bei anderen Themen frage nach im #wesnoth-Kanal.<br><br />
''&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Als Einführung in IRC empfehlen wir [http://www.irchelp.org/irchelp/irctutorial.html diese Anleitung]. Merk dir einfach, dass das Server-Netzwerk, mit dem du dich verbinden musst, freenode ist, und, dass die wichtigen Kanäle #wesnoth-mp und #wesnoth sind.''<br />
==Weiterführend==<br />
Dieser Abschnitt enthält einige Mehrspieler-verwandte Themen, die dich interessieren könnten.<br />
<br />
===Nützliche Kommandos===<br />
<br />
Der Mehrspieler-Server von Wesnoth unterstützt einige nützliche Befehle, die bei Spielen oder Personen hilfreich sein können. Die nützlichsten sind:<br />
<br />
{| align="center" {{Prettytable}}<br />
|-<br />
|style="background-color:#ffaf00;"|<div id="command_head">'''Befehl'''</div><br />
||'''Beschreibung''' <br />
|-<br />
| colspan="2" style="background-color:#ffeda9;"| '''&emsp;&emsp;&emsp;in ein Nachrichtenfeld, entweder direkt in der Lobby oder durch drücken von 'm' in einer Partie, geschrieben'''<br />
|-<br />
|style="background-color:#ceecff;" |'''/query&nbsp;adminmsg&nbsp;'''Text<br />
|Sendet die Nachricht 'Text' an alle verfügbaren Server-Moderatoren.&nbsp;&nbsp; <span style="font-size:80%">(Siehe [[ServerAdministration|hier]] für mehr /query-Kommandos.)</span><br />
|-<br />
|style="background-color:#ceecff;" |'''/m&nbsp;'''Name&nbsp;Text<br />
|Schreibt die persönliche Nachricht 'Text' an 'Name'&nbsp;&nbsp; <span style="font-size:80%">(identisch mit /msg oder /whisper bzw. Doppelklick auf einen Namen)</span><br />
|-<br />
|style="background-color:#ceecff;" |'''/friend&nbsp;'''Name<br />
|Fügt 'Name' deiner Freundesliste hinzu &nbsp;<span style="font-size:90%">(so wird 'Name' oben in der Namensliste angezeigt)</span><br />
|-<br />
|style="background-color:#ceecff;" |'''/ignore&nbsp;'''Name<br />
|Fügt 'Name' zur Liste derer hinzu, die du ignorierst &nbsp;<span style="font-size:90%">(so wird 'Name' ganz unten in der Namensliste angegeben, und du kannst Nachrichten, die von 'Name' geschrieben wurden, nicht sehen)</span><br />
|-<br />
| colspan="2" style="background-color:#ffeda9;"| <div id="command_type_2>'''&emsp;&emsp;&emsp;in einer Kommandozeile, erreichbar durch drücken von ':' in einer Partie</div>'''<br />
|-<br />
|style="background-color:#ceecff;" |'''control&nbsp;'''Seite&nbsp;Name<br />
|Gibt 'Name' die Kontrolle über Seite 'Seite'.<br />
|-<br />
|style="background-color:#ceecff;" |'''droid&nbsp;'''Seite on<br />
|Gibt die Kontrolle über Seite 'Seite' an einen KI-Spieler.<span style="font-size:83%">&nbsp;&nbsp;'''''droid''''' ''Seite''&nbsp;&nbsp;wechselt zwischen KI-Kontrolle und Kontrolle durch einen menschlichen Spieler hin und her.</span><br />
|-<br />
|style="background-color:#ceecff;" |'''kick&nbsp;'''Name<br />
|Entfernt 'Name' aus der momentanen Partie.<br />
|-<br />
|style="background-color:#ceecff;" |'''ban&nbsp;'''Name<br />
|Verbannt 'Name' aus dem Spiel, so dass 'Name' dieses Spiel solange die Verbannung dauert, nicht mehr betreten kann.&nbsp;<span style="font-size:90%">(der betreffende Spieler muss nicht im Spiel, aber auf dem Server sein)</span><br />
|-<br />
|style="background-color:#ceecff;" |'''nosaves'''<br />
|Schaltet das automatische Speichern aus. Kann bei großen Szenarien die Programmgeschwindigkeit verbessern.<br />
|}<br />
<br />
<span style="font-size:95%"><br />
&emsp;Für eine Liste von allgemeinen Mehrspieler-Kommandos siehe [[ChatCommands]] oder benutze den /help-Befehl in einer Partie oder der Lobby.<br><br />
&emsp;Für eine Liste von Spielkommandos siehe [[CommandMode]] oder benutze den :help-Befehl in einer Partie.<br><br />
<br />
</span><br />
<br />
<br />
----<br />
<br />
===Liste der Server-Moderatoren===<br />
<br />
Du kannst einzelne Moderatoren (oder alle zusammen) [http://forums.wesnoth.org/memberlist.php?mode=group&g=6651 über diese Forenseite] kontaktieren.<br />
<br />
* anakayub<br />
* Baufo<br />
* Blueblaze<br />
* Dragonking / deekay<br />
* grrr<br />
* jb<br />
* mysticX_th_unknown / mystic_x<br />
* Natasiel<br />
* Noy<br />
* Pikel<br />
* ping<br />
* Soliton<br />
* Thrawn<br />
* Truper<br />
* Turuk<br />
* Weeksy<br />
* Wintermute (happygrue auf IRC)<br />
* Yogibear<br />
<br />
===Verwandte Seiten===<br />
<br />
* [[MP_Tutorial|Mehrspieler-Einführung]] (englisch)<br />
* [[Support|Betreuung]] (englisch)<br />
* [http://forum.wesnoth.org/ucp.php?mode=register Registrierung im Wesnoth-Forum] (englisch)<br />
* [[Competitive_Gaming|konkurrenzbasiertes Spielen]] (englisch)<br />
<br />
<br />
<br />
<br />
[[Category:Playing Wesnoth]]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=MP_CodeOfConduct/ge&diff=42163MP CodeOfConduct/ge2011-04-15T16:35:50Z<p>Aethaeryn: moved MP CodeOfConduct/ge to MP CodeOfConduct/de:&#32;Move requested by mystic_x</p>
<hr />
<div>#REDIRECT [[MP CodeOfConduct/de]]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42093SoC2011 Student Page Aethaeryn2011-04-14T19:46:30Z<p>Aethaeryn: /* gui_message{} */ whoops, misread the [message] specifications a bit</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string, -- "narrator", "unit" or "second_unit"<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=42053SoC2011 Student Page Aethaeryn2011-04-13T17:05:12Z<p>Aethaeryn: /* Patches */ updating message</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string,<br />
narrator = string,<br />
unit = string, <br />
second_unit = string,<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
''Currently, the Phase 0 patches are in progress.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41919SoC2011 Student Page Aethaeryn2011-04-09T19:41:08Z<p>Aethaeryn: elaborating a bit on commands</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string,<br />
narrator = string,<br />
unit = string, <br />
second_unit = string,<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Optional: Commands====<br />
Graphical User Interfaces are great for most tasks, but there are situations where text-based input is a better way for commands to be run. If possible, it would greatly improve the capabilities of Lua if it were able to interpret chat messages. Lua already has the capability to output to chat, but input from chat would allow for Lua to become even more powerful in this area. Commands could be thought of in two different types, each with different use cases:<br />
<br />
'''Public chat.''' With Lua given the capability to parse public MP chat, this allows for the computer side, the AI, to be able to interact with the players given certain keywords, which would give certain scenarios a more immersive feel. Instead of being merely cosmetic, this chat could have an actual effect on gameplay. For instance, certain taunts could anger the AI, causing it to change tactics to attack a different player or recruit different units.<br />
<br />
'''Private commands with a /lua command.''' One is currently able to run Lua through :lua when debug mode is on, but this is infeasible for multiplayer. Being able to interpret "/lua command", especially if it were context aware for which hex is currently selected, would allow for several possibilities. For instance, allied AI could uses Lua to respond to your input so that it can formulate a strategy with you. Also, advanced content that could use certain /lua commands to trigger actions, allowing for anything from an MP-compatible "debug mode" to more restrictive triggers that are fitting to the particular scenario. Perhaps the host would use "/lua difficulty hard" to change the difficulty mid-scenario, or a player could use "/lua inventory" on their turn to pop up an RPG-style inventory screen without having to use any right click menus at all.<br />
<br />
Essentially, the Lua would be able to use certain input as a trigger for executing Lua functions, enabling a far broader range of possibilities for content creators. This would not actually implement any changes to the way the game is played. Rather, it would provide the ability for others to use this new feature in their own scenarios, eras, AI, etc.<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
<!-- expand --><br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41918SoC2011 Student Page Aethaeryn2011-04-09T18:56:34Z<p>Aethaeryn: /* Phase 0 */ adding the syntax for options, more to come</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string,<br />
narrator = string,<br />
unit = string, <br />
second_unit = string,<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====options====<br />
<!-- expand --><br />
<br />
Options has two possible syntax. If there is only one option, it can directly contain the option table:<br />
<br />
options = {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}<br />
<br />
If there is more than one option, it must have a table containing tables:<br />
<br />
options = {<br />
{<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
}, {<br />
text = string,<br />
filter = condition, -- must evaluate to true for the option to show<br />
callback = function, -- the actual effect of the command<br />
},<br />
}<br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
<!-- expand --><br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41917SoC2011 Student Page Aethaeryn2011-04-09T18:49:49Z<p>Aethaeryn: /* Phase 0 */ elaborating on gui_message{} and creating an introduction</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
The goal of this phase is to implement similar behavior in Lua to important UI-related WML tags so that these elements can be used in Lua without WML tables, thus eliminating clumsy syntax and ensuring complete implementation. Currently, certain parts, including [option], require clumsy workarounds when implemented in WML tables due to the nature of the tag. This also sets the stage for the later phases by establishing a starting point for more complex feature additions.<br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
speaker = "narrator",<br />
image = "wesnoth.png",<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message{}====<br />
The basic portion of gui_message{} is an implementation of the [message] WML tag without any of the subtags. Through the extensions below it allows absolutely everything in WML [message] to be converted except for the filters, which are better done through plain Lua. Note that the use of {} instead of () for the function means that it technically is fed in a Lua keyed table, meaning that the order of the arguments does not matter as long as they match the key. Default values are used for arguments that are not defined, just like the WML behavior.<br />
<br />
gui_message {<br />
message = string,<br />
speaker = string,<br />
narrator = string,<br />
unit = string, <br />
second_unit = string,<br />
side_for = integer, -- or a table with a set of integers<br />
image = string,<br />
caption = string,<br />
scroll = boolean,<br />
duration = integer,<br />
sound = string,<br />
options = table, -- see below<br />
text_input = table, -- see below<br />
}<br />
<br />
The best part about this is that the core function (excluding the options and text_input tables) can be easily converted into a form recognizable by WML and handled using the same function that handles the existing [message] code. Complexity and a difference from the WML definition only really enter when implementing [option] and [text_input].<br />
<br />
Calling the function does not actually display the message. Instead, one does "variable = gui_message{ ... }" and then variable.show <!-- or is it variable.show()? --> when one wants the message to trigger.<br />
<br />
The alternative form of gui_message{} is gui_message(table) where table is a table with keys that match the definition of gui_message{}.<br />
<br />
====option====<br />
<!-- expand --><br />
<br />
====callback====<br />
<!-- expand --><br />
<br />
====text_input====<br />
<!-- expand --><br />
<br />
====set_menu_item()====<br />
<!-- expand --><br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
<!-- expand --><br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41843SoC2011 Student Page Aethaeryn2011-04-09T02:50:08Z<p>Aethaeryn: /* The Implementation: Timeline */ not necessary</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
<!-- expand --><br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
<!-- expand --><br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41839SoC2011 Student Page Aethaeryn2011-04-08T21:45:56Z<p>Aethaeryn: /* Sample Syntax */ readability</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
<!-- expand --><br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}<br />
}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
<br />
By this time, I will have had enough experience with Wesnoth's Lua implementation that I'll find new things that bother me with the Lua, and hopefully that will provide something to do in summer 2012.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
<!-- expand --><br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41830SoC2011 Student Page Aethaeryn2011-04-08T19:11:53Z<p>Aethaeryn: a bunch of comments to remind me where I still need to finish</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
<!-- fixme: rewrite in the style of the two phases and expand --><br />
<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
<!-- expand --><br />
<br />
===Phase 0===<br />
<!-- expand --><br />
<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
<!-- expand --><br />
<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
<!-- expand --><br />
<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
<br />
By this time, I will have had enough experience with Wesnoth's Lua implementation that I'll find new things that bother me with the Lua, and hopefully that will provide something to do in summer 2012.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<!-- expand --><br />
<br />
==Patches==<br />
<!-- expand --><br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41827SoC2011 Student Page Aethaeryn2011-04-08T18:58:56Z<p>Aethaeryn: linking to GSOC application</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
<br />
By this time, I will have had enough experience with Wesnoth's Lua implementation that I'll find new things that bother me with the Lua, and hopefully that will provide something to do in summer 2012.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}<br />
<br />
==SoC Application==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/aethaeryn/1 Battle for Wesnoth - Google Summer of Code Application]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41825SoC2011 Student Page Aethaeryn2011-04-08T18:50:46Z<p>Aethaeryn: /* The Implementation: Timeline */ improving timeline</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || <h4>Pre-Summer I</h4><br />
Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 ||<br />
Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || '''Spring semester ends.''' Availability may be limited during this period.<br />
|-<br />
| || May 19 - May 30 || <h4>Summer I</h4><br />
'''Phase 0 ends; Phase 1 beings.''' My schedule is be ''entirely'' free in this time span.<br />
|-<br />
| || May 31 - June 30 || <h4>Summer II</h4><br />
The entire month of June will be spent on Phase 1. I will balance my time with a summer semester, but should have Fridays through Sundays entirely free.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || <h4>Middle of GSOC</h4><br />
'''Phase 1 ends.''' The largest portion of the project, Phase 1, should be concluding around this point.<br />
<br />
Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || '''Summer semester ends.''' Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || <h4>Summer III</h4><br />
'''Phase 2 begins.''' Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || <h4>Pencils Down Date</h4><br />
According to Google: "Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
<br />
By this time, I will have had enough experience with Wesnoth's Lua implementation that I'll find new things that bother me with the Lua, and hopefully that will provide something to do in summer 2012.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41823SoC2011 Student Page Aethaeryn2011-04-08T18:37:34Z<p>Aethaeryn: /* The Implementation: Timeline */ clarifying the current period</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with various developers in order to finalize most of the project's design.<br />
Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41822SoC2011 Student Page Aethaeryn2011-04-08T18:35:33Z<p>Aethaeryn: /* Phase 0: The Initial Changes */ expanding the explanation</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The trickiest part will be implementing the callback, which will allow menu options to trigger Lua functions.<br />
<br />
Because the code already exists to handle the WML tags, most of the work is allowing these Lua functions to utilize already-existing code in the engine. In this phase, the Lua functions to be created more or less map one-to-one with WML tags, which is why this would be a "Phase 0". On the surface, the changes may seem subtle, but it will allow for a more Lua way of implementing these than WML tables, which will improve interaction with Lua scripting functions while also making the Lua side of Wesnoth scripting easier to learn. In addition, it will ensure that these very central UI actions are consistent with Phase 1 syntax.<br />
<br />
The related WML tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41821SoC2011 Student Page Aethaeryn2011-04-08T18:27:54Z<p>Aethaeryn: /* Phase 2: Simplify Add-on Creation */ cleaning up</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
Phase 0 and Phase 1 might seem somewhat unrelated, but Phase 2 is intended to unify them under a common, easily-accessible package of sorts that provides a highly-abstracted, clean syntax for add-on authors to manipulate various elements of the UI. The original implementation from Phases 0 and 1 will still exist for those who want more control and customization, while Phase 2 will make things available for those who do not wish to necessarily deal with the complexity. There are two areas that will allow the improvements to be immediately accessible in an easy manner to content authors:<br />
* I will implement a Lua "wesnoth.ui" that adds an additional abstraction layer on top of the already existing syntax, simplifying the appearance of the code at the expense of some finer control.<br />
* If I have the time, I will create new, defined-in-Lua WML tags that utilize wesnoth.ui so that one does not have to use Lua to benefit from the improvements to Lua.<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41816SoC2011 Student Page Aethaeryn2011-04-08T18:06:10Z<p>Aethaeryn: /* Questionnaire */ using the table directly from the MediaWiki documentation to see if this helps</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
{| class="collapsible collapsed wikitable"<br />
|-<br />
! Aethaeryn's Questionnaire<br />
|-<br />
|<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[see GSOC submission page]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
|-<br />
|<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
|-<br />
|<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
|-<br />
|<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
|-<br />
|<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[see GSOC submission page]<br />
|}</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41814SoC2011 Student Page Aethaeryn2011-04-08T18:02:24Z<p>Aethaeryn: /* Questionnaire */ this should, in theory, make the quesitonnaire collapsable</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<div class="collapsible collapsed toccolours"><br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]<br />
</div></div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=MediaWiki:Common.css&diff=41813MediaWiki:Common.css2011-04-08T18:01:32Z<p>Aethaeryn: adding css from http://www.mediawiki.org/wiki/Manual:Collapsible_tables to allow for collapsible tables in wiki pages</p>
<hr />
<div>/* CSS placed here will be applied to all skins */<br />
<br />
table.collapsed tr.collapsible {<br />
display: none;<br />
}<br />
<br />
.collapseButton { /* 'show'/'hide' buttons created dynamically by the */<br />
float: right; /* CollapsibleTables JavaScript in [[MediaWiki:Common.js]] */<br />
font-weight: normal; /* are styled here so they can be customised. */<br />
text-align: right;<br />
width: auto;<br />
}</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=MediaWiki:Common.js&diff=41812MediaWiki:Common.js2011-04-08T18:00:25Z<p>Aethaeryn: adding javascript from http://www.mediawiki.org/wiki/Manual:Collapsible_tables to allow for collapsible tables in wiki pages</p>
<hr />
<div>/* Any JavaScript here will be loaded for all users on every page load. */<br />
<br />
/** Collapsible tables *********************************************************<br />
*<br />
* Description: Allows tables to be collapsed, showing only the header. See<br />
* http://www.mediawiki.org/wiki/Manual:Collapsible_tables.<br />
* Maintainers: [[en:User:R. Koot]]<br />
*/<br />
<br />
var autoCollapse = 2;<br />
var collapseCaption = 'hide';<br />
var expandCaption = 'show';<br />
<br />
function collapseTable( tableIndex ) {<br />
var Button = document.getElementById( 'collapseButton' + tableIndex );<br />
var Table = document.getElementById( 'collapsibleTable' + tableIndex );<br />
<br />
if ( !Table || !Button ) {<br />
return false;<br />
}<br />
<br />
var Rows = Table.rows;<br />
<br />
if ( Button.firstChild.data == collapseCaption ) {<br />
for ( var i = 1; i < Rows.length; i++ ) {<br />
Rows[i].style.display = 'none';<br />
}<br />
Button.firstChild.data = expandCaption;<br />
} else {<br />
for ( var i = 1; i < Rows.length; i++ ) {<br />
Rows[i].style.display = Rows[0].style.display;<br />
}<br />
Button.firstChild.data = collapseCaption;<br />
}<br />
}<br />
<br />
function createCollapseButtons() {<br />
var tableIndex = 0;<br />
var NavigationBoxes = new Object();<br />
var Tables = document.getElementsByTagName( 'table' );<br />
<br />
for ( var i = 0; i < Tables.length; i++ ) {<br />
if ( hasClass( Tables[i], 'collapsible' ) ) {<br />
<br />
/* only add button and increment count if there is a header row to work with */<br />
var HeaderRow = Tables[i].getElementsByTagName( 'tr' )[0];<br />
if ( !HeaderRow ) {<br />
continue;<br />
}<br />
var Header = HeaderRow.getElementsByTagName( 'th' )[0];<br />
if ( !Header ) {<br />
continue;<br />
}<br />
<br />
NavigationBoxes[tableIndex] = Tables[i];<br />
Tables[i].setAttribute( 'id', 'collapsibleTable' + tableIndex );<br />
<br />
var Button = document.createElement( 'span' );<br />
var ButtonLink = document.createElement( 'a' );<br />
var ButtonText = document.createTextNode( collapseCaption );<br />
<br />
Button.className = 'collapseButton'; // Styles are declared in [[MediaWiki:Common.css]]<br />
<br />
ButtonLink.style.color = Header.style.color;<br />
ButtonLink.setAttribute( 'id', 'collapseButton' + tableIndex );<br />
ButtonLink.setAttribute( 'href', "javascript:collapseTable(" + tableIndex + ");" );<br />
ButtonLink.appendChild( ButtonText );<br />
<br />
Button.appendChild( document.createTextNode( '[' ) );<br />
Button.appendChild( ButtonLink );<br />
Button.appendChild( document.createTextNode( ']' ) );<br />
<br />
Header.insertBefore( Button, Header.childNodes[0] );<br />
tableIndex++;<br />
}<br />
}<br />
<br />
for ( var i = 0; i < tableIndex; i++ ) {<br />
if ( hasClass( NavigationBoxes[i], 'collapsed' ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], 'autocollapse' ) ) ) {<br />
collapseTable( i );<br />
} else if ( hasClass( NavigationBoxes[i], 'innercollapse' ) ) {<br />
var element = NavigationBoxes[i];<br />
while ( element = element.parentNode ) {<br />
if ( hasClass( element, 'outercollapse' ) ) {<br />
collapseTable( i );<br />
break;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
addOnloadHook( createCollapseButtons );<br />
<br />
/** Test if an element has a certain class **************************************<br />
*<br />
* Description: Uses regular expressions and caching for better performance.<br />
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]<br />
*/<br />
<br />
var hasClass = ( function() {<br />
var reCache = {};<br />
return function( element, className ) {<br />
return ( reCache[className] ? reCache[className] : ( reCache[className] = new RegExp( "(?:\\s|^)" + className + "(?:\\s|$)" ) ) ).test( element.className );<br />
};<br />
})();</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41810SoC2011 Student Page Aethaeryn2011-04-08T17:24:29Z<p>Aethaeryn: /* Sample syntax */ the syntax can get even simpler there</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show{message = messageText}<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41808SoC2011 Student Page Aethaeryn2011-04-08T17:04:10Z<p>Aethaeryn: /* Sample Syntax */ lua uses {} instead of () in this situation based on my interpreter tests</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message{<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
}}<br />
<br />
local msg2 = gui_message{<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show({message = messageText})<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41803SoC2011 Student Page Aethaeryn2011-04-08T16:20:54Z<p>Aethaeryn: /* Phase 2 */ sample sytnax for part of phase 2</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message(<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
})<br />
<br />
local msg2 = gui_message(<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====Sample syntax====<br />
The final goal is to use wesnoth.ui.show() to hide almost all of the interface details by providing a syntactical shortcut to the functions in Phase 0 and Phase 1. More complexity will be possible, as in sample2, but the extremely basic sample1 will be legal syntax as well.<br />
<br />
sample1 = {message = "Hello world"}<br />
sample2 = {message = {"Hello world", options = {speaker = "Konrad", side_for = 1}}}<br />
wesnoth.ui.show(sample1)<br />
wesnoth.ui.show(sample2)<br />
<br />
This will allow for possibilities like the following, where the GUI message is literally as simple as providing one string:<br />
<br />
function message_all(messageText)<br />
wesnoth.ui.show({message = messageText})<br />
<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41801SoC2011 Student Page Aethaeryn2011-04-08T15:57:17Z<p>Aethaeryn: /* Phase 0 */ adding sample sytnax from the pastebin stuff</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====Sample Syntax====<br />
local msg = gui_message(<br />
message = "Hello world!",<br />
settings = {<br />
speaker = "narrator",<br />
image = "wesnoth.png"<br />
},<br />
options = {<br />
{ text='hello', callback = foobar() },<br />
{ text='goodbye', callback = say_goodbye() }<br />
})<br />
<br />
local msg2 = gui_message(<br />
message = "What's your name?",<br />
-- no "settings =" makes it set reasonable defaults<br />
-- text_input takes either a table containing the information, or a table of tables that are all valid text_input<br />
text_input = {variable = "foo", label = "Name: ", max_length = 42}<br />
<br />
if side = host then<br />
msg.show<br />
<br />
function foobar()<br />
msg2.show<br />
<br />
====gui_message()====<br />
====option====<br />
====callback====<br />
====text_input====<br />
====set_menu_item()====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41799SoC2011 Student Page Aethaeryn2011-04-08T15:26:14Z<p>Aethaeryn: what the hell was I thinking when I wrote such a long title? changed to "introduction"</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==IRC==<br />
Aethaeryn<br />
<br />
==Introduction==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41748SoC2011 Student Page Aethaeryn2011-04-08T08:22:09Z<p>Aethaeryn: /* The Implementation: Details */ too tired to complete, but I didn't forget about this section; warning in case I oversleep the 7pm UTC deadline</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
''I'm sleeping. This section will be filled out when I can think again.<br />
<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41747SoC2011 Student Page Aethaeryn2011-04-08T08:09:31Z<p>Aethaeryn: /* Practical considerations */ unnecessary</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41746SoC2011 Student Page Aethaeryn2011-04-08T08:01:20Z<p>Aethaeryn: /* Experience */ adding link to my user page.</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
Also see [[User:Aethaeryn|my user page]]. The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else. Plenty of people use Eclipse, Kate, vim, nano, and so on, and still produce good code.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41745SoC2011 Student Page Aethaeryn2011-04-08T07:54:21Z<p>Aethaeryn: /* Description */ less verbose</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
I intend to improve the ability for add-ons to customize the user interface through Lua. I will focus on providing simple, but powerful syntax for a set of functions that will enable add-on creators to have improved, easier access to features that already exist within the game engine so that they are free to creatively provide more innovative content.<br />
<br />
The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else. Plenty of people use Eclipse, Kate, vim, nano, and so on, and still produce good code.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41744SoC2011 Student Page Aethaeryn2011-04-08T07:53:17Z<p>Aethaeryn: /* Description */ changing title</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua's User Interface Capabilities</h4><br />
This main goal of this proposal is to improve the capability of the Lua scripting language when used for creating add-ons, specifically with the various interfaces visible to the users while playing the game. This project will focus on providing simple, but powerful syntax for a broad range of features that enable add-on creators to have improved and easier access to features that mostly already exist within the game engine so that they are free to creatively provide more innovative content. The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else. Plenty of people use Eclipse, Kate, vim, nano, and so on, and still produce good code.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41743SoC2011 Student Page Aethaeryn2011-04-08T07:44:45Z<p>Aethaeryn: /* The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities */ moving a paragraph from the questionaire up to here</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua Add-ons' Abilities in Interfaces</h4><br />
This main goal of this proposal is to improve the capability of the Lua scripting language when used for creating add-ons, specifically with the various interfaces visible to the users while playing the game. This project will focus on providing simple, but powerful syntax for a broad range of features that enable add-on creators to have improved and easier access to features that mostly already exist within the game engine so that they are free to creatively provide more innovative content. The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
Fortunately, the solution is rather obvious to the WML table problem. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else. Plenty of people use Eclipse, Kate, vim, nano, and so on, and still produce good code.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41742SoC2011 Student Page Aethaeryn2011-04-08T07:43:57Z<p>Aethaeryn: /* Project */ editing</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua Add-ons' Abilities in Interfaces</h4><br />
This main goal of this proposal is to improve the capability of the Lua scripting language when used for creating add-ons, specifically with the various interfaces visible to the users while playing the game. This project will focus on providing simple, but powerful syntax for a broad range of features that enable add-on creators to have improved and easier access to features that mostly already exist within the game engine so that they are free to creatively provide more innovative content. The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
Fortunately, there solution is rather obvious. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish and inelegant WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things. So, yes, this project is one I invented, but I wouldn't say that I invented it on my own because I did ask for advice on IRC in narrowing my topic from the very broad scope of "Lua" to something more specific.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else. Plenty of people use Eclipse, Kate, vim, nano, and so on, and still produce good code.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaerynhttps://wiki.wesnoth.org/index.php?title=SoC2011_Student_Page_Aethaeryn&diff=41741SoC2011 Student Page Aethaeryn2011-04-08T07:41:17Z<p>Aethaeryn: /* Project */ editing</p>
<hr />
<div>{{SoC2011Student_2|Aethaeryn|SoC_Ideas_Your_Own_Ideas2011}}<br />
<br />
==Description==<br />
<h4>Michael Babich - Improving Lua Add-ons' Abilities in Interfaces</h4><br />
This main goal of this proposal is to improve the capability of the Lua scripting language when used for creating add-ons, specifically with the various interfaces visible to the users while playing the game. This project will focus on providing simple, but powerful syntax for a broad range of features that enable add-on creators to have improved and easier access to features that mostly already exist within the game engine so that they are free to creatively provide more innovative content. The purpose of this project is to act as a middleman between the game engine and the add-on creators using the Lua scripting language so that simple and powerful add-on creation can help revolutionize future MP, just as [set_menu_item] and [option] allowed for a great evolution in the quality of add-ons since 1.3. This interface framework needs to be as broad as possible in the time given and the scope allowed so that creative add-on authors themselves can stretch Wesnoth content far beyond its traditional style, but it also must provide a simplified Lua helper library so that everyone can use it without necessarily having to delve deeply into the complexity that exists in the currently-existing GUI.<br />
<br />
==The Necessity of Improvements to Simplify and Extend Lua's Add-on Capabilities==<br />
I have been making content for Wesnoth since 2007 and I have been gradually porting much of my more advanced content to Lua since late 2009. While doing so, I have noticed certain limitations to the current implementation of Lua as it relates to add-on creation, especially with certain elements only possible through WML or the rather poorly readable WML tables. As the title suggests, I wish to simply and extend the add-on creation capabilities in Lua. In particular, I will be working with various elements of the interface code because this is currently where Lua is weak and often just relying on WML tables. There are several problems with using WML tables in these areas:<br />
* '''Poor readability, clumsy syntax, and verbosity.''' The metatable in the helper library helps with readability, but does not always work (for instance on [or] and [and] boxes, where those words are reserved in Lua) and it still hides the underlying issue that true native Lua support is not there. It also is fairly difficult in certain applications where the XML-style WML syntax is clearly inferior and much more verbose than something done in pure Lua.<br />
* '''You're essentially using WML.''' This defeats the purpose of using Lua in the first place if the majority of your code in a particular area is in WML. This is made even more severe when one realizes that many of the areas that must currently be done via WML tables are complex things that are the kind of things best done in a real language in the first place. In particular, the [message], [option], and [set_menu_item] have no real Lua equivalent. <br />
* '''Calling Lua from WML tables is hacky.''' Currently, if one wants to call a Lua function from T.option {}, one has to set a string that is a call on a global Lua function.<br />
<br />
Fortunately, there solution is rather obvious. Lua needs to be extended to access features that almost all already exist in the game engine and these must be implemented through Lua functions and tables instead of WML tables so that the full benefits of using Lua for scripting can be realized. Although the problem and solution are fairly easy to describe, certain precautions must be taken to make ensure that save games are not broken and no new issues are introduced. In addition, the individual proposed changes must be enumerated for clarity as to the scope of the project.<br />
<br />
==The Implementation: Overview==<br />
The information can roughly be broken down into three separate phases, 0 through 2. First, I shall go through an overview so as to be straightforward with the overall planned changes, then I shall provide the details of each individual section, and finally I shall propose a detailed timeline as to when each part can be accomplished.<br />
<br />
===Phase 0: The Initial Changes===<br />
First, src/scripting/lua.cpp should be split into smaller, logically-organized files so that the file does not grow too large and unmanageable with the improvements planned. This has the additional effect of allowing me to get familiar with the core Lua code.<br />
<br />
Next, various UI tags shall be implemented in native Lua without WML tables. The hardest portion of this is ensuring that the Lua changes can be implemented without breaking save files. Most of the existing WML code can be reused, so a key purpose of this is to get rid of the need for WML tables for this portion of the code so that it better interacts with files written purely in Lua and so it is in a consistent style with code in the later portion of this project. The tags that need to be ported to Lua functions:<br />
* [message]<br />
** [option]<br />
** [text_input]<br />
* [set_menu_item]<br />
<br />
===Phase 1: Complex Interface Changes===<br />
* Implement improved Lua access to the in-scenario GUI stuff, again without WML table hacks.<br />
** This includes improving the syntax and implementation of the [http://wiki.wesnoth.org/LuaWML:Display#wesnoth.show_dialog dialog Lua].<br />
* A way to take in text commands in a way similar to debug mode's :lua, but only using specific commands to do specific actions as defined by Lua code in the add-on.<br />
<br />
===Phase 2: Simplify Add-on Creation===<br />
* Implement Lua "ui" package similar to helper that adds an additional abstraction layer on top of Phase 1 to simplify it for add-on creators.<br />
* Create a similar implementation to the above through newly-defined WML tags.<br />
* (The original implemenation will still exist for those who want more control and customizability, while this implementation is available for those who do not wish to deal with the complexity that the interface can actually provide.)<br />
<br />
==The Implementation: Details==<br />
===Phase 0===<br />
====gui_message()====<br />
====option====<br />
====text_input====<br />
====set_menu_item()====<br />
====Calling on Lua Code From a Message====<br />
<br />
===Phase 1===<br />
====Dialog Improvements====<br />
====GUI 2 Access====<br />
====Commands?====<br />
<br />
===Phase 2===<br />
====wesnoth.ui====<br />
<br />
====WML additions====<br />
<br />
==The Implementation: Timeline==<br />
{| border="1"<br />
| now || April&nbsp;08&nbsp;-&nbsp;April&nbsp;22&nbsp;&nbsp; || Discuss details of the implementation with the various developers so that the proposal is ready for the summer. Work on basic patches, especially in the early areas of Phase 0, so that commit access can be granted before the designated GSOC period. Most of the design needs to be finalized in this period.<br />
|-<br />
| || April 23 - May 08 || Continue to familiarize myself with the project and its code by doing more of Phase 0.<br />
|-<br />
| || May 09 - May 18 || Spring semester ends. Availability may be limited during this period. (The days might be slightly off depending on what the final exam schedule is.)<br />
|-<br />
| || May 19 - May 30 || My schedule should be ''entirely'' free in this time span, so Phase 0 should be completed (if it isn't already finished) and substantial progress should be made on Phase 1.<br />
|-<br />
| || May 31 - June 30 || The entire month of June will be spent on Phase 1.<br />
|-<br />
| || July 4 - July 8 || Expected busy week as my one summer course wraps up.<br />
|-<br />
| || July 9 - July 17 || Phase 1, the bulk of the project, should be concluding around this point. Since this is around the middle evaluation point, part of the focus should be on reviewing the design and plans for the second half of GSOC. If I am ahead of schedule or behind schedule, adjustments can be made.<br />
|-<br />
| || July 18 - July 22 || Expected busy week as my other summer course wraps up.<br />
|-<br />
| || July&nbsp;23&nbsp;-&nbsp;August&nbsp;15&nbsp; || Phase 2. Again, my schedule should be ''entirely'' free to focus on the project.<br />
|-<br />
| || August 15 || According to Google: "'pencils down' date. Take a week to scrub code, write tests, improve documentation, etc."<br />
|-<br />
| || lim t<br>t→∞ || Continue to work on Wesnoth's Lua scripting capabilities because it certainly will take more than just one summer to perfect it.<br />
|-<br />
|}<br />
<br />
==Goals==<br />
<br />
==Patches==<br />
''Work on the Phase 0 patches will resume immediately after this document is finished and submitted.<br />
<br />
==Questionnaire==<br />
<br />
===Basics===<br />
<br />
'''1.1) Write a small introduction to yourself.'''<br />
<br />
I am Michael Babich, better known to the Wesnoth community as "Aethaeryn". I'm 20 and I'm from Baltimore, Maryland, USA. I'm currently in my third of five years at [http://www.umbc.edu/ UMBC]. I've been using Linux as my primary operating system since 2005 and I've been involved in the Wesnoth community since 2007. I love Linux and open source software, which is why I am currently an officer in my university's Linux Users' Group.<br />
<br />
'''1.2) State your preferred email address.'''<br />
<br />
[spambot paranoia]<br />
<br />
'''1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?'''<br />
<br />
Aethaeryn<br />
<br />
'''1.4) Why do you want to participate in summer of code?'''<br />
<br />
I love coding, especially for Wesnoth, where I have five in-progress add-ons (they'll be ready when they're ready), one published add-on, and several obsolete add-ons on older versions of Wesnoth (trust me, the old stuff wasn't that great). Even though I'd hypothetically try to contribute the code related to these patches without GSOC paying me, I probably wouldn't be able to follow through on any significantly large mainline project without the GSOC incentive. It would count as an internship so I'd have added motivation to push through even the most difficult parts and I wouldn't have to get a day job so I would actually have ''time'' to code, which is very important. Often, I have lots of things I would code given the time, but I simply don't have the time to accomplish everything I would like to accomplish. GSOC is essentially an excuse to do what I want to do '''and''' have it be my top priority at the same time.<br />
<br />
'''1.5) What are you studying, subject, level and school?'''<br />
<br />
I go to University of Maryland Baltimore County (UMBC). I am an undergraduate in my third year out of five, studying Computer Science, Mathematics, and Philosophy. As of the end of this semester, I have met all of my requirements in Philosophy. For Computer Science and Mathematics, I'm about 1/3 to 1/2 of the way through those programs. While I'm certainly majoring in Computer Science and Philosophy, I might minor in Mathematics instead of majoring in it. I'll have to see how the upper level courses are.<br />
<br />
My GPA is currently 3.713, but it's currently 4.0 in computer science, mathematics, and logic-related philosophy.<br />
<br />
'''1.6) What country are you from, at what time are you most likely to be able to join IRC?'''<br />
<br />
I'm from the United States, on the east coast, and I'm almost always on IRC when I'm not in class. During much of the summer, I should be on IRC all-day Friday, all-day Saturday, all-day Sunday, and evenings (probably 4pm or 5pm EDT to midnight or later) the rest of the days. I may also be able to be online at other times, such as the mornings. If necessary, I can even host my "screen irssi" on a remote server and simply ssh into it, which would enable me to be "on" IRC even when I'm not on my computer. For other parts of the summer I'll literally be on 24/7 except when RL interferes. See (1.7) and the timeline for when I have other commitments.<br />
<br />
'''1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.'''<br />
<br />
Because of my overly-ambitious academic goals, there's no way to not take summer classes if I ever intend on graduating, but I'm only going to be taking two (last summer I took four). I have a Monday/Wednesday/Thursday math class from 9:00 AM to 11:05 AM (eastern US time), May 31st to July 8th. I have a Monday/Tuesday/Thursday math class from 1:00 PM to 3:05 PM, May 31st to July 22nd. Other than that, I have no social life outside of school (and it's summer break) and IRC (all except two on my default join list are Wesnoth-related channels). I never go on any vacations. So yes, those time slots are literally my only other time commitments for the entirety of summer. For much of May and all of August, I will be doing nothing of importance at all and probably would be spending it on Wesnoth anyway.<br />
<br />
===Experience===<br />
<br />
My primary strength in terms of experience is that I've been with the Wesnoth project, doing almost everything possible except developing for the game engine itself over the course of almost four years. I know the Lua because I've made add-ons in Lua and will continue to port my active add-ons to Lua as time goes on. I know the community because I am part of it. I know the IRC channels because I've regularly been in many of the channels for years. I've even been using SVN as my means of downloading/updating/playing Wesnoth for at least two years now (for stable, development, and trunk).<br />
<br />
'''2.1) What programs/software have you worked on before?'''<br />
<br />
I have worked on coding projects for school (nothing truly substantial since the time-span to work on them is relatively short), and I have some local things that I have never published. In terms of code that's actually out there on the Internet, published, I have numerous Wesnoth add-ons. In general I have preferred writing Wesnoth MP add-ons instead of my own games from scratch. These are the add-ons that are accessible in some way (not an exhaustive list):<br />
<br />
* [http://files.wesnoth.org/addons/1.6/Just_for_Fun.tar.bz2 (Just For Fun, 1.6 add-on server only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.6/Dark_Legion/ (Dark Legion, 1.6 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Wesalwyn/ (Wesalwyn, 1.8 only)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/branches/1.8/Era_of_Tyrants/ (Era of Tyrants, currently 1.8, but awaiting trunk/Lua rewrite)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Era/ (Thunderstone Era, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Thunderstone_Trilogy/ (Thunderstone Trilogy, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Underlands_RPG/ (Underlands RPG, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Aethaeryns_Maps/ (Aethaeryn's Maps, trunk)]<br />
* [http://wesnoth-umc-dev.svn.sourceforge.net/viewvc/wesnoth-umc-dev/trunk/Master_of_Dungeons/ (Master of Dungeons, trunk)]<br />
<br />
The most substantial and recent example of my coding in Wesnoth add-ons, in Lua, is Master of Dungeons.<br />
<br />
'''2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)'''<br />
<br />
I have utilized the Wesnoth-umc-dev SVN repository for my add-ons for two years, and have collaborated with several other users of that repository for a few add-ons. I have collaborated with others on Thunderstone Era/Trilogy and Wesalwyn. I also collaborated on story/dialog parts of Underlands RPG. Some of my earlier works, including some of Era of Tyrants and the oldest scenarios in Aethaeryn's Maps, reused with permission certain code from other GPL'd sources, but MoD is from-scratch, especially since I rewrote most of it in Lua earlier this year. Most of my work has been individual, though.<br />
<br />
'''2.3) 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?'''<br />
<br />
I have not participated in GSOC before.<br />
<br />
'''2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.'''<br />
<br />
I have been involved in the Wesnoth community since 2007:<br />
* add-ons (since 2007; published since 1.3.x)<br />
* unofficial Wesnoth-style sprite art (since 2008)<br />
* wesnoth-umc-dev SVN repository (since 2009)<br />
* wiki moderator (since 2009)<br />
* Latin translator (since 2009)<br />
* Lua-based add-ons (since 2010)<br />
<br />
'''2.5) Gaming experience - Are you a gamer?'''<br />
<br />
Yes.<br />
<br />
'''2.5.1) What type of gamer are you?'''<br />
<br />
Mostly a strategic thinker, preferring to play slowly so I can formulate detailed plans.<br />
<br />
'''2.5.2) What type of games?'''<br />
<br />
I love strategy games. I used to be big on RTS games, but ever since I found Wesnoth, the "strategy" part in RTS games seems more and more like a joke because turn based strategy games are far superior in terms of actually giving one enough time to formulate a strategy. I have in the past played various mainstream/commercial games, such as RTSes, FPSes, and action games. However, the only OS I have been using for the past few years is Fedora Linux. I've also been focusing on my academics and on gaining programming experience, so I haven't really kept up to date on the latest games out there. In addition, Wesnoth has shown me that making games can be more fun than playing games (and playing my own games is the best of both worlds).<br />
<br />
'''2.5.3) What type of opponents do you prefer?'''<br />
<br />
I prefer cooperating as part of a team, even if there are no opponents at all. When I play against an opponent, I'd like to play against someone who's playing for fun and isn't too serious about the outcome of the game. I prefer team-oriented matches in Wesnoth because they are, in general, less competitive and more social. My second favorite type of Wesnoth game is a free-for-all because they're so chaotic that, again, it's more about having fun and socializing than competing. I can easily get too competitive in a game to the point where it loses any fun if I take it too seriously, so I avoid things like the ladder and I tend not to play 1v1s at all.<br />
<br />
'''2.5.4) Are you more interested in story or gameplay?'''<br />
<br />
If the gameplay sucks, the story won't redeem it, but if the story sucks, the game can get boring after a while and doesn't feel truly immersive. As for which I prefer, I can't say I really prefer one over the other. I was a writer long before I was a programmer and for some things, I work extensively on the backstory before I even write a line of code, while for other things I definitely have the gameplay in mind first and then come up with a story once there's something fun and playable.<br />
<br />
'''2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.'''<br />
<br />
Almost four years experience, mostly MP but also a significant amount of SP, especially when I first started playing Wesnoth. I've been playing since the 1.2/1.3 versions.<br />
<br />
'''2.6) 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.'''<br />
<br />
I will not be able to submit a patch by the application deadline, but they will be [http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#Patches here] when I have the time.<br />
<br />
===Communication skills===<br />
<br />
'''3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.'''<br />
<br />
English is my native language.<br />
<br />
'''3.2) What spoken languages are you fluent in?'''<br />
<br />
I'm fluent in English. I'm also fairly proficient in Latin, and am a Latin translator for Wesnoth, but, unfortunately, that's not much of a spoken language these days.<br />
<br />
'''3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.'''<br />
<br />
Yes. Because I have been with the Wesnoth community for years, I am aware of certain aspects of the community that have in the past unintentionally driven certain talented people away. As long as I don't do anything related to the RNG or mainline art, I hope I'll be okay. ;-)<br />
<br />
'''3.4) Do you give constructive advice?'''<br />
<br />
Yes, although I do not believe that I would be able to evaluate myself in an unbiased manner on such an issue. I can only assume that I give good enough advice because people ask me for advice (more than once, of course). I suppose if you were really skeptical Espreon would vouch for me here. I hope.<br />
<br />
'''3.5) Do you receive advice well?'''<br />
<br />
Yes. I'm a student, so I see myself as a constant learner. If I already knew everything, I wouldn't be applying for GSOC.<br />
<br />
'''3.6) Are you good at sorting useful criticisms from useless ones?'''<br />
<br />
Yes. The Internet these days is all about separating useful from useless content so it's a valuable skill to develop. I'd have no time at all if I was bogged down reading everything out there.<br />
<br />
'''3.7) 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 "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want?'''<br />
<br />
I have no problem with coding many, many hours on my own once I know what I'm supposed to be coding, but I definitely don't want to waste hours working on something that's just going to be thrown out, so I definitely will seek feedback as much as necessary in order to not waste any time/effort.<br />
<br />
===Project===<br />
<br />
'''4.1) 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?'''<br />
<br />
I did not select a project from the list.<br />
<br />
'''4.2) If you have invented your own project, please describe the project and the scope.'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#Description|See here.]]<br />
<br />
'''4.3) Why did you choose this project?'''<br />
<br />
As a long-time add-on creator for Wesnoth, I am aware of certain limitations currently present when one is creating add-ons. Because I have started to port my add-ons into Lua, I have noticed that there are some features that have to be done through hackish WML Tables (essentially coding WML through Lua) because of what appears to be a currently incomplete implementation of Lua. I have noticed that most of these issues seem to be related to various parts of the interface and so that is where I have chosen to focus my efforts, after consulting Crab_ and others on IRC. My eventual, long-term goal is to make Lua powerful enough to handle most of the event-driven scripting side of Wesnoth content while leaving WML to do what it does best, mainly the basic definitional things.<br />
<br />
An ideal scenario or campaign would be one that uses WML to define the basic structure and then call on Lua for any more advanced elements. As I spend most of my Wesnoth time making -- or playing -- content for MP that do things that WML was not originally intended to do, such as making Wesnoth an RPG instead of a TBS, I have noticed that WML does not scale very well as a general purpose language doing advanced scripting. Any traditional language, such as Lua, can handle certain advanced things in a much more readable and efficient manner, but there are certain gaps in Lua where WML tables must be integrated with the Lua, which defeats many of the primary reasons to use Lua in the first place.<br />
<br />
'''4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".'''<br />
<br />
[http://wiki.wesnoth.org/SoC2011_Student_Page_Aethaeryn#The_Implementation:_Timeline See here for the timeline.]<br />
<br />
'''4.5) Include as much technical detail about your implementation as you can'''<br />
<br />
[[SoC2011_Student_Page_Aethaeryn#The_Implementation:_Details|See here.]]<br />
<br />
'''4.6) What do you expect to gain from this project?'''<br />
<br />
* Experience working with a large project with many developers and a mature code-base. The project is massive compared to anything done in university work, so it will provide practical programming and software engineering experience that will make the programming projects for classes seem extremely trivial.<br />
<br />
* Experience with open source. While Linux and FOSS have been passions of mine for more than five years, I need tangible, quantifiable experience that can demonstrate my commitment to FOSS values and GSOC presents the perfect opportunity to do so. Although I have been involved with the Wesnoth community since 2007, I have never actually gotten involved with the mainline code and do not have commit access, so this will provide a unique perspective I have not yet seen to the Wesnoth project, and FOSS communities in general.<br />
<br />
* Improving what I can do with Lua as an add-on creator. I would be lying if I didn't mention the suspicious correlation between me wanting to improve Lua's capabilities as an add-on scripting language and me having a substantial amount of add-ons either in Lua or about to be rewritten into Lua. Actually improving what I can do in add-ons using Lua might be the primary thing I expect to gain from this GSOC. >:D<br />
<br />
'''4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?'''<br />
<br />
I've been with the Wesnoth community since 2007. I'm staying.<br />
<br />
===Practical considerations===<br />
<br />
'''5.1) Are you familiar with any of the following tools or languages?'''<br />
<br />
* Subversion (used for all commits)<br />
** Yes, I've used it for both wesnoth (updates only) and wesnoth-umc-dev (updates and commits) for several years.<br />
* C++ (language used for all the normal source code)<br />
** Yes.<br />
* STL, Boost, Sdl (C++ libraries used by Wesnoth)<br />
** No.<br />
* Python (optional, mainly used for tools)<br />
** Yes. Python is a great language for scripting stuff.<br />
* build environments (eg cmake/autotools/scons)<br />
** Yes, primarily scons. Did I mention that Python is great?<br />
* WML (the wesnoth specific scenario language)<br />
** Yes, I've written Wesnoth add-ons since '07.<br />
* Lua (used in combination with WML to create scenarios) <br />
** Yes, I've been writing Wesnoth-related Lua since late '09.<br />
<br />
'''5.2) Which tools do you normally use for development? Why do you use them?'''<br />
<br />
I use GNU emacs, which I supplement with traditional UNIX tools, such as grep and gdb, as well as various scripts, mostly in Python. I've been using Linux as my primary (and often, including now, my only) operating system since 2005 so I have familiarity with the Linux way of doing things.<br />
<br />
I believe that choices like these are a matter of taste as long as one has experience with the tools... and as long as those tools are appropriate for the task, of course! One of the great things about Linux, and FOSS software in general, is that there's typically at least two good options for any given need, so I really don't want to start an editor war by saying that emacs is clearly superior to something else. Plenty of people use Eclipse, Kate, vim, nano, and so on, and still produce good code.<br />
<br />
'''5.3) What programming languages are you fluent in?'''<br />
<br />
In order of experience/confidence: Python, Lua, Java, WML, C++, sh, Lisp.<br />
<br />
'''5.4) 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 "there is no way to contact you" does arise!'''<br />
<br />
[spambot paranoia]</div>Aethaeryn