Saturday, November 24, 2012

Technical framework up

  Good day.

  Today, I am proudly presenting... nothing!... since this marks the start of the making of the simulation game. As for names, there hasn't been any good ones coming to mind yet, so for now I shall just summon my powers to connect random words and call this game... BalalaikaOpus! (BO for short).

  As of now, there is currently no world to live in, but nevertheless, the npcs have been created and are currently paddling through space, and been given stats (Athleticism, Age, Creativity, Deftness, Learning, Resilience for now). Mindsets have also been implemented, for now j perseverance and morality. Some skills have also been implemented: Walking (What a undervalued skill!), Running (just for the sake of juxtaposition), Cooking, Painting, Fighting and Life Experience (for whatever can't quite fit... stone-skipping skills anyone?). As can be seen, most of such skills are broad, and hence implementation has been done on the basis of possible future subskills, e.g. cooking.baking.

  The difference for classification into stats, mindsets and skills is basically to make the concept clearer, since although the variables are be treated as equal, the way the variables behave are fundamentally different. Stats in general do not change (age aside), mindsets change slowly, and skills change quickly. Moreover, skills do not decrease, while external interaction can, and likely will change mindsets. Also, while skills have dependencies on stats, mindsets do not, and as for individual actions taken, they will be based off mindsets and skills solely (with stats only being indirectly involved).

  Each npc is planned to have a set of stats, skills and mindsets, although if the skillset gets too large and that creates a problem for computer memory, some of those might have to be ignored and estimated based on situational need (e.g. pancake flipping skills, while not implemented, is likely to be related to the cooking skill).

  P.S. I forgot to mention the inclusion of goals, which are objectives an npc tries to pursue. For now, there is wealth, attention and fame.

  Coming up: Planned vague goals, to account for unconventional objectives, such as promoting the joy of eating chocolate. Such goals will be given just an ID, instead of a name, and are set to be randomly generated by the computer.

Monday, November 19, 2012

Simulation of a society

Fact:  I enjoyed Roller Coaster Tycoon immensely (the original version, created 1999). Parts of what I enjoyed about it were the simplicity of design, together with the "interesting" details microscopically (such as when you observed a single guest) and macroscopically (while managing the entire theme park).

  As such, I have on different occasions thought of how a simulation of a society (in the sense of a group of people, probably isolated, living together) would function.

  I imagined it being a wonderful simulation (my ideal), where one got to observed the macroscopic panorama of the layout of the structures sprawled over space, as well as the individual simulated citizens going about their daily lives. It would also include the intrinsic concept of progress, since it is the basis for many games, whether RPG, Sim, strategy or shooter. This would come in both microscopic and macroscopic forms, respectively being the way an individual pursues his or her goals, and achieves (or doesn't achieve) them eventually, and the way a society progresses over time, with definite short-term direction but not necessarily with a fixed long-term route to follow.

  As such, I have planned to pen down (and give a structure to... concretise?) the ideas for a sim (i.e. those that I remember at the time of writing). This is again a short-term direction, and may (and probably will) suffer from the lack of follow-up.

  In the next post of this series (if it exists) I shall cover various (at least one) specific aspect of the sim of my imagination, probably written in the form of a design note (design notes are awesome!)

Thursday, September 27, 2012

Largest area given a fixed perimeter (Part II)

Over the week, I have found a few more things of note to bring to the metaphorical discussion table. Firstly, there is a most welcome patch to the squabble over the proof of necessity of convexity in maximizing area, and secondly, a proposed sketch of a definition of "inside", used when defining area. However, it is still not clear how the definition can be used explicitly in the proof apart from "obvious"-style handwaving at the moment.

Firstly, the patch:

Consider the following 2 propositions:

1) A larger fixed perimeter will yield a larger maximal area.
2) A straight line is the shortest path between 2 fixed points.

For (2), there is not much to say, and is more or less a take-it-or-leave-it axiomatic definition, due in part to the triangle inequality.

