31 10
Sign in to rate

AnkiStrategy

0.01MB. Updated 2013-10-23. Only supports Anki 2.0.

Description

AnkiStrategy 0.1 A simple strategy game for Anki. Some of you may know AnkiEmperor and AnkiWarrior, two simple games in which you try to conquer a country, getting a score according to how many cards you review in Anki. I found them interesting, but too simple. In fact, they are not games, they are just fancy progress bars. Instead of a simple number running from 0% to 100%, you progress is counted in terms of cities, inhabitants and monuments. Yet, they lack competition, you can make virtually no strategical choice and you lose nothing if you don't keep pace with your flashcards. AnkiStrategy tries to improve his predecessors in the following ways: 1- It has competition: you compete with computer-controlled players to conquer cities. 2- It is also a strategy game: you have to make strategical decisions on how to use the energy you get from your work (although admittedly this is still very basic in this release). 3- Most important thing for its motivation purpose: if you are sloppy in your repetitions you will go backward. RULES: REAL WORLD RULES: You decide the amount of cards you plain to review each day. In each turn you get a virtue proportional to the square root of the portion of work you do. For example if you set a 100 cards/day target and you study 10 cards, next day you will have a 31.7% virtue. If you study 200 cards, you will get a 141% virtue. I have chosen the square root because this way you are encouraged do every day at least a part of your target (if one day you have had no time, study just 1 card and this will give you a 10% virtue). Conversely, if you do more that you planned, you are rewarded, but not too much: you are better follow your plains or reconsider them. If you change your target, the new value will become effective only next day. Thus, you can't procrastinate. You virtue affects the ability of your player to influence the game world. Furthermore, if you do at least 95% of your work for 1 week you'll get an ambassador. Computer-controlled players receive on average the same virtue you get if you do 95% of your work. Hence, if you work diligently, you will have an edge on them. GAME WORLD RULES: The game is turn-based, with one turn for each real world day. Every day you can press "Next turn" to process the daily turn. If you don't use Anki for some days you can press it more times to play all the previous turns. The inhabitants of each city are divided into factions supporting a player, some are neutral. Each turn 10% of the people in each faction (20% of the neutral citizens) becomes undecided and are convinced to join some other factions depending on player's clouts. The clout of a player in each city depends on several parameters: 1- If he has already got supporters in that city, they will try to convince other people. 2- If he is part of the city government, he can use his power to convince other inhabitants. 3- If he is in the city he can campaign for himself. He can also send an ambassador to campaign for him. The zeal of your supporters, your governments, your player and your ambassadors are all proportional to the virtue you got in the previous real world day. Each turn part of the population relocates to other cities, spreading the factions. You rank will increase from peasant to emperor, as you join the government of more cities. AnkiStrategy is still very simple, but, if it raises some interest, I may spend some time to improve it. I encourage you to report bugs (including mistakes in my English, note that I'm not a mother tongue speaker), and propose improvements.

Download

The add-on author has not uploaded a version of this add-on compatible with Anki 2.1. Old add-ons for Anki 2.0 can be downloaded from the archive.

All Anki 2.1.x Add-Ons

Reviews

on 1585107522
please update for new version!
on 1583211221
I would really like to try this one. By any chance, team can fix this for the newer version?
on 1583008227
Great work, I agree that it's definitely the best game add-on.

Any chance it might be updated to work with Anki 2.1? I really miss it!!
on 1564700847
It is the best game add-on, for me at least, but it no longer works with the latest Anki update.
on 1549579591
Does not work, blank screen
on 1546022816
It isn't working, I was really excited to play the game :(
on 1533702258
sadly not working
on 1522195200
I imagine an excellent game however with the new update post below, I get this upon opening Anki:

"An error occurred in an add-on.
Please post on the add-on forum:
https://anki.tenderapp.com/discussions/add-ons

Traceback (most recent call last):
File "aqt/addons.pyc", line 41, in loadAddons
File "/Users/seandonaghue/Library/Application Support/Anki2/addons/AnkiStrategy.py", line 8, in <module>
File "/Users/seandonaghue/Library/Application Support/Anki2/addons/ankistrategy/ankistrategymain.py", line 12, in <module>
File "/Users/seandonaghue/Library/Application Support/Anki2/addons/ankistrategy/game.py", line 31
i = int(f)
^
IndentationError: expected an indented block"
on 1518393600
It's great
on 1513555200
We fixed the code for MAC users who want to add city names and AI names. Replace your game.py file with this:

