Sunday, July 29, 2007

Pre Dynasty stuff

My current dynasty plan is to play with Aministar’s Goldberg Factory idea(and idea that was awesome but never actually got put into real action) and have a bunch of ‘Code Monkey’ writing pseudocode which effects the monkey gamestate. Ideally, there would be limits put on what can be done within the code, and each code monkey would write a function. The order those functions are evaluated in would be determined randomly, preventing Code Monkeys from writing functions obviously biased towards themselves. After all, you never know what things will look at before you get your turn.

The hand part comes in defining what can go in a function, and how the actual code should be handled. I don’t want to actually use any programing language, even though it would be easiest, because that isn’t fair to those who don’t know that language. But defining pesudocode that would accomplish its purpose for this dynasty is a pain, and I wanted to see if anyone has ideas as to how to make it work. So any help you can give would be awesome.

The Monkey Line:

The Monkey Line is a list of the current active Code Monkeys. The Code Monkey on the top of the list is considered to be in position one (first in line) and each successive monkey is considered to be in position N (Nth in line) where N is one more than the position of previous monkey. If a Code Monkey goes idle, then e is removed from the line and all of the Code Monkeys below eim move up one spot. Whenever a Code Monkey joins, e is added to the end of the line. A Code Monkey may, at any time, move eimself to the back of the line. (The same result could be obtained by idling and then rejoining). If there is ever a number N, greater than or equal to one, such that there is no Code Monkey in position N yet there is a code monkey in position N + 1, then the code monkey in position N + 1 moves to position N. If there is ever two code monkeys in the same position N, then the code monkey(s) who’s name appears later lexicographically moves to position N + 1. Both of these cases are called abnormalities. If there is more than one abnormality with the Monkey Line, the code monkey preforming the change should always deal with the abnormality that appears in the lowest position. The Monkey Line is tracked in a wiki page called “Code Monkey Dynasty Gamestate Documents”

The Program:

Each Code Monkey has a section of code that belongs to them, tracked in the wiki page called ‘Code Monkey Dynasty Gamestate Documents’. Their code should, in plain English, describe what happens when their section of code is run. Code cannot reference any code monkey by name, only by their position in the Monkey Line. ‘The Monkey in Position #4’ is fine. ‘Clucky’ is not. Code may refer to values tracked in th GNDT for any code monkey, but still may not refer to the Monkey’s name. ‘The Monkey in Position #4’s Bananas’ is fine. ‘The Monkey in Position #4’s Name’ is not. A section of code may change or update any value found in the GNDT(other than a monkey’s name), provided it follows the limitations imposed upon that stat. A section of code may also change the order of the Monkey Line. If a line of code referees to something(like a GNDT field) that does not exist, it is just ignored. If a line of code refers to a position that does not have a monkey, nothing happens unless otherwise stated.

If, in executing a section of code, it is found that the section of code creates an infinite loop then the whole section of code should be ignored and the program shall precede to the next section of code as if the infinite looping section never existed.

If no other Code Monkey has done so in the last forty eight hours, and if e has not changed eir section of code for the last six hours, a Code Monkey may execute the program. To do so, e randomly sorts each of the code monkeys into a list, called the order of execution. E then executes the section of code possessed by the first code monkey in the list in its entirety before proceeding to the next section of code. After each section of code, e fixes each abnormality with the monkey line.

——-

There exists a stat tracked in the GNDT called ‘Bananas’, which is to be an integer value at all times. If ‘Bananas’ is ever not an integer it is rounded to the closest integer. A single section of code may not increase or reduce any one Code Monkey’s Bananas by more than ten. If it does so, the excess change(over ten) does not apply. Thus, if in executing of a section of code, Clucky’s Bananas increased by twenty, they would be reduced by ten to result in a net gain of only ten. If the bananas are increased for a position in the monkey line that does not contain a code monkey, they remain there until they are picked up by whatever code monkey first moves to that position.

And so you guys can see how this might work:

Example code:

If the hat color of the monkey in position one is red, make it blue and switch that monkey with the monkey in position three. Then make the hat color of the monkey in position four red and give the monkey in position five six bananas.

Double the banana count of each monkey in an even position in the monkey line, and half the banana count of each monkey in an odd position.

For each of the monkeys in the monkey line, starting with the first and working your way back, if the monkey has more bananas than them, give them three bananas. The monkey in the first position uses the monkey in the last position when making their check.

 

Comments

Kevan:

07-29-2007 18:59:27 UTC

There was a programming-based Dynasty a few years ago that, at least from my memory of it, didn’t really take off because only a few players were comfortable thinking and writing in terms of programming.

