Google Summer of Code/Proposals2010/Jiaming-Scenario

From Thousand Parsec Wiki

Jump to: navigation, search

Contents

Introduction

Abstract

In this wiki page, I propose a scenario and save-load support for Thousand Parsec clients.

Background

It is common that a single player game with AI clients or a multiple players game can last for hours. So sometimes the player may not be able to finish a game and want to save it somehow and load and continue to play the game later.

In addition, some player may find that it is boring and monotonic to always player the single game with AI clients in the same setup. They want something more interesting and challenging. For example, they start the game in a very disadvantageous position and then try to reverse the tide and defeat others in the end.

So it would be very nice to have the scenario support.


Task Specification

Primary goals

By adding this scenario support, we should enable players to:

  • Save a game into an external file. It would support both single-player game and multi-player game.
  • Load a saved game and continue to play it. If the game is previously played with an AI client, it should enable the player to continue to play this saved game with the same AI client, i.e. the AI client has the same parameter and load the current states of the game.
  • Load a pre-defined scenario. A scenario is basically just like a saved state of a game. In a scenario, the player would have some pre-defined amount of resources and fleets. The player needs to accomplish the defined goal in order to win.
  • Play campaigns, which is a series of related scenarios.


Following is some other requirement as specified in the Ideas for Programmers wiki page [1].

  • This feature should be designed in such a way that other clients and client libraries can use it in the future.
  • It should first make sure that the player has the necessary server, ruleset, and AI client(s) installed to play the scenario, and providing the easiest way possible to install them (download links, instructions, etc.) if they don't.

Bonus goals

  • Build Scenario Designer, which allows the user to design their own scenario in a intuitive way.


Implementation

This project will be tackled as in the following work flow.

File:Workflow.JPG

  • In the first step,I will implement serialization methods in the server side (tpserver-cpp). These serialization methods can be used to export the internal state of a game on the server to an persistent file (this file should be human readable), and also to import a file containing the states of a game into the server. In addition, I will also implement the serialization methods in currently existing AI clients(gencon and daneel-ai). Apart from these serialization methods, the existing protocol will be extended to support the transfer of data frames that containing save-load operations.
  • In the second step, I will add support for the extended protocol to the client library (libtpproto-py) and add necessary utility methods.
  • In the third step, I will add new methods to the client application (tpclient-pywx, as well as the single player wizard), and modify existing or create new UI components to allow user to access these new functionalities.


Detailed Project Schedule

Pre-stage: from now to May 24

In the past week, I have set up the development environment, taken a close look at the source code and read through the documentations and wiki pages on the website. Now I've got a clear picture of how the whole game works and I'm quite familiar with the client part applications such as tpclient-pywx,gencon-ai, single player wizard. (and I've submitted a patch that fixes a bug I found when I play around with the game)


In following weeks till May 24, I will do the following to boost my speed when I begin doing the project:

  • Continue to learn the project (especially the server side application).
  • Research on effective and efficient serialization methods.
  • Enhance my python programming skills.


Stage 1: from May 24 to July 11

  • First week (ends at May 30): Design a file format for saving states of a game running on the server. Add serialization support to the server (tpserver-cpp).
  • Second week (ends at June 6): Continue and finish last week's task. Start to design and implement serialization methods in AI clients (gencon-AI and daneel-AI).
  • Third week (ends at June 13): Finish the implementation of serialization methods in AI clients.
  • Fourth week (ends at June 20): Design the protocol to support the transfer of data frames that containing save-load operations. Implement this protocol on the server (tpserver-cpp) and implement utility methods that support this protocol.
  • Fifth week (ends at June 27): Add support to the new protocol in client side libraries, so that it can be used later by other applications.
  • Sixth week (ends at June 4): Add utility and UI support in client application (tpclient-pywx).
  • Seventh week (ends at June 11): Continue and complete last week's task. At the end of this week, players should be able to save a game on the server, and load it later to continue playing with it.


Stage 2: from July 12 to Aug 8

  • First week (ends at July 18): Add utility and UI support in the single player wizard application.
  • Second week (ends at July 25): Add campaign support to the single player mode application.
  • Third week (ends at Aug 1): Polish, test and document the whole project (Design and build the Scenario Designer if time permits.)
  • Fourth week (ends at Aug 8): Polish, test and document the whole project (Design and build the Scenario Designer if time permits.)


Post stage from Aug 9 to Aug 16

  • If possible, finish the Scenario Designer.


About me

  • My full name is Wang Jiaming (just call me Jiaming:))I am a Computer Science student studying at National University of Singapore [2]. I am now in my third year. I have strong basic programing skills which enable me to learn a new language very fast.
  • I am a outgoing person and can communicate with others quite well. I am very comfortable to work within a team. I like to experience and learn new things and I am very energetic.
  • I learned Python programming language in my Programming language course (which deals with parser, compiler, semantics, functional programming and so on).
  • I am confident in Java programming language. Java is taught in my home university as a basic tool, and I have done a lot of projects using Java for my courses in many areas, such as database, software engineering, artificial intelligence.
  • I am also good at C++. I was worked as an undergraduate researcher during my second year of study. I was in charge of developing the underlying utility libraries, which is responsible of doing some complex mathematical calculations, in C++ for a better performance.
  • I am also interested in another idea mentioned in the Ideas for Programmers wiki, which is to develop a cool 3D starmap to replace the current starmap. It will make this game much cooler and more interesting. If I still have time, I would like to do this project as well.

Note: I will get away for the Ester holidaies from 02 April to 10 April and I think I might not be able to go online for this period of time. So if you need any more information about my proposal, please free to email me at winfred1987REPLACE_THIS_WITH_ATgmail.com. I will check my mailbox as long as possible. Thank you!

Comments

Hi Jaiming, This proposal is an okay start but needs significantly more details. Questions I have for you:

I'm afraid your assumption is incorrect, neither the server nor the AI provide a way to save in-game state.

  • Thanks for your comments. Yes, it's not fully valid. What I mean here is that I should first make the assumptions valid. Since it's misleading, I have change this part.

We need a better timeline on how things are going to work. It should be a week-by-week with goals at the end of every week. 3 months goes really fast and we need something to keep you on track.

  • I have write down my detailed schedule. (It is based on my current understanding of the project. It might be subject to some future changes)

-- Mithro


You should have a look at the various components and how you could use or extend existing features to help you do this. Also think exactly what is actually needed to support this, perhaps start with what information is required in the file.

I also note that other than the user interface, your first stage has already been implemented. The server saves it's data into a database (in tpserver-cpp, a Persistence backend) as it runs. If the server shuts down, and restarted, the game continues. A user interface could use the Admin protocol to shut down the server.

  • Thanks for you comments. I skimed the codes of Persistence module from the server. It saves the states of a current game into a MySQL server and can be used to support the save-load functionality I proposed. However, it has two major problems to be used to support the senario part:

1. Currently this Persistence module doesn't support to write user defined data into the MySQL server - it can only save the states of a current game. 2. The save data file itself is not human readable, which may introduce some trouble to create a Scenario.

So now I have two alternatives: ether to extend the current Persistence module or to create a new light weighted module to support the scenario functionality.

I think I will take your recommendation to think about deeply what information is required in the file and what the existing modules can help me. Then I will make a better plan for it.

-- Lee 'llnz' Begg

Personal tools