#-*- coding: UTF-8 -*-
#This file is part of AnkiStrategy. Copyright: 2013 <tcp-ip_80@libero.it>
#License: GNU AGPL, version 3 or later.
#This program is intended to be an add-on for Anki 2,
#note that Anki is copyrighted by Damien Elmes, who releases it under the same licence.
#You should have received a copy of the AGPL along with Anki. If not, see http://www.gnu.org/licenses/agpl.html
import random, datetime
#world generation constants
NPLAYERS = 10
NCITIES = 30
BIGGESTCITYSIZE = 3000000
WORLDSIZE = (1000, 600)
#game parameters
PEOPLECHANGINGOPINION = .10
PLAYERCLOUT = 1000
AMBASSADORCLOUT = 500
EXCHANGERATE = 10**-2#2 1 million inhabitants cities 1000Km away exchange 1% of their population
CITYGOVERNMENTPOWER = .02
MAXEXCHANGERATE = .02# A city can't exchange more that this portion of inhabitants per turn
RETURNTONEUTRALRATE = .1
AMBASSADORLIFE = 90#days
#interface
HONORIFICS = ['Peasant', 'Baron', 'Viscount', 'Count', 'Marquis', 'Duke', 'Prince', 'King', 'Emperor']
COLORS = [(255, 255, 255), (0, 0, 0),#[0]=background color and [1]=neutral color
(0, 255, 0), (255, 0, 0), (0, 0, 255), (200, 200, 0), (255,0 ,255), (0, 255, 255),
(127, 255, 0), (255, 127, 0), (0, 127, 255), (200, 200, 127), (255, 127 ,255), (127, 255, 255)]
AINAMES = ['John Howard','George W. Bush','Francisco Pizarro','Mahmud of Ghazni','Napoleon Bonaparte','Adolf Hitler','Attila the Hun','Cyrus The Great','Tamerlane','Alexander The Great','Genghis Khan'];
CITYNAMES = ['Moscow','Berlin','Ankara','Paris','London','Rome','Kiev','Madrid','Warsaw','Bucharest','Amsterdam','Astana','Athens','Brussels','Lisbon','Prague','Budapest','Stockholm','Vienna','Sofia','Copenhagen','Helsinki','Oslo','Dublin','Sarajevo','Luxembourg','Reykjavik','Monaco','San Marino','Vatican City']

def randomRounding(f):
i = int(f)
r = f-i
if random.random()<r:
i += 1
return i


class Player(object):
def evalBestTargetCity(self, world):
'AI evaluation function to find the best target'
strongerEnemy = max([(world.players[x].rank, world.players[x].id) for x in world.players])
values = {}
for i in world.cities:
if self.id in world.cities[i].factions and world.cities[i].factions[self.id]>.5*world.cities[i].size:
value = 0
else:
value = world.cities[i].factions.get(self.id, 0)/float(world.cities[i].size)
if strongerEnemy[1] in world.cities[i].government:
value += strongerEnemy[0]
values[i] = value
bestTargets = [x for x in values if values[x] == max(values.values())]
return random.choice(bestTargets)


def ai(self, world, question):
if question == 'location':
return self.evalBestTargetCity(world)
elif question == 'assignAmbassador':
return self.evalBestTargetCity(world)
else:
raise

def askIntelligence(self, world, question):
assert self.isAI
return self.ai(world, question)


def __init__(self, playerId, name, color):
self.isAI = True
self.id = playerId
self.name = name
self.color = color
self.rank = 0
self.location = None#a city
self.virtues = []#list of virtues in all previous turns


class City(object):
def localFactionChanges(self):
'Exchange of citizens within a city'
#The clout of each player in each city is calculated according to his virtue in this turn and other parameters:
clout = {}
#presence: 1000*virtue if the player is in the city, 500*virtue for each ambassador in the city.
#Some citizens turns back to neutral.
for i in self.playersInCity:
clout[i.id] = clout.get(i.id, 0)+PLAYERCLOUT*i.
on 1513036800
COOOOL
on 1511222400
I'm using Anki 2.0.48 but this addon only give me blank screen...
on 1511049600
Great great idea. As some have already said, you should name the cities and players (my opinion? create the names yoursel)
Thanks, buddy, i'll be following this link
on 1509667200
add flavor: How To

I like the addon, would appreciate to see continued development indeed!
To add to the previous comment, in game.py replace this function to get some nicer city names:

