Monthly Archives: November 2017

Visual Novel VM

I’ve been feeling somewhat delusional lately because of this. I am not sure if it is a good idea because (1) it has never been done before; (2) it seems like a misapplication of an interpreter/state machine model; and (3) it takes some work to set up.

In theory, you could turn any sequence of API calls and basic arithmetic into a machine-readable language. Not all encodings are Turing-complete instruction sets, but a number of them are. For instance, I discovered that PostScript is actually a Turing-complete, stack-based language. You can do math in PostScript, define functions, and do things that are far beyond the scope of executing print jobs. If you keep this in mind, you can find that an instruction-based model is not a misapplication for a scripted visual novel. The other question stands, however: is it practical?

The goal behind VNVM is to make visual novels self-containing and portable by adding a layer of abstraction to the behavior of sprites, with the ability for instructions to be sent over the network without any danger of exploitation. While sandboxing is achievable with Lua and Python, I would end up placing an excess amount of emphasis on the security layer to prevent arbitrary code execution, which is ridiculous to defend against using a bytecode that is far more complicated than I really need. Moreover, using Lua in tandem with Python already raises eyebrows: why use two different scripting languages?

A side effect of this project is that you would be able to write visual novels in assembly, if you so choose to. You can also port the VM to the browser, to a GBA, to any platform you can play games on. But the final goal is to make any sort of visual novel play faithfully, without the end user needing to see the backend at all.

Delusional and worried that I was wasting my time, I wondered why the instruction set was so complicated. After taking some inspiration from PostScript, I realized that this approach of a VM, albeit somewhat strange, is workable. I just have to change the instruction set from register-based to stack-based, which was an easy change and eliminated about 100 lines from my code.

My main target right now is Ace Attorney. Currently, case engines are written in exotic languages, such as Delphi, Multimedia Fusion, or some “custom-made” language that looks very similar to AutoIt. VNVM, I admit, is no exception; however, my main argument is that its applications surpass Ace Attorney, and I plan to automate the construction process of a faithful case engine by creating a Python script that emits VNVM machine code. I have already written an assembler; now I am to write a script that uses inline assembly to directly produce machine code.

One useful application of VNVM is writing the behavior of sprites. Users of Attorney Online are accustomed to using .ini files to define emotes, sounds, and delays. But from a technical standpoint, this system is bunk: what if I want my sprite images to be organized in some other way in the file system? What if I need 8-bit transparency in my animations? What if there is something floating around me while I do everything? It is clear that .ini files cannot cover all cases, and even at the introduction of some complexity, the system falls flat on its insufficiency.

My idea was a domain-specific language called Spritelang. This is a macro-based language, which, unfortunately, has rather complicated syntax rules, surpassing my knowledge of compiler theory and the writing of tokenizers. I would certainly write it in JetBrains’ MPS, but I underestimated the notes when they said “this might take about a day’s worth of your time.” The meta-language is not an easy one to understand, but I can sense its immense power currently beyond my reach.

Succumbing again

I am not looking forward to Thanksgiving.

I got a 172/200 on the CS exam. That’s only around 10 points above average, where the standard deviation was 22 points. That is a B. There is no hope now of escaping my A-.

Screw scholarships. I’ll just play dumb and when the student loan bubble bursts and the government goes broke and will give no more, I’ll just get screwed over like the majority of the US population. Then we’ll riot and have a civil war. Or, someone will invent general AI before I do, and he will become the billionaire. And then years later, when I come into the field, there will be a billion competing general AI companies, and it will be impossible for me to thrive. I’ll just end up working for some company and become a salaryman.

I skipped the discussion section for another class. They are going over a test as I write this, but why should I make myself anxious when they haven’t even put a grade on my test? And it probably is a sucky grade, or an “average” grade.

And what is the point of studying? The professor and the TA want to take points away from you, by laying traps and gotchas on their tests that everyone is meant to fall over, except the “cream of the crop,” yes, those who are then lauded and offered a paid TA position under the table. And for the most part, the TAs have hardly a clue what they are doing, because they don’t know a thing about pedagogy and theory of pedagogy, so naturally the discussion sections/sessions are boring because no discussion actually occurs.

What’s the point of being successful, anyway? The world can be likened to a bunch of serial voters, anyway: if they think you are commendable, then you must be commendable; if they think you are stupid and useless, then you really must be. It’s like that “double decker couch” concept from The Lego Movie, that detestable movie. You’re conditioned into thinking that the concept “sucks” because it is said consistently that it “is the worst idea imaginable.” But it is, in fact, not the worst concept imaginable, while the idea may have its impracticalities.

