Categories
Uncategorized

Physics Mayhem

In my forays into Unity physics I am all too tempted to toy with the silly quirks that can manifest. This last week I have been attempting to replicate a mechanic that is common in many games: The clicking and dragging of objects on the ground. It frequently shows itself in puzzle games, and one could argue is the central concept upon which all sim games are built. The ability to place structures or construct buildings is what makes many games fun.

There is an odd problem with implementing these mechanics. While one can clearly see the position of their cursor and the intent of their designs from behind the light of their glowing screen, in the game world the user is moving their cursor on a completely different plane than what their eyes see. A cursor can travel up and down, left and right on the axis of their monitor, and this functions perfectly well in 2D games, however there is a problem when a 3rd dimension is added.

Such cursor movements do not accurately represent depth. A cursor is NOT actually moving along the ground, or distant objects, it’s permanently pasted the the face of your screen. This means it can be difficult to distinguish where objects are actually meant to be deposited by that cursor in 3D space. You may mean to click on the ground a distance away, but the game doesn’t know if you meant to do that, or to place an object right in your face.

This is a problem that inevitably rears it’s head in any game that involves accurate cursor clicks in a 3D space, and fortunately there are multiple solutions to it.

One simple answer is to identify the exact object that your mouse clicked. This is actually relatively simple. Unity can fairly easily identify objects that the mouse is hovering over. This solution works perfectly well in games that require identification of distant objects. Unfortunately it does not provide accurate placement, and so in our case of placing workbenches and tables on a factory floor in deliberate and organized manner, will not suffice.

This led me to find a better solution: Ray tracing! This is a term that I had heard in passing for years, though usually to do with lighting effects in games. The way it works is by drawing a line from the center point of the camera, to the position on the mouse on the screen, and then following the direction it extends. Unity can further identify the next object that the ray will hit. This method allows for fast and easy interaction with a 3D environment.

This will be the method I rely on for the placing of objects in this project, though It can be used for other tasks with further applications. I believe I can use it to move, delete, and even track the position of objects, and I am excited to see what other tricks I can pull in this engine.

Categories
Uncategorized

First steps for building a game

I made a game recently. My further research into the Unity engine has brought me to the predictable position of constructing my own game. This is an event that I doubt many would expect not to occur.

It’s a simple game. the player controls a red cube, and dodges a series of grey blocks. Different sequences of blocks give the game a unique set of levels, and included are limited interface components that provide a score display, and indicate success or failure. I’ve seen plenty of similarly simple toys across many gaming platforms, but I’ve grown quite fond of this one for the plain fact that I made it myself.

Granted, I didn’t make it all on my own. It was put together by following a series of guides and tutorials that were created to instruct and inspire others on the capabilities of the Unity engine. In this, these videos has been successful. I feel like I have a much better understanding of the capabilities of this engine, and am intrigued by the creative possibilities.

I have a much greater appreciation of the Unity tools. Before this I feel confident in my ability to generate fun and interesting games by writing in simpler languages, and by constructing physics engines or mesh generators from scratch. A part of me still has ambition to produce games in such a manner, but I still have newfound respect for the features that Unity can provide.

My task for now is to attempt to find relevant tutorials and guides that will help me produce a product more similar to our assigned project. If I could find a video series that covers creating a sim-city-esque game, or one that provides good content on pathing information would be boon to our production.

Categories
Uncategorized

The Elder Scrolls Days

I remember years ago when I first saw Bethesda’s creation engine. This was back when Morrowind was the newest entry into the franchise, and though i was quite young I was still fascinated with the possibilities of the provided modding utilities.

I was quite the little terror to the mild-mannered denizens of the ashen isle. I lacked the drive and perseverance to make progress on any quests to save the realm, but I was more than happy to run amok, spewing forth magic and playing pranks on the locals. I was content with my hijinks and never even made much progress in any direction before losing interest and starting over with a fresh new unscathed character.

This mayhem was only exasperated by the discovery of the creation engine. With it I could provide myself end-game equipment, rare magical weapons, and spells. This satisfied my curiosity and gave me hours of entertainment, but eventually my interests diverted to senseless mayhem and I discovered the creative power of the creation engine. Inspired by assets in the game, I enchanted the world with a myriad of strange wonders. I expanded cities far beyond the original design, I built vine-tangled fortresses like something out of a fairy tail, and I created all new dungeons, complete with loot and monsters. Despite the fantastic additions I made to the game, I never deigned to finish a full playthrough. Morrowind remains an item on my bucket list, and I foresee little chance of crossing out this entry any time soon.