def startGame(self, source):
self.playerNames = ['Human','Franklin D. Roosevelt','Napoleon Bonaparte','Adolf Hitler','Attila the Hun','Alexander The Great','Genghis Khan', 'Winston Churchill', 'Julius Caesar', 'George Washington', 'Abraham Lincoln']
self.cityNames = ["Moscow","London","Berlin","Madrid","Rome","Kiev","Paris","Bucharest","Budapest","Minsk","Warsaw","Vienna","Copenhagen","Prague","Sofia","Belgrade","Podgorica","Riga","Zagreb","Athens","Amsterdam","Stockholm","Chisinau","Lisbon","Vilnius","Dublin","Helsinki","Sarajevo","Oslo","Bratislava","Skopje","Tallinn","Ljubljana","Tirana","Nicosia","Brussels","Bern","Reykjavik","Luxembourg","Monaco","Andorra la Vella","Nuuk","Valletta","Vaduz","San Marino","Vatican City"]
self.turn = 0
self.turnLog = []
#initializing players
self.players[1] = Player(1, 'Human', COLORS[2])
self.players[1].isAI = False
for i in range(2, NPLAYERS+1):
self.players[i] = Player(i, self.playerNames[i], COLORS[i+1])
#initializing world
if type(source) == int:#random cities
r = random.Random()
r.seed(source)
usedCoordinates = set()
for i in range(NCITIES):
coordinates = (r.randint(int(WORLDSIZE[0]*.05), int(WORLDSIZE[0]*.95)), r.randint(int(WORLDSIZE[1]*.05), int(WORLDSIZE[1]*.95)))
while coordinates in usedCoordinates:
coordinates = (r.randint(0, WORLDSIZE[0]-1), r.randint(0, WORLDSIZE[1]-1))
self.cities[self.cityNames[i]] = City(self, coordinates, self.cityNames[i], BIGGESTCITYSIZE/(i+1))
usedCoordinates.add(coordinates)
self.calcCityExchangeRate()
self.WORLDSIZE = WORLDSIZE
else:
raise#TODO (future release) load map from file
#positioning players
for i in self.players:
if not self.players[i].isAI: continue
location = self.players[i].askIntelligence(self, 'location')
self.players[i].location = self.cities[location]
self.cities[location].playersInCity.append(self.players[i])
on 1505088000
on 1504051200
on 1501027200
on 1496188800
on 1492560000
on 1488931200
Add flavor

To make it a bit less bland, insert lines like these where appropriate in the game.py file:

AIList=['.','George W. Bush','Francisco Pizarro','Mahmud of Ghazni','Napoleon Bonaparte','Adolf Hitler','Attila the Hun','Cyrus The Great','Tamerlane','Alexander The Great','Genghis Khan']

CityList=['Moscow','Berlin','Ankara','Paris','London','Rome','Kiev','Madrid','Warsaw','Bucharest','Amsterdam','Astana','Athens','Brussels','Lisbon','Prague','Budapest','Stockholm','Vienna','Sofia','Copenhagen','Helsinki','Oslo','Dublin','Sarajevo','Luxembourg','Reykjavik','Monaco','San Marino','Vatican City']
on 1476835200
on 1466726400
Great concept

I think this is a great idea, any progress on getting a mac version to work?
on 1463184000
on 1453680000
Fun side activity while studying

I like this game, even though I am also waiting for some improvements :)

First of all, this only runs on a PC and not a Mac. I hope this will become available some time in the future!

As for the game itself, it would be great if you could add the date for the current turn. I was getting confused on which turn I was ending. Maybe also an overview on how many cards you finished in a certain turn.

Then also I am wondering if there would be a possibility for the game to choose your card goal? I have several decks that I review every day. Sometimes I review less than my goal because there are not enough cards due. On other days, I review more than my goal. Then the game would get too easy, right? Just a few thoughts.

Thanks so much!
on 1452902400
on 1452470400
on 1447459200
Awesome! New game option?

Love the concept. It's been awhile since I've played a text-based game, so the UI simplicity is great. Excited to see if there are any future game updates!

One question I have is how to start a new game (perhaps a future update if it's not already integrated into the game?). I added this on awhile ago out of curiosity and then didn't touch Anki for about 2 weeks as I was on break. And now that I'm back at school, it would be great if I was able to start a new game as after 2 weeks of no reviews, I'm put quite behind in the game.

Anyways, thanks again to the developer!
on 1434412800
on 1433635200
Waiting for improvements

Thank you for that awesome addon! I'm looking forward to seeing improvements in the future ;-)
on 1429833600
Great idea, keeps me motivated

Honestly more signed on to thank the developer than anything. The game is beyond simple but I think that's appropriate for a game that exists to motivate studying. Often, the desire not to get 0 virtue is the reason I decide not to skip studying. So, thanks developer guy. This is awesome!
on 1423094400
on 1421366400
Absolutely fantastic

I freaking love this game - it is literally my biggest incentive to do my anki reps every day. I support this 100% and I would love to see it added on to in whatever way possible. Thank you for taking the time to create this!
on 1420156800
looks promising

I've tried it so far and I like it
on 1419724800
on 1397260800
Caused Error in Anki, Now I can't load my profile.

I am running Anki an OSX 10.8.5. I have deleted AnkiStrategy and reinstalled Anki and I still can't load my profile.
on 1395014400
on 1392595200
Yes! Really promising!!

Please make an update to develop this. Awesome!! Keeps really motivating.
on 1389571200
Perfect idea

please improve this add-on
on 1386460800
So much potential, but currently little better than nothing

To fulfill potential

NAME THE PLAYERS! or at least allow user to do so

NAME THE CITIES! or at least allow user to do so

Place a real world map on the map screen, or facilitate the user to upload a picture and reposition cities

If you were to make this work; you'd be my hero!
on 1384560000
Looks promising

Pretty redimentary so far, but still motivates me more than the Anki statistics. Looking forward to future developments!
on 1383696000