People think on the outside that I am a somewhat reasonable person, but on the inside, I am fairly insane, and when I express my insane ideas, there is such a disconnect between my insanity and what they normally expect of me that they simply do not understand what I want.

Here is the bottom line: I am lonely, and it is all my fault.

The voice in the back of my head has returned to ravage and flowchart me back onto the status quo. Hardly anything in my life leaves the status quo, although there are days where an interesting number of coincidences occur.

My hair is back to losing itself. My brain is back to damaging itself in depression, forgetting my culture, forgetting people. My eyes are back to wandering, looking at people who are enjoying life together with others: the boys who are wearing their comfortable jackets (I forgot mine at home), the girls who are wearing their remarkable outfits (implausible to do by men).

When I go to the bathroom, I sometimes hesitate for a moment before entering the men’s restroom. I look intently at the sign as I open the door: am I really a man? I look at myself in the mirror. It takes work to convince myself that I am one.

I want to hug someone. Counseling sucks because you are paying for someone to listen to you. I want a genuine friendship. I try to talk to this girl I have known for a few years now, but she seldom responds; I fear her life is too busy to put me into it. Every girl I encounter (that is, those who I approach, which is uncommon; or they approach me) that seems remotely nice either is already invested in a relationship or is years older than me. I don’t even want sex.

And the people online “helping” others say, “no, if you think a relationship will fix your problems, you are wrong, there is something else you need to fix, figure it out.” Yeah. Figure it out.

Here’s what the status quo is. They’ll call me in the afternoon asking if I am okay, and I’ll say yes, and they’ll hang up. I’ll live through Thanksgiving as I always do, and my brother will bother me if I want to play games or whatever. I’ll go back to my dorm on Sunday night, mad, thinking about all the assignments I still need to do. And I’ll probably have forgotten a few things along the trip. I’ll live through exam hell, probably miss another multiple-choice on the calculus exam and get a 15/20 on the free-response. And then when finals roll around, I’ll be bored and anxious out of my mind, and then I finally set out on the 21st right before they shutter the dorm hall. My grades: discrete math, A; data structures, A-; calculus, B+; theatre, A-. 3.60 GPA. Impossible to apply for anything.

And my parents don’t suspect a thing. And what if they do find about all this? My dad will go into my room and say, “Anything you want to talk about?” until I say something (probably ask me the same question in English – no, I will use Spanish!), and my mother will intimidate me with something like “do you pray?” asked over and over, and maybe something like “you have committed a high mortal sin against God and the Church and you must find a place to confess now!” And my brother will just stand at the doorway, peering into the room, playing dumb and asking what the commotion is about, and then he will finally give me the you’re-going-to-hell-for-this look.

I don’t like who I am. I don’t like how my brain operates. I don’t like it when I look at the only picture I have of my family, and there is my mother, my father, and my brother, all with natural, fair skin; and then there is me, with an unnaturally white color of skin. It makes me look dead, like a vampire. I don’t like it how people expect me to be strong. I may be somewhat gentlemanly, but I despise the discomfort of gentlemanly clothing, and I absolutely despise going to the gym or displaying the force I lack.

Japan: the hyperfunctional society: part 2

Day 5

I don’t believe there was a wake-up call. I take in the view from the massive windows (supposedly, you can see Mt. Fuji, as remarked by my teacher in one of the earlier travel meetings as an opportunity that she has never been able to have from a hotel room, but it’s cloudy, so it is unfortunately not possible). I will not forget this view. Again, I curse at myself for not bringing my DSLR; the view is too magnificent to be taken by my two cameras, although it is raining and hazy. (more…)


I was defused today by an intervention counselor. I didn’t understand the urgency of my problems, but I somehow was led to the appointment the day before.

It took him a little while for him to understand that I wasn’t at imminent threat to die or kill myself. I don’t want to do those things. But he was confrontational enough to bring me to the crux of the matter.

I took two tests, one today and one yesterday. Suppose the results came back on Saturday, and I failed and everything turns to crap. Now what does my life amount to? What meaning is there left in my life?

It took me a long time to answer this question. Instead, I explained to him the long dependency chain. If I slip up, I won’t get a scholarship, and I’ll enslave myself to work for the rest of my life. Or, I will not get a degree and I will not obtain the credentials needed for my ideas to be accepted by others.

He asked me about a famous person. I told him the most famous and cliche example, Albert Einstein, and even told him it was cliche. But he was satisfied, and I was able to explain how he just wrote a paper on mass-energy equivalence and then his life jumped from working at a patent office to being a talented individual, and then it all goes uphill to legendary status. And it doesn’t make sense.

