SummerOfCodeProposal Kahowell

From The Battle for Wesnoth Wiki
Revision as of 22:10, 9 April 2010 by Crab (talk | contribs) (SoC Application)

This page is related to Summer of Code 2010
See the list of Summer of Code 2010 Ideas

This is a Summer of Code 2010 student page
Project: SoC Ideas Gui2 Input


Kahowell - Making the Wesnoth Input Framework More Flexible

This would involve learning about the current state of the Wesnoth input system, and creating an input layer which is highly portable between different sorts of devices. Since Wesnoth already uses SDL, this project would mainly involve creating a subsytem to enumerate input devices and create a default configuration. I will look into different ways of identifying input devices (hopefully cross-platform), and perhaps create a database of default configurations (most likely just a collection of files). This project would also involve creating a dialog for input configuration.



SoC Application

Making the Wesnoth Input Framework More Flexible



  • Write a small introduction to yourself.

My name is Kevin Howell. I'm a computer science student (third year) at a liberal arts university in the United States. I'm interested in game programming as a hobby.

  • State your preferred email address.

kevin.adam.howell (at) gmail (dot) com

  • If you have chosen a nick for IRC and Wesnoth forums, what is it?


  • Why do you want to participate in summer of code?

I'm looking for a way to start participating in FOSS.

  • What are you studying, subject, level and school?

I am an undergraduate student at the College of William & Mary in the city of Williamsburg, VA. I'm a 3rd year computer science major. I have taken many classes including (but not limited to)

  • Computer Graphics
  • Data Structures
  • Web Programming
  • Programming Languages
  • Systems Programming
  • Algorithms
  • Theory of Computation
  • Software Development
  • What country are you from, at what time are you most likely to be able to join IRC?

I am from the United States. I would most likely be able to join IRC at around 4PM EDT (-5 GMT) until 11PM EDT.

  • Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.

I do not currently have any commitments for the summer.


  • What programs/software have you worked on before?

I do not have any experience in working with production software, though my school projects have included a raytracer in C++ from scratch.

  • Have you developed software in a team environment before? (As opposed to hacking on something on your own)

In college, I have done some pair programming.

  • 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?

I have not participated.

  • Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.

I am not yet involved with any.

  • Gaming experience - Are you a gamer?

Yes, I play computer and video games.

  • What type of gamer are you?

I play games for leisure.

  • What type of games?

I tend to enjoy Japanese-style strategy/tactical RPGs (ex. Disgaea, Final Fantasy Tactics).

  • What type of opponents do you prefer?

I prefer to play against friends.

  • Are you more interested in story or gameplay?

I am generally more interested in story, though I would say that there needs to be a balance.

  • Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or


I have played Wesnoth, though only the first couple of single player missions.

  • 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.

Communication skills

  • Though most of our developers are not native English speakers, English is the project's working language.  Describe your fluency level in written English.3.2) What spoken languages are you fluent in?

I am a native (American) English speaker. I speak some Japanese (and have taken 5 semesters of Japanese classes).

  • Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.

In general I take a pacifistic/avoidant attitude when dealing with aggression. (I tend to ignore agression).

  • Do you give constructive advice?


  • Do you receive advice well?

Yes, as long as the advice is understandable; otherwise, I'll ask for clarification.

  • Are you good at sorting useful criticisms from useless ones?

Yes, I can tell when someone is simply being picky and when they have legitimate criticisms.

  • 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?

I tend to spend more time in design than in coding, because more time in design generally leads to a better end product. So I would probably spend a good portion of time designing, maybe sending psuedo-code or diagrams to my mentor periodically to confirm validity.


  • 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?

I selected the input framework rewrite. I want to concentrate on designed a menu to allow changes to the input configuration as well as logic to create a sane default configuration.

  • If you have invented your own project, please describe the project and the scope.
  • Why did you choose this project?

I chose this project because I am familiar with SDL and feel that this is the best area I can contribute to.

  • 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".
  • Before May 24: Reading through source of Wesnoth
  • May 24 - May 29: Coding of a prototype (possibly simply some mouse-emulation hack using joysticks)
  • May 30 - June 5: Work on selecting widgets using the joystick.
  • June 6 - June 12: Start working on configuration dialog.
  • June 13 - June 19: Work on configuration files for input... Base on hotkey configs.
  • June 20 - June 26: Evaluate own progress, more work on passing input to widgets...
  • June 27 - July 3: Ask mentor for advice, criticisms, more work on widgets. (Goal: have wesnoth fully playable with only keyboard)
  • July 4 - July 11: Work on making code more flexible
  • July 12 - July 16: Rush to get code ready for midterm evaluation.
  • July 17 - August 9 : Bufixes, more coding. (Goal: have wesnoth fully playable with any input device [that SDL can handle]).
  • August 9 - August 20: Bug fixing.

4.5) Include as much technical detail about your implementation as you can

  • Startup
  1. Look into probing SDL upon startup to determine what types of input devices are available. Compare these devices with a listing of previously identified devices. Each device would have a value to disable or enable it in the config, so disable all devices disabled in the config.
  2. If a previously configured device is identified, load the configuration for it. Else, load/create a default config.
  • Dialog
  1. Additional dialog to be placed under the configuration main menu (Input)
  2. This dialog can be similar to the one for hotkeys. (It would be nice to integrate the two).
  3. Enumerate input devices, along with toggle boxes for each input device. (Each device would start as enabled, and then would be ignored ( if the box were unticked.)
  4. There would be sanity checks to insure that the user does not disable all input devices, perhaps also a timeout where the user must show that they can still interact with Wesnoth.
  • Decoupling input from the mouse
  1. Right now, the input for Wesnoth is mouse-centric.
  2. There are a couple of methods to try to decouple Wesnoth from the mouse.
    1. Mouse emulation (w/ Joystick) - Quick and dirty relocation of the mouse using SDL_WarpMouse, emulation of clicking via some refactoring...
    2. Using input to select menu items, etc. (preferred). The logic is similar to using the keyboard and Wesnoth has plenty of keyboard shortcuts. TODO: list what steps are required to make this happen.
  • Input flexibility
  1. I plan to play around with different ways of determining which button to use for each action. For example, axes might be adjustable as a threshold or raw values with determine cursor position.
  2. Also, for devices with limited keys or buttons, I may experiment with allowing held-in buttons to generate different events from ones that were simply pressed.
  3. I plan to write a script (probably a shell script) to grep the source code for certain input related strings (to aid myself and possibly others in switching to the new framework).
  • Extra

TODO: extra

4.6) What do you expect to gain from this project?

I expect to gain experience in working with developers in the FOSS community.

4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?

I would be likely to stay in the community if I felt I could make regular, meaningful contributions to Wesnoth.

5) Practical considerations

5.1) Are you familiar with any of the following tools or languages?

  • Subversion (used for all commits) - Yes
  • C++ (language used for all the normal source code) - Yes
    • STL - Yes
    • Boost - No
    • Sdl - Yes
  • Python (optional, mainly used for tools) - Yes

build environments (eg cmake/autotools/scons) - No, but I am very familiar with make.

  • WML (the wesnoth specific scenario language) - No
  • Lua (used in combination with WML to create scenarios) - No

5.2) Which tools do you normally use for development? Why do you use them?

I tend to use Netbeans or KDevelop. I like Netbeans because it is cross-platform, but I like the code browsing in KDevelop. For quick programs, I'll just use KATE sometimes.

5.3) What programming languages are you fluent in?

I am proficient in C, C++, Java, Python, PHP. I am also familiar with bash scripting, awk, sed, and perl.

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!

I would be happy to speak to them. (See my actual application)