Tuesday, September 9, 2014

It will be a first person exploration game. I am planning on adding other elements as well, notably horror, puzzle, shooter, and upgrading. (Little to no platforming though.) Most of the game will have a foreboding and apprehensive feeling to it, as if there's a terrible secret hiding behind each corner, but your curiosity (and disgust) compels you to uncover it. The atmosphere will borrow heavily from Metroid (of course) with smaller aspects coming from games like Dead Space and Bioshock.

The name of the game is lo_mipri, which more or less means "the secret-keeper". Long nerdy explanation: This takes from the lojban word mipri, which alone loosely translates to "secret"... well really it translates to "x1 keeps x2 secret/hidden from x3 by method x4; x2 is a secret; x1 hides/conceals x2", where x1, x2, x3, and x4 are arguments passed to mipri, where the word mipri is a relation (predicate logic) or function (programming). The article lo when followed by a sumti (like mipri) means "an entity or event that can objectively fill the x1 place of the following sumti". Since x1 is in this case the person keeping the secret, the whole thing can be loosely translated as "a-thing-that-objectively-is a-keeper-of-a-secret", which boils down to "secret-keeper" in plain English.

==========

There are two related major themes in this game. The first concerns the ways in which the world has been changing since the Industrial Revolution, where the human race is headed as a whole, and the role that advancements in technology play in the downward spiral of our species. The second emphasizes the ignorance and indifference of the general population, while all the power, control, and authority rests in the hands of a small group of elitists. Some good materials that i am taking inspiration from (besides my own intuition) are the book Fahrenheit 451 by Ray Bradbury, and the anime Psycho Pass. There will be other themes that explore the vices of modern-day society, but will be secondary to the two themes i described above.

==========

The primary object of focus in this game is called le vlicak, again a Lojbanic word. This is a form-fitting hazard shield of high-energy plasma worn by the protagonist at all times. It uses a minature on-board nuclear fusion reactor to create a film of plasma suspended approximately 3mm off the surface of the wearer's skin. It offers protection from just about any hazard, including being underwater, projectiles (they are just incinerated before they can impact you), and extreme temperatures.

The logic behind this system means you won't have a standard "health bar" like you see in most games. Instead, you will have an "energy usage monitor", which gauges the rate at which le vlicak is using energy, as compared to the rate at which the on-board nuclear reactor can produce energy. This bar is split into four sections, which reflect the different ways in which the power from the reactor is being used at this moment in time; they are, in order of highest priority to lowest: Critical usage, the energy that the plasma shield requires to maintain basic functionality and protect against hazards; Non-critical usage, where you use the power generated by the reactor as an offensive weapon or to accomplish various tasks (like powering a machine or hacking a computer terminal); Recharge usage, where the reactor's energy is used to refill the batteries if they need refilling; and Excess usage, which is simply leaked into the environment because there's nothing better to do with it. Higher priority usages will steal reactor thoroughput from lower priority usages, simply because it's more important to be alive than to recharge your batteries. For example, let's suppose several people open fire on you while you're attempting to provide power to a computer in order to access its contents. For simplicity's sake, let's suppose that in order to keep the computer powered, it requires 70% of the nuclear reactor's energy, marked as Non-critical usage. In order to make sure that the bullets are vaporized before they touch your skin, the plasma layer requires 40% of the reactor's thoroughput, marked as Critical usage. Since it's more important that you're not full of bullet holes, the hazard shield receives priority -- meaning that the computer can only receive 60% of the reactor's output, and therefore will not stay on. Now in this example, you might want to both stay alive and hack the computer, meaning you need to provide 110% of your reactor's maximum energy output. This extra 10% can come from the batteries (i will probably make a key binding to enable/disable usage of batteries for Non-critical purposes). If you decide to use your batteries, then you'll both stay alive and power the computer, but your batteries will drain. When they are depleted, the computer can no longer turn on.

As an additional complication, while your shielding is active, you will not be able to breathe outside air. This is because, well, the air turns into plasma before it can reach you. You'll have oxygen tanks handy, which you'll use while the suit is turned on and replenish while the shield is not in use. There might be an upgrade in the game that might allow you to get around this, though.

==========

There are two different story paths that you can take while playing the game. Without going into too much detail, they are the Patriot and the Renegade. In the Patriot ending, you faithfully follow orders, accomplish all the tasks set before you, become the hero of the story ... and die a horrible death at the hands of your superiors. In the Renegade ending, you are bold enough to defy orders and explore the environment to learn its terrible secrets, trusting that your protection will keep you alive while your former allies and commanders seek to kill you.

