Welcome to Unknown Horizons
During this year's Google Summer of Code I worked on a computer player (artificial intelligence) for Unknown Horizons. In this post I will give a quick overview of how it works from the player's perspective.
The first task of any player is to choose an island and found a settlement. The AI's primary motivator for choosing an island is the amount of available flat land but other factors such as the positions of existing settlements and available resource deposits are taken into account. The final choice is made randomly with a larger probability for choosing the better islands. This tends to make it more fun for the human and spread out the computer players. At this stage the AI also decides which part of the island it is going to be using for the village and which part for resource production.
Once the settlement has been founded, the AI starts building tents for the settlers. It will keep building more tents until the village area is full or it notices that it isn't producing enough of some resource. To satisfy the resource demands it uses the game's internal data to find out its estimated resource production capacity and the settlers' current resource usage along with the data about which building produces what. This is one of the parts where the AI has an advantage since the human player doesn't have direct access to it.
When the AI knows that it wants to build a specific building, it has to decide where to put it. For tents and village producers (pavilions, schools, taverns) this is decided when the settlement is first founded by dividing the village area into sections with one main square each and then trying to place as many tents as possible. The village producers then replace some tents to achieve maximum coverage. Most other buildings are placed without a prior plan by trying to put them into a sensible place. This depends on the exact building type but most of the time it is influenced by alignment (causes new buildings to be pulled towards existing boundaries) and distances to resource producers (weavers should be close to farms with pastures). Farms and lumberjacks are special because they must be right next to their input resource producers which is why field positions are decided when farms are built.
There are many reasons why the AI could choose to add storages. It could be trying to increase settlement storage capacity, extend the settlement area to some fixed position, enlarge area reachable by collectors, or improve collector coverage. The first three are relatively easy while the last one is a bit trickier. The chosen solution was to add better statistics about collector utilisation and production building capacity utilisation. The AI uses this information to find out the buildings that could most benefit from an extra storage and then places it in a badly serviced area.
Basically the AI is trying to play like a human player who wants to have as many settlers as possible and make them as happy as possible. We hope you enjoy playing with the new AI; it should be a lot more fun than just watching the pirate and trader move around.
Summer of Code results are here!
Heya!
Since our last posting is rather old already, we'll update with the big news today: during last week, both Summer of Code students working with UH finally merged their results into master. This means that you will see a combat system and AI players our next release!
Let's again summarize what gscai and mihaibivol created over the last few months (a plus as huge as 55% of the lines of code we had in April, according to ohloh, now at about 60k)! Within the next weeks, all our students will probably write a blog post on their own about how their summer went, we will link these postings here after they are published.
First of all, there's our artificial intelligence system (click here for the original proposal which we selected). gscai literally started with nothing but his mentor nihathrael and the code that drove our free trader around the map and created a tough player that is able to look for a nice island to settle on, divide that islands into parts with different purposes, deal with inhabitant needs and taxing, produce goods, optimize collector coverage, watch production chains and consumption stats, react accordingly, buy and sell resources as needed, deal with other players, expand through feeder islands where more resources are cultivated and then shipped to the main island by trade routes, conform to several hundreds of personality constraints where you can tell the AI how to behave in an intuitive file format, well, I will only stop now because this sentence needs a period at some point, but really: the only thing that it does not know about right now is combat -- because this had been worked on during the same time in a different branch :)
As a player, the important news is that you can select a number of AI players when starting a singleplayer game. Oh, and you will need to be quick, else they will take all cool islands and only leave you a very small patch of ground to settle on. All this is achieved without any cheating by the way, our AI gets the same starting resources as any human player, has the same building pool and uses the same balancing values!
On to our second huge and brand new feature: War! Cannons! Destruction! Aww, sorry, still like it? mihaibivol, mentored by totycro, implemented his combat system proposal which, amongst others, included the classes FightingShip and FightingGroundUnit; unit stances such as aggressive, hold ground or flee; combat based on individual weapons which are equipped to units; cannon tower as defense building; design of tabs for single units and unit groups; a diplomacy system that currently knows Friend, Neutral, Foe and behaves accordingly if you deliberately attack units of players not your enemy before; and finally a lot of calculations under the hood when it comes to damage dealing.
As a player, you will also see new graphical content such as the cannon tower, our awesome new ship model, the attacking tool cursor, new tabs, icons for stances and so forth. We currently work on a dynamic boat builder that actually allows you to build ships with cannons and will definitely include this in our next release!
As you might remember, kozmo was selected to improve our engine FIFE with both vtchill and prock as his mentors and the results of his reconditioning are just great! Only a few of the many improvements available for FIFE 0.3.3 are: support for atlas files, animation spritesheets, batching and the experimental OpenGLe renderer (check his application proposal here).
Just to give some numbers, FPS on average improved by 200 % and the atlas files also reduced the disk space consumed by our assets from around 30 MiB to 10 MiB. Additionally, kozmo kept a branch in our repository up-to-date with these FIFE API changes and has as well merged all new UH stuff in already. This helps us hunting bugs while keeping our master stable for you.
After the new FIFE release in roughly four weeks, we will do our best to quickly follow up with packaging all those new features into Unknown Horizons 2011.3. Stay tuned :-)
Unknown Horizons combat branch test
$ git pull origin combat
If you have already cloned the repo get the combat branch by:
$ git checkout -b combat
Summer of Code: Accepted proposals announced
Hey everybody!
We are proud to announce that Unknown Horizons, together with FIFE, is able to mentor three full-time students this summer, funded by Google to work on Open Source projects!
In particular, we chose these students:
- Mihai Bivol – Combat System for Unknown Horizons
- Ott Tinn (gscai) – AI player for Unknown Horizons
- Kozmo – Improve the overall performance of FIFE
The teams of Unknown Horizons and FIFE are sure that we will see an awesome amount of progress this summer and we really hope that even some of the students we could not accept still stick with us. Thanks for your application everybody!
Of course we also need to thank Google and especially Carol Smith for providing this wonderful experience to so many students and organizations! A last Thank you to the SoC-experienced folks at Battle for Wesnoth that helped us getting started and staying in the loop. You're all awesome!
GSoC Applications Closed
Hi everyone,
the application period for google summer of code is closed now. We are happy to announce that we received a total of 32 applications! That's an overwhelming number of applications. Thank you all for your interest in Unknown Horizons.
The wiki user pages are locked now and we will not be accepting any further applications. Applications which are missing any required and important data will be rejected.
Next Steps
The wiki pages are locked now, to allow no further edits. They will be released by the end of April. We will now be taking a close look at the applications, which will obviously take some time. The next deadline set by google is April 25th, by which you will know about acceptance or rejection. We might be requesting some further information from students as well as talk to them on IRC about their proposals. If you applied, please try to be available on IRC as much as possible.
Release 2011.1
Since we feel we are not yet busy enough with GSoC we are trying to get our next release 2011.1 out in the wild. We just fixed the last important bug and we'll start packaging the release soon. So stay tuned for more!
Cheers and stay tuned for more!
Your Unknown Horizons Team
Summer of Code: Student applications possible
Heya,
I figured to write this entry since the application period opens in some minutes.
When submitting your application, please include links to the wiki page where you introduce yourself and, if you managed to create it, a link to your proposal page. We will lock both after the application deadline April 8th to ensure equal opportunities, so please prepare them early. No deadline extension will be granted, not even if occurring errors are our fault.
The application should furthermore contain any additional documents you want to share non-publicly and preferably your filled private template. Since sharing ideas is fundamental to Open Source, we reserve the right to downvote your application if you did not include them in your public template. You will of course still get better votes than with no additional information at all ;-)
So let's again mention the important part: Even if you submit your application early (at Google), you can still improve it (in our wiki and at Google) until the deadline. Our rating team can also hint you at possible flaws then. If you do not submit it in time, no high-quality wiki page can help you.
We are still discussing the exact procedure after the deadline, but it will likely include a (short) interview on IRC and a test commit to our github repository. Rating is done by all interested team members and your mentors.
See you on IRC and melange,
your team of Unknown Horizons
Summer of Code: First impressions
Hey everybody,
we are almost overwhelmed by the large amount of students interested in our organization. Thanks so much for spending your time with us! It is an awesome feeling to see how many of you got to know us and like us - Unknown Horizons will definitely benefit from this summer. Let's get started!
The application period for the Summer of Code has not yet officially begun and we already received more than a dozen great applications. Sure, that feels very good at first glance, but sadly there is a massive drawback as well :-/ Unknown Horizons is a rather small mentoring organization. We definitely can not accept everybody, so we will have to reject a lot of impressive work which we would love to see hammered at. Of course we can always help you if you decide to stay around with our team despite our small mentoring capabilities!
If you have the time to do so, please do not only focus on UH if you really want to make it into the program. We need to disappoint a lot of you :-( At least have a backup application somewhere with less competition. It is however very important to still show enthusiasm for both (or all) projects when writing more than one application!
We do not know how many slots Google allocates to us (Learn how this works) - but because we received so many great applications, we decided to be fair about your chances on each idea right away.
We will accept one student for FIFE and one for GUI. This leaves us with two mentors (totycro & Nihathrael) and four possible UH ideas. Reducing mentoring quality and allocating more than one project per mentor is a bad idea for our first year, so two of the remaining four ideas will probably not be accepted at all. Despite how useful and fun working on them might be for both student and organization.
Right now, we see no way but to review applications in the end and decide on the best proposal, then continue this without all proposals made for the selected idea. We however have mentor meetings left to discuss our policy concerning this, please do not take us up on this news entry. Just trying to keep competition as fair as we can do.
Update: The above does not hold any longer. We decided on a different strategy.
Attention with our AI idea! You will have a mentor to answer all questions concerning UH. We however lack an experienced AI coder - which is why we haven't implemented AI on our own so far ;-) - and thus need someone with rather strong AI background to apply for this idea. If you feel a bit uncomfortable with not having a mentor to discuss the actual AI implementation, you're probably better off with another idea. Please accept our apologies.
Again: We are so sorry for all the rejects we will need to announce. Do not feel less of a student or coder - you are not. Let's close with how totycro expressed this situation in our IRC channel:
i mean, i probably wouldn't be accepted in a competition, i don't really have that much fancy stuff to show. nevertheless i wrote quite a part of the current code base, and most of it actually works ;)
Kind regards and all the best,
your team of Unknown Horizons!
We were accepted for the Summer of Code!
Heya everybody!
Really good news today for everybody interested in our Summer of Code efforts:
Unknown Horizons was accepted as a mentoring organization by Google today!
GSoC in a very small nutshell: Google grants stipends to students that work with open source organizations. This helps the projects (new developers, code and ideas) as well as the students (prepare for employment, enjoy FOSS environment) and is a great opportunity!
If you are interested in working with us this summer, make sure to
- check out our ideas page
- join us on IRC to get to know our team and further discuss your idea
- start early, applications close at April 8th
After you have outlined a first basic concept and discussed it with the would-be mentors, you will create a user page in our wiki where you explain it in detail. Together we will then polish it where possible.
This of course means that applications reaching us very late are a tough act to follow, you certainly have better chances of being accepted by us if we already know you a little ;-)
We want to also mention that our application was only possible with the help of the Wesnoth team. Thanks so much for your valuable support!
Kind regards and looking forward to your application!
Next page: The idea of Unknown Horizons