The Program might be less intimidating (and possibly more coherent) if it were a Machine with various Levers and Buttons as its functions, each of them written in Nomic-English rather than pseudocode (“When this Lever is pulled, the Monkey at position 4 is…”).

Night:

07-29-2007 20:01:46 UTC

I like Kevan’s idea.  As a programmer, I don’t have any problems at all with thinking in logical code, but I can understand how some may have more difficulty with this than others.

It’s also possible to write code just using plain English instead of pseudocode.  For example, “If the number of code monkeys is greater than the number of functions, then every code monkey receives -10 lines of code.”  In this example, ‘lines of code’ can be substituted with whatever form of currency we choose to use.  Lines of Code was just the first thing that came to mind.

Clucky:

07-29-2007 20:59:56 UTC

The Program might be less intimidating (and possibly more coherent) if it were a Machine with various Levers and Buttons as its functions, each of them written in Nomic-English rather than pseudocode (“When this Lever is pulled, the Monkey at position 4 is…”).

We had a dynasty machine that did just that recently. Although instead of adding parts to the machine; as was the mechanism with the other dynasty, I guess I could add parts to the machine from the start and the dynasty would be about using those parts to create interesting mechanisms.

Clucky:

07-29-2007 21:24:27 UTC

How is this:

Each Code Monkey has a section of code that belongs to them, tracked in the wiki page called ‘Code Monkey Dynasty Gamestate Documents’. Their code should, in plain English, describe what happens when their section of code is run. Code cannot reference any code monkey by name, only by their position in the Monkey Line. ‘The Monkey in Position #4’ is fine. ‘Clucky’ is not. Code may refer to values tracked in th GNDT for any code monkey, but still may not refer to the Monkey’s name. ‘The Monkey in Position #4’s Bananas’ is fine. ‘The Monkey in Position #4’s Name’ is not. A section of code may change or update any value found in the GNDT(other than a monkey’s name), provided it follows the limitations imposed upon that stat. A section of code may also change the order of the Monkey Line. If a line of code referees to something(like a GNDT field) that does not exist, it is just ignored. If a line of code refers to a position that does not have a monkey, nothing happens unless otherwise stated.

If, in executing a section of code, it is found that the section of code creates an infinite loop then the whole section of code should be ignored and the program shall precede to the next section of code as if the infinite looping section never existed.

If no other Code Monkey has done so in the last forty eight hours, and if e has not changed eir section of code for the last six hours, a Code Monkey may execute the program. To do so, e randomly sorts each of the code monkeys into a list, called the order of execution. E then executes the section of code possessed by the first code monkey in the list in its entirety before proceeding to the next section of code. After each section of code, e fixes each abnormality with the monkey line.

——-

There exists a stat tracked in the GNDT called ‘Bananas’, which is to be an integer value at all times. If ‘Bananas’ is ever not an integer it is rounded to the closest integer. A single section of code may not increase or reduce any one Code Monkey’s Bananas by more than ten. If it does so, the excess change(over ten) does not apply. Thus, if in executing of a section of code, Clucky’s Bananas increased by twenty, they would be reduced by ten to result in a net gain of only ten. If the bananas are increased for a position in the monkey line that does not contain a code monkey, they remain there until they are picked up by whatever code monkey first moves to that position. 

——-

Example code:

If the hat color of the monkey in position one is red, make it blue and switch that monkey with the monkey in position three. Then make the hat color of the monkey in position four red and give the monkey in position five six bananas.

Double the banana count of each monkey in an even position in the monkey line, and half the banana count of each monkey in an odd position.

For each of the monkeys in the monkey line, starting with the first and working your way back, if the monkey has more bananas than them, give them three bananas. The monkey in the first position uses the monkey in the last position when making their check.

Chivalrybean:

07-29-2007 23:25:10 UTC

Changing the rules of the game is essentially programming. Each rule is a little program that runs the game. I think anyone who can comprehend playing a nomic game should be able to grasp writing programming-like “sections of code” because this is basically the same as writing the effects of a rule change, or how some game object effects the game and its rules.

Clucky:

07-30-2007 00:14:51 UTC

Agreed. But some form of standard is probably needed… and I am not sure my rules describe it the best.

Josh:

07-30-2007 08:24:42 UTC

Nff.

Chivalry, it may seem that way to you, but as someone with zero technical aptitude I find all of this very intimidating. I accept that there’s a conceptual link between rules building on rules and lines of programming code, but saying that grasping one leads to grasping the other is a bit of a fallacy.

