www.nationstates.net

30 October 2008

Two Small Enhancements

A few months ago, I mentioned that New South Hell (whose name's probably going to be popping up more and more often on this blog) had suggested a whole bunch of descriptors to me that could go on the nation's spotlight page. Tired of being told for the thousandth time that your nation is remarkable for its compulsory vegetarianism? Or military conscription? Well now there's a whole bunch more to make things just that little bit more varied.

The second enhancement is one I devised myself. Right now NationStates 1 has nations upwards of ten billion, but have always been described as 'massive' since they hit the one billion population mark. I thought it was high time we changed these population size descriptors to be a bit more fitting, and more interesting for long-time players. The ranges have been redefined and some more have been added. I hope everyone approves!

Kudos goes to [violet] who implemented these features into the game for me.

In other news, the site's gone down a few times and there's been a bit of a glitch affecting issues, with horrendous error messages appearing where the issues should be. Don't worry, we'll have it fixed soon, so there's no need to beleaguer us with frantic cries of 'my nation's not working!'

The official thread for this problem is here.

26 October 2008

Issue Repetition Analysis

New South Hell has written up an article for the blog about his studies of how often daily issues in NationStates 1 repeat. Interesting reading!

---

If there are images in this attachment, they will not be displayed. Download the original attachment

I would like to thank Sirocco for allowing me to post this writeup in his blog. It is a study of the phenomenon of issue repetition in NationStates – how it behaves, what we can deduce about the implementation from that behavior, and ways in which this behavior could be made less annoying.

Every NationStates player who pays any attention to issues becomes aware that they repeat. It doesn’t matter that you’ve stated emphatically that you’ll be having none of that cannibalism in your nation, sooner or later, you’ll be asked again. Let me note right here at the start that this behavior is unavoidable, since players would be somewhat peeved if NationStates were to tell them “I have no new issues for you; try again tomorrow.” Nations can answer issues at the rate of two a day, so new ones would have to be created at a rate of more than two a day to keep from running out. And I don’t imagine we’re going to see that happening in a free game with volunteer staffing.

People regularly post complaints to the Forums about issue repetition, usually along the lines of “I told it not to ban Harry Potter, but it keeps bugging me about it anyway. Why won’t it ask me about something interesting?” Which leads to the question, is it really that bad? Does issue selection actually get into ruts, or is this just a delusion commonly affecting NationStates players.

To answer this question, you need data from a lot of NationStates nations. And, as it turns out, I am a lot of NationStates nations. To be more specific and slightly more accurate, I play almost 100 nations, and keep records of all the issues I’m asked and the choices I’ve made. (I hear a significant fraction of the audience gasping “Clearly, this is someone with no life!” Could be. But if I didn’t keep busy with NationStates, I’d probably be out spraypainting trains.) I didn’t take things this far when I first started playing NationStates – and I have complete records for only about 50 of my nations. The rest of this writeup is based on those 50. The longest-lived of those nations has responded to issues over 300 times, but 150 issues is more representative. The nations represent a wide variety of government types and issue-answering styles.

(For those interested, I wrote a program which I refer to as “my Python assistant” (MPA) for keeping these records. This makes the labor much less intensive than if I were forced to use manually-updated files or (gasp!) pencil and paper for the task.)

Based on data from these nations, I outline the national life-cycle as consisting of 4 stages. (There could be more of course. Maybe at issue 500 things become very different. I wouldn’t know because none of my nations has been around that long. But I’ve found no hints in forums, blogs, etc. of any such phenomenon.)

1. Stage 1 lasts for one issue. You are asked what kind of elections your nation has (issue 0). But for a short period, there was a bug in NationStates that caused other issues to be asked as the first. This turned out to be rather revealing. More on this below.
2. Stage 2 lasts until issue 20. You are asked issues from the set numbered from 0 to 30, the ones originally contributed by Max Barry. You may be asked issue 0 a second time, but otherwise there is no repetition. Occasionally, stage 2 may appear to last one or two issues longer. I believe in such cases that in fact Stage 3 has begun, but by chance issues from the original set are chosen a time or two more.
3. Stage 3 lasts a while, for at least 80 issues. I believe that no issue is absolutely excluded from this period, though there are a few which require a certain population, and which therefore would require you to go into vacation mode in order to grow enough to be asked them. (Also, I have never been asked an Easter egg, so I have no idea whether it is possible for them to turn up at this stage.) This stage ends when an issue other than issue 0 repeats (or, I believe, when issue 0 repeats for a second time, though I’ve never observed such a case). In my data, on the average, 133 issues have been asked before the first repeat. The lowest number of issues I have seen before this repeat is 108, the largest, 157.
4. After the first repeat, there will be more. Up to this point, except for issue 0, you have never been asked a duplicate. Now, all issues, including the one you answered yesterday, are possible. Sometimes, there will be a flood of repeats after the first one, and sometimes you will be asked mostly new issues for a while more, with the frequency of repeats gradually increasing.

As I noted above, there is an upper bound on the number of issues you can be asked. Further, many issues apply only to certain circumstances. You won’t be asked if you want to rescind the ban on computers if you haven’t banned computers. There are presently 232 issues. But the most any one of my nations has been asked is 164. And a different nation of comparable age has only been asked 125. I conjecture that 160 is about the maximum number of issues that apply to any one nation at a specific time. The nation with 164 issues is Eternal Repentance, a nation which answers issues using the strategy of changing its mind. This allows it to be, depending on its recent moods, asked democracy-only or dictatorship-only questions, which permits its total to surpass those of nations foolish enough to stick to one or the other. No matter how long I play Eternal Repentance, it still isn’t going to be asked everything. For instance, I know of a few issues which are only asked of certain extremist government types. Eternal Repentance is never going to have one of those governments, because they require one to persevere in answering a certain way (e.g., totally pro-capitalist), and Eternal Repentance will never betray its lack of principles in that fashion.

Can you be asked the same issue over and over again? Absolutely. My nation SQ (not its real name) was asked about eating its national animal three times in six days, two of the three times on consecutive days. So it does happen. But though this is annoying, is it surprising? To answer that question, it is helpful to have a model of what the implementation is doing. And so now I’m going to try to put together a fragmentary model from the evidence.

First of all, I have no doubts about the existence of Stages 1 and 2. They’re documented on the Forums. But why do I say there’s a difference between Stage 3 and Stage 4? An easier model would be this. After Stage 2 completes, NationStates selects an issue at random each turn. Because most issues have not been seen before, this means you get new issues for a while, but then, by chance, an old one is picked. This simpler hypothesis is ruled out by the evidence. If it were so, issues would repeat much sooner than issue 108 – because of a phenomenon known as the Birthday Paradox. (See http://en.wikipedia.org/wiki/Birthday_paradox for a mathematical description of the paradox.) If one assumes that all 232 issues are equally likely, there would be a 50 % probability of a repetition within 19 issues. If one assumes the more likely number of 160, the chances of repetition are even after only 16 issues. This clearly contradicts the data I’ve gathered.

My conclusion then is that the game goes out of its way, during Stage 3, to keep from asking an issue a second time (except for issue 0, which I’ll get to before the end). Now, an interesting thing I’ve observed is that periodically someone will ask on the Forums for a feature that depends on the game remembering what you’ve been asked, in what order, and how you answered it. The official response to this is always the same: it would take too much storage, given that there are 75,000 nations to consider. I don’t doubt that this answer is true, but it tends to obscure the fact that the game must be keeping track of what issues have been asked, up to a certain point, and that point must allow for retention of at least 140 issues or so, to fit my data. It turns out, however, that to keep track for all 232 issues of whether they’ve been asked requires only 232 bits, which is 29 bytes. This is not a lot of storage, even if it does become over 2 megabytes when multiplied by 75,000 nations.

So now here is a revised model for the NationStates implementation. It keeps track of whether or not each issue has been asked. After 100 or so distinct issues have been asked, it starts to allow issues to repeat. A developer comment on the NS2 Forums suggests that in NS1 the odds may be deliberately enhanced for unseen issues as opposed to repeats, and there is some anecdotal evidence suggesting this, but without more detailed knowledge of what issues are allowed when, it is impossible for me to test. So I don’t try to model exactly how the game decides when to repeat its first issue. Perhaps it occurs when the number of unseen applicable issues drops below a certain threshold. At any rate, once repeats are allowed, they come to dominate – and once they have started, no consideration is given to whether an issue has been asked recently before asking it again.

Now let me go back to the question of issue 0. As I noted, there was a period where, for some reason, your first issue might have been something else. One of my nations got issue 222 (terrorist attack) as its first. This nation observed that issue 0 did not repeat early on, but issue 222 did. In other words, the issue that can repeat early is the first issue, and the phenomenon has nothing to do with issue 0 specifically. I have a model for this too. The first issue is special. It is queued up at nation creation, not, as with all other issues, added during the game’s twice-daily cycle through the NationStates world. I hypothesize that, by design or by accident, this issue is queued in a way that causes it not to be recorded as having been asked. Thus, it would remain to the game as an unseen issue, one which can be asked again despite all the effort to prevent such a thing. This is a testable hypothesis – it leads me to predict that issue 0 will never repeat twice in the first 100 issues. If anyone sees that, or has seen it, then I am wrong.

I am going to end this post with a discussion of the effects of issue repetition, and an idea or two for ameliorating them. For all that it is understandable, issue repetition is just plain annoying. I have seen Sirocco himself express frustration at the repetition of daily rankings, which occurs for the same reason as issue repetition. We’d all rather answer something we haven’t seen in a while than be stuck in a rut saying “No, I already told you, no Inquisition, and that’s final!” There are hints that even the maintainers of the code are somewhat aware of this. When I’ve been too busy to play and let issues back up for a nation, I’ve never seen the same issue twice in the pending list. Maybe someone else has but, if not, it means that someone put in a check to prevent it. Similarly, if you answer the same issue in the same way very soon after a previous time, only one of the answers shows up in the prose national summary, leading me to believe again that someone put in a check for this which skips over the duplicate. (It does show up twice in the regional history however.)

There is another more serious effect of issue repetition on the game, however. It produces more extreme, one-sided nations. For instance, the easiest way to show up very high on the “Nudest Nations” ranking is to be lucky enough to be asked the “right to dangle” question repeatedly, and to always respond with option 2, making nudity mandatory. This is how “Penultimate Option” (not my nation this time) got to be tenth most nude in the world. It’s not hard work and perseverance that pay off, it’s being asked the right question the right number of times! If you take NationStates seriously (or want to take it seriously) as a nation simulator, then you want the growth and development of your nation to be organic and gradual, rather than a byproduct of the sequence in which issues happen to be presented. I note that complete sequence dependence is unavoidable, due to questions with abrupt and discontinuous consequences, like switching from democracy to dictatorship or cutting off military funding. Still, I think that the unconstrained issue repetition in NationStates is a real blemish, as it interferes with your ability to set your nation’s course.

Of course, unlike most players, I have my Python assistant. I use it to help me navigate through repeated issues. It lets me know when an issue is a repeat and, under two sets of circumstances, it advises me to dismiss (and I almost always take its advice). First, it advises me to dismiss if an issue is repeated within ten turns of my previously answering (not dismissing) it. In this case, the repetition will show up in the nation’s event log unless I dismiss. This seems to me a bad thing. If issues are going to repeat, they should at least have the decency to do so out of sight. Secondly, it advises me to dismiss if the issue has been seen (dismissed or not) within the last 60 turns. The number 60 is half of 120, which I believed at the time I wrote that part of the code to be the lower bound on the point at which repetitions start. The intent was that I could divide issue space into two halves, the recent half and the distant half, and respond only to issues from the distant half. I admit that I have a few nations which I want to become extreme, and for those, I only dismiss for the first criterion (repeat within 10 turns).

Naturally, my assistant keeps records of all this as well. And it tells me that, on the average, 4 % of the issues asked in Stage 4 are 10-turn repeats. That’s pretty much what you’d expect if the process is really random. On the other hand, on the average 26 % of all issues are 60-turn repeats, and for some individual nations, this rises as high as 52 %. So, thanks to my assistant, I end up dismissing between a quarter and a half of the issues that are asked me, simply on the basis that they’ve been asked again too soon. But my reward is that my nations grow more naturally, even though their growth is slowed by the dismissals.

I feel strongly that NationStates ought to be changed to eliminate 10-turn repeats. This would take 10 bytes of storage per nation (or 20 to be ready for issues with numbers greater than 255). This cleans up the national history, and makes repetition invisible to players with short memories.

I feel that going further and establishing a longer limit on repeats would also be a good thing, simply because of the resulting improvement of the simulation. Let me sketch an implementation – assuming I’m right about the use of a 30-byte bit map for the record of what issues have been asked, this implementation gets by with adding only one more bit per issue, for 60 bytes rather than 30. The values 0 to 3 can be encoded in 2 bits. The idea is that you have three periods, distant (1), recent (2) and current (3), and that 0 continues to mark a never-asked issue. (This would be needed if the odds of selection are to be different for a never-asked issue.) Every 30 issues, you change all the 2 issues to 1 and all the 3 issues to 2. Every time you select, you select from 1s and 0s, and upon selection, mark it with 3. This ends up doing what my assistant does – it keeps issues from being asked again for between 30 and 60 turns, 2 weeks to a month at two issues a day. You could use some number other than 30. I just picked 30 so that you wouldn’t run out of new issues before you’d gone through 3 periods. Note that if the game doesn’t actually need to know whether an issue has ever been asked, you could use 0 for a period also, and increase the guaranteed time between repeats up to 50 or so.

I respectfully ask the keepers of the game code to consider this idea.

Finally, I’d like to close with a bit of advice for a certain class of players. The people who really get into issues often set up nations or regions of nations whose goal is to eventually be asked every issue, and to give every response. For instance, several players (and I am among them) have set up nations which choose option 1, 2 (and so on) of each issue they are presented. Because of the fact that some issues have specific prerequisites, some of them are essentially impossible to get in this way. For instance, as I recall, no issue has a second response which makes your nation a dictatorship, and so no “2nd option” nation which starts as a democracy will ever receive a dictatorship-only issue. There are two lessons to draw from this. First, if you want to be asked everything, your nation has to change. Your best shot is a nation that switches back and forth from democracy to dictatorship, from socialist to capitalist, from libertarian to oppressive, and from frugal to spendthrift. And issue repetition helps you with that. As like as not, even with this advice, the goal of achieving the complete issue experience is out-of-reach, but a strategy of perpetual change is certainly a more interesting way to fail than one of single-mindedness. And thus, if you’re a fanatical issue devotees like me, issue repetition is your friend. In the final analysis, it’s a feature, not a bug.

-New South Hell-

16 October 2008

I'm A NationStates 2 Issue Writer

Good news! I've committed myself to writing eight brand new issues each week for NationStates 2 which should mean a good thirty-two or so new issues per month if I can meet the deadlines. I hope everyone likes them!

That's all I've got to say for myself for now, but watch this space: got some interesting posts lined up for the near future.