SummerOfCodeProposal nerwa

From The Battle for Wesnoth Wiki

Contact Information

Name: Zhen Lu

Location: Shanghai, China

E-Mail: ne [DOT] rwa [DOT] lz [AT] gmail [DOT] com

Skype: ne_rwa

Answers to the Questions

Basics

1.1) Write a small introduction to yourself.

My name is Zhen Lu. I'm 21. I'm a senior student from Shanghai Jiao Tong University, China. I'm major in computer science and engineering.

1.2) State your preferred email address.

ne [DOT] rwa [DOT] lz [AT] gmail [DOT] com

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

IRC:nerwa

Wesnoth Forum: NeRwa

GNA: NeRwa

1.4) Why do you want to participate in summer of code?

I want to find something to do this summer and I want to improve my programming skills. Also I want to make contributions to open source projects.

1.5) What are you studying, subject, level and school?

4th year in computer science and engineering.

1.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 Wesnoth. If you have gained commit access to our S­­V­­N (during the evaluation period or earlier) please state so.

No, I haven't.

Experience

2.1) What programs/software have you worked on before?

Most of my projects are school projects. I built a compiler, implemented a operating system on a framework, built a SQL parser and execution engine in a database management system. I also built some web applications like an ACM-ICPC online judge system and a small search engine demo. And also I participated in TREC(Text REtrieval Conference) 2009 Enterprise Search Track.

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

Yes, some of my school projects are team works. I have a internship in IBM China Research Lab, the work I did there was in a team environment.

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?

No, this is the first time.

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

No.

2.5) Gaming experience - Are you a gamer?

Yes, I'm a gamer.

2.5.1) What type of gamer are you?

I think I'm pretty much like a core user.

2.5.2) What type of games?

I like action game, role-playing, and strategy game.

2.5.3) What type of opponents do you prefer?

Tough ones.

2.5.4) Are you more interested in story or gameplay?

I prefer gameplay to story.

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

Yes, I played Wesnoth before, mostly single player. And I played multiplayer for some times.

Communication skills

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.

My native language is Chinese, but I can read and write English well.

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

Yes, I think I'm a kind person.

3.3) Do you give constructive advice?

Yes, I do.

3.4) Do you receive advice well?

Yes, of course.

3.5) Are you good at sorting useful criticisms from useless ones?

I think I can sort useful criticisms from useless ones well.

Project

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?

I want to implement the stat report site.

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

I'm very interested in web application development. And I also like this game. I want to make a contribution to this project. So I choose to implement the stat report site.

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

Apr. 1 - Apr. 23: Build a basic frame work which can generate most of Chart. And build the pre-define chart generation patterns.

Apr.24 - May. 1: Build the user-select chart generation system.

Apr. 16 - Apr. 20: A trip is booked.

Milestone May 1: Pre-define charts are done and the basic user-select system is almost done.

May.1 - May. 15: Test and debug .

May. 16 - Jun. 1: improve user interface with AJAX and CSS + HTML. In this period I will write my graduating thesis in college.

Milestone Jun. 1: The web server is finished.

Jun.1 - Jul. 10 : Design the aggregate table.

Jul. 11 - Jul. 1: Implement the aggregate table and test.

Milestone Jul. 1: A framework for the aggregate table is finished.

Jul. 1 - Aug. 1: Add new features and improve the performance.

Milestone Aug. 1: The project is finished.

Aug.1 - The End: Test and bug fix.

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

I plan to implement the site using Ruby on Rails. It is best for agile web development.

I want to use Google Chart API to generate charts and using AJAX to make UI better. More details I will present in the application.

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

Programming skills, web development experience, communication skills and team work.

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

I love this game and I want to make contribution to this game. And also add new features on the stat report site.

Practical considerations

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

Sub­­version Yes

C++ Yes

Python No

build environments I used make for once or twice.

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

I use Xcode for C++/Objective-C project and Eclipse for Java project. For other, I usually use a text editor (eg. Emacs, TextMate) and terminal.

5.3) What programming languages are you fluent in?

C/C++, Java, Ruby, Objective-C, PHP

5.4) What spoken languages are you fluent in?