One more thing about this game -- if you die, you die. There are no continue points. There is no "go back to last save". You are dead, and the story will adapt and pick up from there. You'll most likely play as another character at this point. After a certain point, if you're stupid enough to kill off all the "good guys", you'll eventually end up playing as the villain (don't quite have the villain defined yet), and since there's nobody out to kill you, you won't die. In this sense, there are a multitude of ways that the game could end, on top of the two different paths that you can choose while still playing as the main protagonist.

==========

I stated in the first post that will be very minimalist, and will be based on simple geometry and plain colors. This is because 1) i'm a terrible artist, 2) it's a lot easier to create, render, and animate a cube or ellipsoid than it is for a complete humanoid model, and 3) i thought that it might look cool and set this game apart from most other games, even the "pixellated" ones like Minecraft and FEZ. This means that most of the game will not be eye-popping, but it also makes for simple level design, and in my opinion will allow the other aspects of the game to shine more.

At the same time, i won't be afraid to use hyper-vivid imagery when i really need to make a point. Since the rest of the world is so simple and fast/easy to render, this means that when i need detail, i can put a lot more detail into those scenes than i would be able to if i was detailing the entire world. It will also make those scenes pop out that much more.

For example, suppose you come across a section of the laboratory that you were not supposed to be in, but forced your way into anyways. (A lot of places that look like they're sealed off by the game will be accessible if you try hard enough. I want this to be as open-ended of a world as possible.) Doctors and scientists represented by light blue ellipsoids of varying sizes flee the scene as you assume control of the plain white area. The automated built-in security system, represented by red rectangular prisms, opens fire on you, but you manage to neutralize it using any number of the methods available to you. You scour the area for clues, read log files stored on the local database, and look for anything else hidden behind locked doors. You manage to find a door labeled as "Quarantine" which was sealed off just yesterday according to the logs. Figuring you'd be able to withstand anything that might be inside, you open the door; it slides into the wall to reveal a completely black room. The door seals itself shut behind you.

This is the part where it gets vivid ... feel free to skip this paragraph if you can't stomach it. In this room, you see a couple of lamps hanging from the ceiling -- the long kind that uses the tube bulbs. They spark and fluctuate in intensity as they try to funcion after sustaining damage. The inconsistent, yellow light reveals a standard operating table in the middle of the room, surrounded by the instruments that surgeons would normally use to save a patient's life. The table and tools surrounding it are covered in a deep crimson blood that has started to coagulate and form narrow, sticky stalactites. Thrown about the room are the patient's entrails, flowing out of several large, precise incisions made in the patient's chest and abdomen. Its flesh has begun to rot and decompose, but due to the sanitary conditions of the room, there are no infections present. The patient's face is no longer recognizable as a face; it looks as if its features had been deliberately removed and replaced with blank skin, except fot the eyes, one of which has come loose of its socket and rests on the table, attached to the patient's head by nerves. But look closer -- You find that the lungs have been moved and the heart has been displaced. You turn off your hazard shield as you approach the table and (attempt to) lean over lean over to find where its heart could be... and when you find it, it's still beating. It's been moved a good foot and a half from where it should be located, but most of the nerves are still attached to it, and the arteries and veins hooked up to it are still there, although they have been torn from being stretched so far, and are leaking out fresh blood. The patient's head tilts up, and it discharges black liquid from its mouth. And it screams. Out of agony and wrath and righteous fury, the patient screams and attempts to strike you with their left arm. But le vlicak is quicker, and it activates the hazard shield before they are able to connect the blow, and you witness their entire arm disintegrate as it strikes your stomach. A part of their hand flies off to a distant corner of the room, and the patient writhes and shrieks for several seconds. You can see that their shoulder is hardly bleeding, and what blood it does leak is foul and dense, probably because they have lost so much already that none was left in their appendages. Then they grab the railing of the table with their right arm, and attempt to hurl themself off the table, but they get entangled in their own intestines and end up miserably, disgracefully falling on the smooth concrete floor. The awakened patient, still shrieking in the face of death, wastes no time in leaping at you, with their right arm outstretched. You attempt to sidestep, but their forearm ends up vaporizing against the impenetrable shield that le vlicak offers. They end up ramming into the wall; their tethered eye gets caught between their skull and the wall, and ruptures under the force. Howling in pain, the patient puts what is left of their right arm against their empty eye socket, and then comes at you, their cornered prey -- head first, teeth bared aggresively, its one remaining eye black from rage and blind hatred. You don't have time to move out of the way this time; they ram into you, and their head and torso disintegrates against you. Their legs and what remains of their abdomen collapse in front of you, slowly vaporizing where they come into contact with you.

Overcome by what you have just been party to, you collapse to the floor as your hazard shield automatically deactivates. And she weeps bitterly over the death of the human which she alone witnessed.

As you step out of the operating room, you once again enter the plain white laboratory. The monotony and serenity gives you an opportunity to reflect on what you had seen. Was human life really that worthless, that it could be tampered with to that extent? Who had the right to determine which soul would undergo such a procedure, and which soul would be spared the torturous death? And you realized ... Nobody had the right to do such things, but that didn't matter. What mattered is that someone had the power to accomplish such fiendish tasks, and that they were more than capable of exercising it. You thought about how to stop such things from happening again, how to make them gain respect for other human life, or destroying them if that wasn't possible...

Okay, now tell me that wasn't cool.

==========

As far as current progress on the game, i um ... um ... kinda scrapped the whole thing and began re-writing it. It was too slow to haggle with all of those OpenGL VBO's and VAO's and states and whatchamacallits. So i decided to find an external library to take care of the nitty gritty for me, and settled on irrLicht after some comparing. It's working pretty nicely right now, but lacks built-in font support ... so i have to fix that before proceeding. :(

Tuesday, June 10, 2014

Minecraft's authentication services went down today. I went to check Mojang's blog to see if there was any information, and i came across this instead:

Yes, i missed the deadline by like five days. I was at a family event all weekend ...

Being self-taught, i don't know much about security or encryption or things like that. But i am considering this to be that one last push that finally convinced me to get into things like this.

I want the game to have some sort of multi-player capabilities. I honestly have no idea how i am going to implement this, but i know that it will be some sort of hybrid between single- and multi-player (maybe another player controlling a boss or something) and i want it to integrate seamlessly with the single-player story mode. (Speaking of that, there will be permanent, story-altering consequenses for dying.) I'm going to need some way of securing connections and even downloads of the game, but i won't get into that for a while.

I'm going to be switching to a Linux-based operating system for my application development. I am considering something popular like Ubuntu, but after a very small amount of research i think i am going to try and make Tails work. Don't worry, i will be cross-compiling once the whole thing is written, so it will be available for Windows, OSX, and other Unix systems as well.


Monday, June 2, 2014

Okay, things are moving along much better now.

--insert witty commentary here--

I got the HUD working, just like i said. It did take quite a bit of trial-and-error but it was one of the easier things to get working. In order to implement it, i had to implement image blending using the SRC-OVER method (i had just been doing full-on replace before). So now i can put images with partial translucency on top of each other and it will look just fine.

I also implemented font loading and rendering; i have a single function utilizing stb_truetype which i pass a UTF-8 string, and it gives me a bitmap that i can draw. The font you see there is the Ubuntu font; i'm probably going to use it as my primary font because it's pretty and it covers a decent portion of Unicode's Basic Multilingual Plane. I'm looking into using CODE2000 as my fallback just because by far it has the largest coverage of Unicode out there, and i want to put this game into as many languages as possible. The only problem with that is ... i don't know what license that font is under, and i don't know how to contact the author in order to check. This is something i will have to look into and solve before the game's release.

I also changed how you move around (it's intuitive instead of along the x/y/z axes) and changed some event loop things to make them betterer.

Next up: Making a snazzy main menu!

Tuesday, May 6, 2014

I bought a copy of Sim City 2000 the other day. It was one of my favorite computer games many many years ago, and figured i'd take another crack at it. Turns out it is so old that it refused to run on my fancy Windows 8 computer, so i had to download DOSBox to get it to install.

I'm watching the installation screen right now ...

Trippy.


Maybe i will do something like this for my game. A sort of throwback, using this style, like they did back in the nineties. When they didn't have fancy graphics or bloated programs, because they didn't need them. I liked that.

Monday, May 5, 2014

Tada! I did it~ Finally, texture mapping is working just as it should be.

(Left) What my model looks like in-program. Note that the camera is in quadrant I looking toward the origin. (Right) The texture that i used for all six sides of the cube, 16px by 16px. The arrow is white but its alpha is 0, so it is transparent.

Writing the shaders and texture loading code was easy enough, but i was stumped on an elusive bug for the better part of the past three days. Everything would load correctly, my shaders compiled and linked with absolutely no problems, OpenGL never reported any errors ... and all i got was a black cube in my debug build, and a mono-colored cube in my release build.

After spending a couple sleepless nights figuring out what could possibly be wrong with my code, i stumbled across a random question on Stack Overflow that demonstrated the same problem. Turns out, i had the following two lines in my shaders:

out vec2 texcoord; //vertex shader
in  vec2 vt; //fragment shader

I figured, "Oh, those two variables are the same type. OpenGL will understand that they're the same thing." This is like calling a friend by a completely different name because that's the name you felt like calling them at the moment. It just doesn't work.

So yeah, of course it was a stupid mistake that involved modifying eight characters in my code.

Now this is still a little bit broken; notice that the texture image has transparency where the the arrow is, while the model in-program displays a white arrow. Also, my debug build is still broken; i only get a black cube still, and i haven't the foggiest clue why. I'll just live with it for now.

I suppose the next step is creating a main menu and language bindings, which will probably involve figuring out how to overlay things over the main window (think of a typical HUD in a video game).

Friday, May 2, 2014

Life thingies have been getting in the way a lot recently, but i decided to throw that all off in pursuit of this project. Probably not the best idea .. money is running out and i can't keep ignoring reality for too much longer. But i will ignore it as long as i can because i absolutely love doing things like this and i have no sense of responsibility.

OpenGL's shaders have been particularly tricky. I don't know why, but sampling textures has consistently stumped me, and i can't figure out how to draw anything besides that tetrahedron (or how i drew the tetrahedron to begin with).

So i did a bit of research and figured i would need a modeling program to make these 3D environments with. After trying Blender and getting lost and led in circles for hours, i decided to use Sketchup instead.

Yes, i totally ripped off Minecraft's dirt texture. I needed something quick and (no pun intended) dirty to test with. I added random transparent pixels for testing/debugging. In case you wonder, the green numbers on the bottom-right is Bandicam, the best app/screen recording software i've found to date.

Turns out Sketchup is really intuitive. I can specify textures for surfaces of things, and position those textures however i want on the surface. And it exports in the OBJ file format.

After reading around on the Internets, it seems that it's pretty expensive to parse and read in the OBJ format in real time. Which makes sense, considering it is a plain text format. The OBJ format exported by Sketchup also has its limitations, like each project needing its own set of material files that cannot be shared between projects. So in addition, i decided to write an intermediary program that would convert the .obj and .mtl files produced by Sketchup into my personal .vbo and .vbm (binary object/material) file formats.

The file format specification for my personal binary object file format, along with all the data from the above cube for testing. The pony is mandatory. She keeps the peace when the file format decides to become chaotic.

The quick-and-dirty conversion program is about 650 lines long and works great. The file format is fairly straight-forward, and it should be easy to write a loader that i will put directly into lo_mipri. I am getting started on that now. Once that is finished, i will look for a way to write a fragment shader that will allow me to actually show the dirt cube ...

Friday, February 7, 2014


Ladies and gentlemen, welcome to a brand new era in lo_mipri. I have officially gone 3d.

It took long enough, eh? Well the perspective projection algorithm had me stumped for a good long while (about 6 weeks) so that kind of slowed things down. But in the meantime i had added support for .obj files and GLSL vertex/fragment shaders to be read in plain text and stored in the resource archive i will be shipping with the program.

It took some time to write code to parse this kind of file ... even though this is fairly simple compared to other 3d object file formats.

So basically what the thing does is reads in a test object file and displays it on the screen. I use WASD and left shift / space to move around, and the mouse to look around. It still needs some help ... i think i have accidentally used a left-handed coordinate system instead of the traditional right-handed one so that will need fixing, and the controls need to be changed so forward actually moves you forward instead of along the X-axis. But it's getting there.

Soon to be added, with any luck, is an actual player hitbox and maybe some collision testing for the walls of the level. I will need a completely new level format since it's in 3d now though. But that's okay ... just takes time.

Inside of the tetrahedron. I think i might use something similar to this for the panorama on the menus, like i did back in 2d.