I don’t remember exactly what he said, but he basically told me not that it doesn’t matter, but rather that we find another way. Even if I do get a PhD in something, or not, the world will always try to justify opposing me and my ideas. He asked what I like to do, or if I liked to do something, what it would be: I answered solving problems. Satisfied with the answer, he complimented my knack for being an analytical person, and then went on to reveal that he was actually transgender. I did not suspect anything at all, actually, and I took a good look at him: he seemed completely male, except for his pink socks and tiny transgender tattoo. I was somewhat impressed.

Finally, he told me that he’s not really sure either if I really do have some kind of Asperger’s – he observes that I do exhibit feelings for things and hypotheticals that people with Asperger’s would not – but he also hints that it doesn’t really matter, that I should just naturally allow myself to develop.

And I left the session with him telling me that the only thing that can hold me up is “celebrating myself” more (and being more selfish).

So I started doing things again.

More frustration

It’s hard to keep your mind at peace when you arrive to your dorm at night and check Canvas, only for it to tell you that you got 12/20 on your most recent programming assignment, only because you failed 22 unit tests pertaining to some broken function (that you tested, but not rigorously enough, it seems!) and nothing more. On top of that, you read the last half of The Crucible (which, as you know, is obviously a very peaceful book) until 10pm, and you have two exams this week, can’t wait to see how horribly you failed Thursday’s calculus quiz, and you never have any idea what Monday’s CS quiz will be over.

I explained to my father about how merit-based scholarships were oversaturated with elite 4.00 GPA students, who predictably sweep and scoop more scholarship money than they really need. The only way for me to ever have an opportunity to get a scholarship is to also have a 4.00 GPA, and right now, that’s pretty much impossible. It is sincerely impossible for me to maintain perfection on everything. I would go insane if I tried – and indeed, I am already going insane. He just tells me to forget about it. Just go to college and take classes and learn.

When the professors look for TAs, do they privately go up to the fifteen best students of the class and offer them a position? I wish I could impart a humor and energy on students. Most TAs are awfully boring or emit an atmosphere of superiority and “you’re supposed to fail, just like me.”

When I see other students smile and laugh and talk to each other, and never about their grades, I often wonder if I really can consider myself a legitimate member of society. Companies are “looking for me,” but they’re not really looking for me. They’re looking for people with my intellect, but not my personality. They are not looking for people who will muse for hours on the same problem, sleep and dream about the problem, and come the next day and keep working on the same problem.

Society is not looking for people who don’t know how to act in front of people of the opposite gender, people who speak older than they actually are, people who are not gullible enough that they criticize and question everything instead.

I can’t keep writing. I am becoming hysterical again. My thoughts are scattering.


I don’t feel like I’ve touched this blog in quite some time. Don’t worry, I’m still committed to finishing the account of the Japan trip, and I am quite close to finishing it (although I feel as if I should not finish it – it does not deserve a sense of completeness, or else I may cease to think about it any further).

Last week was extremely difficult; this week, however, has been fairly light. But I have come to some major revelations that I did not really think of in depth until now, and their repercussions are not trivial.

There are two main observations, one of which was formulated by me, and the counselor somewhat supported, and the other of which was entirely raised by the counselor.

These writings just get uglier and uglier, don’t they? Why do I do this? And yet it takes a certain courage to do this. I know people are reading, but I don’t really care that much. I’ve written enough controversial material already, and I think people at this point wouldn’t really be shocked. And again, they are observations; they are not final verdicts on anything.

1. My sexuality – or lack thereof

I am increasingly convinced that I am asexual. And I thought I was out of the fray, that I had it totally figured it out, that I’m straight, end of story! But no, it turns out that I placed little thought into sexuality – mostly because I had none. I currently have no sex drive. All those times in high school where I wanted to be with a girl – the fantasy was never about having intercourse with the person. In fact, as people matured and started making relationships and getting into the game, I became increasingly alienated from them. I could not understand cues from other people who may have at some point desired to be with me – nor did I understand how to emit cues of my own. I am a bird that does not know its song – and it is not interested in singing it anymore.

If I really am asexual, then I feel somewhat comforted – there’s a term which I can stand by. Yet if so, how will I explain it to others who have an interest in knowing such things? More importantly, how will I explain to my parents that I’m not interested in sex? It’s such a complicated map of causality. It wasn’t caused by anything in particular, but rather gradually became both the cause and effect. I didn’t learn how to converse at an emotion level with girls, and therefore never sought any meaningful, deep relationship with them. This caused me, over time, to lose interest in “playing the game.” But I still want a meaningful, deep relationship with a girl, that hasn’t changed. But what has is now the need to tell them, look, the end goal of this relationship is not sex. And that limits my options.