Chinese(native), English.

5.5) At what hours are you awake and when will you be able to be in IRC (please specify in UTC)

I am awake from 2:00~18:00 in UTC. I will be able to be in IRC about 8~10 hours during 2:00~18:00.

5.6) 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.

I don't mind.

Idea for the Project

Web Server

Ruby on Rails is used for implement the web server. Ruby on Rails is best for the agile web development. The MVC framework is perfect for the project. Each table in the database is a model, and we need some controllers to generate the statistic charts.

Ruby on Rails is also very convenient for AJAX. It makes AJAX very easy to write.

Performance is an important thing in this project. But most expense is from SQL queries in database. The web server only need to submit the queries and generate a Google Chart API URL. The performance of the queries will discuss later.

Data Processing and Chart Generation

I am planning to use Google Chart API to generate the statistic charts.

There are 2 ways to generate charts.

1. Pre-define some patterns to generate charts. E.g. the current stats.wesnoth.org is pre-defined. User can view charts generated by the patterns.

2. Build a framework that can let user to generate the charts they want to see. E.g. If a user want to see how many campaigns played in a specific day, he/she just need to submit a a pattern to the server. Then a chart is generated. The demo in additional info is an example for the framework. User can choose result/version/platform statistic information for all games or a specific campaign.

I will define some pattern for general statistic information and build the chart generation framework for creating custom charts.

Charts Details

The pre-define patters for charts has 3 component: general stats, campaign stats and unit stats.

General Stats

General Stats contains general game information of wesnoth.

  • Platform statistic - How many games played on Mac, Windows or Linux? Which campaign is the most popular on Mac version? (Pie charts)
  • Game play trends - How many games played each year/month/day/hour? (Line charts and/or bar charts)
  • Campaign trends - Which campaign is the most popular during a specific period of time? (Line charts and/or pie charts)
  • Version statistic - The distribution of game version (Pie charts)
  • Difficulty statistic - Which level of difficulty is most played? (Pie charts)
  • Result statistic - How many victories and defeats of each campaign/scenario? We can tell the difficulty of each campaign/scenario from this statistic. (Bar charts/pie charts)
  • User statistic - How many users play the game? (Line charts)

Campaign Stats

  • Turns statistic - The average turns for each scenario. (Bar charts)
  • Gold statistic - The average gold left for each scenario. (Bar charts) The average gold for each turn in a scenario. (Line charts)
  • Time statistic - Average time of each scenario. (Bar charts) The average time for each turn in a scenario. (Line charts)

Unit Stats

  • Special unit statistic (level and exp, Pie charts)
  • Unit count (Bar charts)
  • Unit upgrade trends. (Pie charts)

Implement Details

Ruby on Rails is a framework based on MVC. I will describe the implement details in models and controllers.

Models

Game, special units and units are models. Each game has many special units and units, each special unit and unit belongs to a game. Models maintain the data in the database and relationship between them.

Controllers

There are 2 controllers in the project. One is to generate the pre-define charts and the other is to generate a user-select charts.

Each pre-define pattern is corresponding to a unique action in the first controller. The parameter of the action can be a timestamp or a campaign/scenario name. Then the action makes a query and get data from database. A helper method is invoked after to generate a Google Charts API URL and display in the views.

The second controller has a create_chart action, a generate_chart action and a display_chart action. The create_chart action is for user to create a pattern to generate the chart he/she want to see. Then submit the pattern to the generate_chart action to generate the URL. The URL is displayed in the display_chart action.

User Interface

AJAX is used for improving the user interface. My demo shows a small AJAX example.

For the chart generation framework, a user friendly user interface is needed. The interface can let user select the information they want easily.

Performance

Since the database is very large. Aggregate tables are needed to maintain the data which is needed to generate statistic charts. When a new record is inserted, there is a program running on background which update the aggregate table. E.g. in order to generate a platform statistic chart, the aggregate table's schema is:

CREATE TABLE PLATFORM_INFO (campaign CHAR(30), apple INT, windows INT, unknown INT);

When a new game record is inserted, a program will update this table based on the record.

The background program is planned to implement in C.

This page was last edited on 21 March 2013, at 00:19.