For (1), consider 2 fixed perimeters P and P', with P'>P. Consider the shape with the maximal area for P, S. Define S' similarly. Clearly Area(S')>= Area (similar shape to S with perimeter P')* > Area (S), since Area (S)>0 (consider a square, for example). In fact, Area (similar shape to S with perimeter P') = Area (S) * (P'/P) ^2.

Consider a concave (used here possibly loosely to mean non-convex) shape S. Assume it has maximal area.

Then consider of it, two points on its outline A and B such that there exists a point P on line segment AB such that P is not in the shape.

Next, consider the shape S', which is S with arc AB replaced with line segment AB.

Now, consider the shape S'', which is the union of the set of points contained in S and S'.

The area of S'' is clearly greater than that of S, since there is at least one point contained in S'' not contained in S (P), and whatever is contained in S is by definition contained in S''.

3) The perimeter of S'' is also not more than that of S.

<Proof of (3):

Assume otherwise. If so, then there exists an arc CD in between such that its length is less than line CD. This contradicts (2). We are done.>

Hence, S'' has greater area but less than or equal perimeter to S, and hence a shape S''' similar to S'' but with perimeter equal to S with have greater area than S, contradicting the original assumption that S had maximal area for its perimeter.

Finally, on to part 2 of this post, the definition of "inside":

All points at infinite are outside. Consider any line. Each time it intersects the perimeter of the shape indicates a border between "inside" and "outside". The area of a shape is the sum of areas of all "inside" points.

* Similar as in similar figures, used in the same context as congrurent

Friday, September 21, 2012

Largest area given a fixed perimeter

The question is simple: given a fixed perimeter of say P, find the shape that gives the largest possible area. The answer is somewhat equally simple: a circle gives the largest area for a fixed perimeter. The proof, is not so clear. The definition is a trickier problem, which I shall not care to resolve (I define the center of the circle to be the outside of the perimeter...).

Browsing the internet yields more than just one proof and references to proofs that exist. One of which I trust to be rather unambiguously true is referenced to as the proof by calculus of variations, which I suppose works, since calculus is such an overpowered sledgehammer. However, yet another interesting proof presents itself, of which the outline is presented below:

Define X to be a shape that maximizes the area for a given P.

1. X is convex.

Proof: If X is not convex, then let C be a point outside of X, and A and B be points on the perimeter of X such that C lies on AB. Moreover, let there be no points on the outline of X, say Q, such that Q lies on line segment AB. In that case, if we reflect the outline AB about the line AB, the area increases. This contradicts the maximality of area X. Q.E.D..

Attack: What if we cannot pick A and B such that there are no points of the outline of X, Q, such that Q lies between A and B? (a.k.a. fractals)

2. Any polygon with a fixed number of sides N has maximum area when it is regular. (more or less indisputable).

Corollary: A regular polygon with i sides has greater area than one with j sides given a fixed perimeter iff i>j. (Think of degenerate polygons)

3. Therefore, as the number of sides N goes to infinity, the area increases, and we get a circle, and therefore a circle maximizes area for a fixed perimeter P.

Attack: Where did that come from? Can we even apply rule number 2 to "polygons with infinite sides" (a.k.a. shapes with curves)?

Is there a reasonable patch to the leap from part 2 to part 3? I would agree that it is intuitively very probably true that the argument *sort of* works, and just need formalisation, but with infinities I would not be very sure, ever since the last time I saw 1=1+0+0+...=0+1+0+...=0+0+1+...= ... =0+0+0+...=0. Therefore 1=0. Instead I would probably work towards a more geometry-based idea, described handwaving-ly all the way through, since I have not worked out a full "proof" yet:

Lemma 1 remains, despite the attack. Fractals can be dealt with separately, ... some other time... some other person.

2. The outline of X is smooth. (i.e. no line segments anywhere) random rantings.

Imagine the outline as a wire. Now divide the wire into 2 parts of equal length, and call the parts, with direction, AB and BA respectively (i.e. starting with A and going say clockwise to B and starting with B and going clockwise to A respectively). Define the area enclosed by arc AB and line segment BA be called ABA and BAB be defined similarly. if ABA > BAB, then copy ABA over with symmetry on like AB. X clearly does not have this property since otherwise the operation would produce a shape with the same perimeter and larger area. Hence for X, ABA=BAB for every choice of A and B. Now notice that the reflection does not change the area for X, even though it might change the shape. This does not bring us to an immediate conclusion, since X might not be a unique shape. Also, reflecting about AB must result in another convex shape. This fixes X as a circle... somehow? Good night.

Friday, August 31, 2012

Constrained Writing

I've been wanting to post this for quite some time. In fact, such some time that I can't exactly remember whether I actually ever got round to writing a post about constrained writing, but knowing me and my laziness, as well as the latest spate of blog-neglect, I shall assume that I never had.

First: before talking about what it was I think I wanted to talk about, I shall acknowledge the main source of my inspiration for this post: namely the Pilish work Cadaeic Cadenza (starting from the poem "Near A Raven"). It is an epic work of constrained writing, mainly that the number of letters of each word corresponds to digits in pi, i.e. Pilish. As if such an undertaking was not enough, the author (writer? composer?) saw fit to add other constraints into his writing through different parts of his story. Ridiculously, the story is coherent and (somewhat) elegantly written, if a bit awkward due to abuse of synonyms at numerous points. As an illustration, "Books inhabited each table, shelf, and nook.". Inhabited? Interesting use of word, of course with this particular instance of "nook". Also, "A madrigal; tell a marcher," seems a little arcane to me.

So, to the point of this post, which at some point became to evaluate the technical niceness of a piece of constrained writing. This is clearly subjective, but nevertheless, some indicators can be objectively evaluated (somewhat like standard of living indicators pointing to the quality of life).

Firstly, of course, there is the freedom that the constraints allow. For example, a constraint that you may not use the word gneiss is hardly a constraint at all under most normal circumstances, since English grammar does not commonly necessitate the use of such a word under most contexts. Writing without using any forms of the word "be", on the other hand, might be a challenge, since there ARE many situations where such a word IS used in the syntax of English.

Then there is, of course, coherence, where the text has to make sense. "For a dime, I would do proper Maths." is, for example, much more coherent than "Fly a poke: a flail or uneven table", despite that the two share the same constraint of Pilish. This is naturally highly subjective. I AM going to be contradicted... right?

Lastly, there is length. A good length makes any piece of constrained writing more impressive, since the whole idea is sort of a challenge upon yourself, and any lengthy piece could be compared to a marathon instead of a 100-metre race, which would be more than 422 times more impressive if traversed at the same velocity.

And once again, I conclude a post hastily, due to sudden lack of inspiration in the midst of composing (I recall there being a more... uncommon *inimitable is a synonym!* word for it). I would nearly apologise for this, but then that necessitates far more apologies to come, which would get old. 

Monday, August 13, 2012

Anagram a margana

Well, I can't let myself be beaten here. (Despite failing to satisfactorily solve even half of those anagrams ph42 gave...) Here's a fresh sampling of anagram hell.

strobe
sunboule
tacuics (Inaccurate tactics lead to death!)
gneiss (I could've given the other word instead, but nobody knows gneiss...)
cretins
liminiac
shidap
morphias
glintei

All popped into my head while trying to solve those 14 below. So yeah. A response.


Saturday, August 11, 2012

Anagram List

May be edited to expand it. But meanwhile...

1. Naruto
2. Sungei (Malay for swamp I believe)
3. SacLose
4. ProBash (Warning: obscur-ish word)
5. NaEight
6. EpicSac
7. Tactics (Ah well...)
8. ProBing (Eh already a word. Too self-evident, apparently)
9. Chariot
10. Minister
11. Positional (Eh whaaaaat?)
12. Rating (Again, may be somewhat obscure)
13. Tortoise
14. Silver (3+ solutions)