How do I feel about this? For one, I feel weak. Libido is an integral part, it seems, of one’s masculinity, especially in American culture. Therefore, if I have no libido, then my masculinity is diminished. I also feel like some sort of domesticated animal. I imagine my skin is made of some tight blubber or cartilage, and I have no privates, and I’m happily cuddling away with someone and feeling giddier than I ever have been. (“Giddy” – that’s a word I haven’t seen since I read the cringe-worthy Animorphs back in middle school.) And then, perhaps one day, my rights are denied to me, or for some inexplicable reason I am placed as a subordinate in the social ladder.

The final question is, is it a sin to feel this way, to have no sexual attraction? On one hand, priests are bound to celibacy, but that is an obligatory sacrifice (it seems to be a challenge for many for one’s fleshly desires to not outweigh their desires to fulfill God’s will). But on the other, humans were designed to “be fruitful and multiply,” and it is not natural for one to not wish to procreate to continue the human race.

2. Asperger’s

Yes, out of the blue, he said that my experiences of lacking an understanding of social workings “lines up” with Asperger’s. No, of course not, I am not comfortable carrying the knowledge that I “might” have Asperger’s. It is debilitating to find when one’s current mental state fits into a medical condition, and you let the medical condition morph you and excuse you out of the orthodox parts of society.

Then again, doubt and denial is just one of the stages of grief. Is it even true? Do I even want to undertake a diagnostic process? I don’t think so.

I want to be normal. Everyone wants to be “normal.” And I have reached a point in my life where I can definitively say that there is something wrong with me, and I don’t know what it is.

Cost of living

I’m listening to Tokyo FM World through Radio Garden. I tend to listen to it when I am absolutely bored and have some kind of interest in Japan in my mind because there are often English speakers talking when I’m listening, even though it’s 2 AM over there and most likely a prerecorded program. The program is a conversation with a guy about who lived in Boulder, CO and now has lived in Tokyo for 14 years, talking to a woman who has lived in Japan for the longest time. Both their parents are from different cultures. The guy has a passion in photography and has endeavored in a project involving taking instant pictures of families in disaster situations, in which these families have lost everything in a tsunami, earthquake, or some other natural disaster. The lady has a decent American accent with a tiny British bend, but also has an authentic, fluid Japanese voice.

When you compare losing everything to giving and taking cultures, it seems like anything is better than losing everything. Everyone should be happy for what they have. Yet here I am, lamenting how learning one thing causes something else to slip from my mind.

Being in university has cost me a great deal.

It has cost me near 100% of my usable time dealing with assignments from only four classes. Embarrassing, to say the least.

It has cost me personal projects I thought I could excellently progress in. Animated Chatroom? Can’t do that, you have other coding projects to tend to, like a backend in a language you don’t understand (Rust). Publish the new AO website? Can’t do that, you got something due tomorrow.

It has cost me my ability to absorb myself in other things that do not directly pertain to my major (the major does not define me!). I don’t need to be an engineering major to learn how to use a CNC. Besides, I’m interested in machining that does not require a CNC. What if I wanted to make an O-ring seal to fix a “junk” engine? What if I wanted to construct something that is made of something that is not wood or PLA/ABS plastic? Nobody knows how to do that, it seems.

It has cost me in my usage of Spanish (there is hardly a chance to practice or use that here). My only chance to exercise it is on a Thursday night when my parents decide to call me, or whenever I go home, or whenever I am with family (i.e. at my uncle’s house, three times a year).

I can’t learn Japanese. I wish I could do these billion things, but there’s literally no time to do all of them. I hate the feeling. My time is so fragmented, I take 4 hours of classes daily, but the gaps in between are too tiny to do anything productive.

I thought I could fix this by buying books of other languages, but my time problems still exist. I remain too anxious to read a book standing still. It has little to do with technology addiction. I don’t care about my phone. People call me or message me so infrequently that I could go a whole 16 hours without receiving a single text message or phone call; that, or my parents call me 10 times, leave a voicemail, send me text messages, and finally I find out how many times they’ve been worriedly trying to call me. Just call me once and I will call back.

What exactly does it cost me to do what I’m doing right now – that is, living? Am I delusional to minimize all costs, including the cost for myself to live?

The human brain only retain what it needs to retain. It will not retain Japanese if I do not need it, nor will it retain Spanish if I do not need it. Inversely, if the human brain needs to learn something to survive, it will learn it; hence why after a certain threshold of prior knowledge, foreigners can learn Japanese in a matter of months simply being in Japan and interacting with people.

What exactly does my brain need to retain if I’m stuck here in my dorm, doing homework for all the time that I am not in class?