Trader: Beyond the Frontier

I looked at my map and I saw that both Trasport Ships are working hard to earn money for me. I still remember time before I bought them and equipped with artificial intelligence device. I was flying myself from one system to another looking for the factories with warehouse full of finished goods which meant that their price was cheap. Then after loading as much as I could afford I searched this time for factories that used my wares as raw materials and at the moment they needed it desperately and were keen to pay expensive price for it.

That was my experience with the game X3: Reunion. It is a space simulator from the genre called 4X - an abbreviation of words: eXplore, eXpand, eXploit, and eXterminate. While playing it you are sitting in spaceship, flying here and there, docking on space stations and factories. You can buy, transport and sell stuff. You can shoot vicious aliens and space pirates. You can build Transport Ships or Military Ships and command them. And you can became pirate yourself.

I'm a huge fan of this franchise and it inspired me to create a game... wait, not game. Rather a toy application that is inspired by some economic aspects of X series. This project is called "Trader" and in it a user becomes an owner of a space factory. But he is not the only one. There are other factory owners who compete to buy cheap and sell expensive. Yeah, pure capitalism, baby!

From the programming point of view this will be Android application written in Java. I plan to experiment in it with multithreading - it means using different cores of processor to calculate data in parallel way in the same time. Also in my scope is to implement some technics of SQL - a database engine, to store information about current status of galaxy. It will be also a good opportunity to practice creating documentation like diiferent UML diagrams.

General rules of this application are:
  • one Trader can be owner of multiple factories but each factory can have only one owner,
  • factory requires raw materials to produce finished goods with one exception - energy plant is producing batteries from solar power so it doesn't require raw materials,
  • raw materials are transferred between factories by spaceships,
  • Traders must pay to spaceship for transport service but they are free to ask each ship for offer and choose the best one (cheapest offer or quickest transport),
  • spaceship uses batteries as gasoline and if it run below 25% of them it puts a priority on replenishing it (going to nearest energy plant and buying).
  • final product in production chain is spaceship itself so more spaceships in the galaxy means more trasnport options available and faster money earning.
  • factories and ships are setting prices by adding margin to standard cost,
  • margin is constantly changing because of few factors, for example how well the factory/ship is doing (income in last few minutes) and how desperately it needs to sell (small quantity of products is more expensive per one piece than big quantity).

I have already created GitHub repository for this project but at the moment it is still blank. I plan to first create some UML diagrams with rules and general structure of classes. Then I will write basic classes and test them. Last big milestone will be starting to play with multithreading and SQL.
The forementioned repository can be found on: https://github.com/Deacon2099/TradersInSpace

Comments

Popular Posts