My tinkering in Unity has reminded me of my time modding Morrowind. There are many similarities in the two engines, though Bethesda’s utility has far narrower scope. Unity is new in this regard, as it is designed to allow the user to make many different types of games. So far I have created several fun interesting little toys in unity, and can even imagine myself making an entire complete project of my own sometime later in life. For now the priority is in learning it’s many features, and preparing to implement the features of our group assignment. I can now see how we might create some of the functions of the final application, but there is still plenty to learn.

Categories
Uncategorized

Virtual Reality Reassessment

I am unconvinced that the integration of VR support into our project will be a significant portion of the work to be done. Unity has some VR capabilities and plugins that can make the transition from monitor to headset smoother, but the bigger deal will be optimizing movement and interface controls.

For navigating a 3D environment and observing, this feature should be fairly simple to build. There is little difference between outputting video feed to a single monitor vs generating a unique picture perspective for each eye. Many a video game mod developer has been able to create VR mod by simply editing the camera perspective, and I believe that the process will be even easier with engine support.

The more difficult task will be building interfaces and controls for movement or other interactions with the 3D world. A keyboard and mouse provide both a plethora of control inputs and excellent precision. The handheld accessories that come with many VR headset models however have a comparatively limited selection, and can interact with virtual environments in whimsical and weird ways. The larger problem on top of this is that the implementation of a VR interface will likely have direct repercussions to the development of the more intuitive keyboard and mouse systems. I fear that by attempting to integrate VR support, we will make the project much more difficult and require a far greater time investment to provide a working product.

An alternative that to me sounds like a happy medium would be to build a system that relied upon mouse and keyboard control to access the greater majority of customization options, but still allowed a user to wear a headset and observe the environment from the unique VR perspective. Implementing joystick controls would also be fairly easy to do. The end product would grant users the full capabilities of a desktop interface, and still allow a user to observe their creation from an first-person perspective.

Fortunately my team is in agreement that the designing of VR integration is a lesser priority than simply constructing a working prototype for desktop systems. I would be more than happy to shift gears to cracking the VR code once we are in a comfortable position with a robust product. I only hope our client will be satisfied with this strategy as well.

Categories
Uncategorized

Strike the Earth!

I was quite pleased with our latest group client meeting. Each of our prior interactions left me with the impression that despite the significant amount of work that has gone into our project before we were introduced to it, the current developers don’t have a solid vision for the final product. While this cold be disconcerting (and indeed did feel like a source of tension for the lead), I find the notion freeing. I would be satisfied with, and likely perform admirably on an assignment that had a very clear, set-in-stone blueprint, but now with the revelation that the final concept is a little foggy it gives our group some wiggle room to implement our own ideas.

I’ve worked in several software development firms, and have noticed a bias in many senior engineers that has always rubbed me the wrong way. Many professionals dislike association with the game design industry, and will balk at the notion that the work they do could be compared to such frivolous hobbies. Attempts to argue for the innovations in intuitive systems, or out-of-the-box design that is prevalent throughout the industry have only served to frustrate my coworkers and alienate myself as an unprofessional enthusiast. Despite this, I maintain that there are many lessons that game design can teach to not only software engineers, but any professional from just about any field. Now that we have been given free reign to implement our own ideas, I have expressed the ways in which our project shares similarities with games, and am pleased that my group agrees.

with all the talk of simulating workers running to and fro, moving equipment, and completing tasks, I am reminded of a lesser known game called Dwarf Fortress. The game is the project of a small group of developers, that originally released it’s first (and very alpha) version in 2006. While seeming to be at first glance an incomprehensible mess of ASCII gibberish, the game utilizes a very simple interface of letters, numbers, and symbols to simulate a very complex and vibrant fantasy world. The game is a sandbox where the player is given control of a merry band of dwarves that set out to find their fortune and tame the wilderness by building a mighty fortress, mining valuable ores, and crafting wondrous treasures. The simulation itself is incredibly intricate, and even subtle attitude changes, or physical statuses are registered and can impact the gameplay. One only needs to look up “Dwarf Fortress Stories” to find a flood of shockingly descriptive tales depicting player’s experiences overseeing their dwarven workforce.

“Simulated workers engaging with their environment to complete tasks and maintain a workspace constructed by user design”- sounds kinda like a description of our factory design project, doesn’t it?

There are plenty of obvious things that anyone could point out as being unrelated to the task at hand. I would justifiably receive incredulous looks if I suggested using an ASCII interface, or attempted to implement the ponderous (and a little insane) psychology of fantasy creatures, however I maintain that there are many lessons in the design of this game that we can apply to our project. For that matter, Dwarf Fortress is only one example. The Sims, Minecraft, and many other games have lessons that can be applied to the very professional and no-nonsense utility us engineers are contracted to create. Now that we have some leeway to implement our inspirations, I fully intend to use my knowledge of game design to make the best utility I can.