Icarus:

07-30-2007 08:54:59 UTC

Monkeyscript, eh? Sounds good! But where would the rules come in? You could have the above rule (and maybe some victory conditions) as the only dynastic rules and just leave the code to it. Maybe we could limit the code to bunches of pre-written ‘snippets’? Also, how do we first determine the order of Code Monkeys?

Zephyr:

07-30-2007 14:36:53 UTC

I like the idea of a plain english code, which makes it simpler to construct complex programs. Idea sounds good on the whole.

Clucky:

07-30-2007 14:57:21 UTC

Would plain English Code or a set of items containing plain english code work better? Probably a set of items, as that would impose limits and prevent anything sneaky. Although sometimes sneaky is good.

Night:

07-30-2007 15:45:22 UTC

I think it would add a strategic element to things if you can modify code as well as modify rules, although obviously you can’t modify the rules in such a way as to violate the basic tenets of writing code.

In other words, everyone has their little snippets of code they control, which must be written in accordance with the rules (no infinite loops, no increasing or decreasing by more than 10, etc.). But everyone can also modify the rules (by proposal), so that more options are available to be included in the code, to fix loopholes, etc.  For instance, I could propose that their be apples available in addition to bananas.  That would be a rule change, not a code change.  As long as it follows the coding guidelines we can change our little pieces of code however we want.  Rule changes, as usual, would have to be voted on and approved to be enacted.

I’m looking forward to this dynasty, reckon it’ll be quite entertaining.

Elias IX:

07-30-2007 17:27:52 UTC

Okay. Let’s do it.

But new color scheme, please.

Chivalrybean:

07-30-2007 17:35:46 UTC

I hope I didn’t offend anyone earlier, for that was not my intention. I was just trying to point out to anyone who may be intimidated by the programming/coding aspect could think of it as similar to writing rules as is part of the game already. In viewing them as similar, I suspect that someone with no programming experience could take a stab at this without too much headache.

As far as guiding and limiting the code, a set of items would be good, for this set could be expanded as needed. For example, there could be set up lines, such as <adjust monkey order> and <adjust banana value> or even <Remove bug from adjacent monkey> and each of these would have a value to change (higher number, lower number, nearest number, add +5, etc). That way someone can’t start out by doing something like :

Shuffle monkey order, then shuffle all bananas, remove all bananas (limited to of course), erase monkies in position #4 and #5, etc.

or something that would cause all kinds of havok. The code could also be limited to a number of characters, or values that can be changed, etc.

spikebrennan:

07-30-2007 19:12:49 UTC

If my understanding of Blognomic and GNDT tools is correct, shuffling is difficult.  I believe that it is possible to generate a random number betwen 1 and N, though, from which it follows that if we’ve got, say 8 players named A, B, C, D, E, F and G, then you could generate a random number between 1 and 8 such that if the result for a particular role was 3, then the player order would be C, D, E, F, G, A, B.

Hix:

07-30-2007 20:23:11 UTC

The Ruleset has been archived.  Feel free to Ascend and repeal.

Clucky:

07-30-2007 21:10:53 UTC

Spike: you can roll a DICEN; then a DICEN-1, DICEN-2 until you get to the end. Although a SHUFFLEN function in the GNDT *would* be nice.

Right now, I am thinking of going with the valid sections of code approach. ‘lines’ of code would be defined, and then programs would be limited in running length to X lines of code to prevent infinite loops or item giving abuse. Lines of code would be like

‘Give the monkey in position #1 X bananas.’

We’d find some way to handle loops.

I’ll work on actually writing something up later today. A little busy right now.

Chivalrybean:

07-30-2007 21:36:18 UTC

would you want to allow fuctions like If statements, loops that run a certian amount of times, or while statements?

Example:

while monkey in position #1 has <10 bananas;
repeat;
  give monkey in position #1 1 banana;
if monkey in position #2 is angry, take 1 banana from monkey in position #2 to monkey in position #3
end repeat;

Oracular rufio:

07-31-2007 03:24:09 UTC

Code blocks like if- and while-statements don’t seem like they’d be a problem, and even if they weren’t explicitly allowed, people would probably be able to figure out a way to get them into the code anyway.

What I’m wondering, is would it be possible to do recursive stuff, or to refer to code snippets in the code?  Like, you could have a line that says “execute the Monkey in position #X’s code” or even “execute this Monkey’s code” or something.  Maybe that’s just asking for infinite loops, though.  It’d certainly give whoever was in charge of executing code a headache.

Unless we wrote some kind of Monkey-code compiler…