Critical Hit Creations

Prop replicas, writing, and creative hobbies

Game Development: 1.Background and Introduction

No comments

Background

I am a software engineer currently specializing in Microsoft technologies, particularly C#, ASP .Net MVC, and Team Foundation Server development. I have an undergraduate and Master’s degree in Computer Science, with a foundation in Java, algorithms, software architecture and design, nets and comms, real-time systems. I have always worked to extend my core Software Engineering, Algorithmic and development skillset beyond what I have used in university or work, particularly within the realm of digital media, learning new skills and seeking ways to apply my knowledge within the domain. Aside from 3D modelling in Blender over the years, I have taught introductory courses and lectured in 3D graphics to Computer Science students.

I have a strong background in complex system simulation, particularly systems dynamics, agent-based modelling and artificial intelligence, and the possibilities of the systems that can be simulated and the application of such simulations has always intrigued me. Through my undergraduate thesis and Master’s work I have sought to combine my knowledge and learning in complex systems with my interest in digital media, particularly video games, exploring the application of complex systems simulations within video game environments. 

Undergraduate Work

For my final year thesis, I developed an urban dynamics simulation engine, which could take a collection of defined urban systems, such as population, food production and consumption, and economy, and simulate their interactions over time to represent the development of an urban area.  
Population Model

I primarily develop in C#, so once I had created the simulation engine, I decided to add a graphical front-end and game-like interactions using the XNA Game Framework. With XNA, I was able to aggregate the data being returned from my engine and represent the state of the urban system in a game world, which consisted of 3D models of buildings laid out on a 2D grid. For example, a population system in the engine contained population separated into low, medium and high density housing. This system was represented graphically as a section on the grid containing small houses, terraced houses and apartment blocks corresponding to the population in each category. For user interaction, I added a 2D GUI which allowed players to make decisions that would add additional systems and open flows in the simulation. If the residents were going hungry and the player had amassed enough money, they could zone a new farming area, which would add a new food production system to the simulation and hopefully support the population’s needs over time, for example.

Masters

After finishing my undergraduate degree, I went on to do a Masters in Computer Science, specialising in multi-agent systems and reinforcement learning. Whereas my undergraduate complex systems studies focused on aggregate approaches, my Masters explored the simulation of individual agents and their interactions to drive a complex system. I sought to use complex system simulation to drive a town of Non-Player Characters in a game environment. I used Reinforcement Learning artificial intelligence techniques to create goal-driven NPCs that learned actions over time. Each agent was assigned a resource it sought to gather, and had to learn how to attain the resource, either by producing it themselves, working with others that were skilled at producing the resource, or trading the resources they produced for the one they wanted. I proposed a Social Graph structure to capture the relationships between the NPCs, allowing agents to make decisions based on their relationships with others, and affecting these relationships based on the outcome of interactions.
As with my undergraduate work, I built the simulation engine in C# with XNA. I created a simple visualisation to aid in understanding the processes of the simulation (in the above image, the large squares represent buildings, the small squares are their entrances, and the blue spheres are the agents). The simulation ran in real-time, with agents making decisions and learning from the outcomes. In order to allow the agents explore their environment, I used a graph-based implementation of the A* pathfinding algorithm. As the environment was being initialised, the engine would place pathfinding nodes in open space at the corners of each building. These nodes were connected into a pathfind graph, and a pruning phase was run to remove any nodes that did not contain unique information. When an agent wanted to navigate somewhere, it would find the nearest reachable pathfind node, and use A* to discover the best path to the node nearest its destination. Additionally, I used a Sweep and Prune system for collision detection. In this approach, all collision objects were sorted along a single axis by the minimum coordinates of their bounding box. Going through the ordered list, objects that did not overlap on the axis could be trivially identified by comparing their minimum and maximum coordinates. These objects could be dropped or “pruned” from the list, while objects that did overlap on the list went through a further phase of testing for collisions. 

Pathfind Graph (Buildings in green, graph in orange)

Post-University

While I am now working on enterprise software development with Microsoft technologies in my day job, I continue to develop my skills in digital media and game development in my spare time. I have taken a break from complex system simulation, and have been learning the more core aspects of game programming: interaction and game mechanics, graphics and rendering, game environment creation. I’ve continued working in C#, but as XNA is no longer supported, I’ve moved to MonoGame, and open-source port of the XNA Framework. Many of the features are identical between the two, so there is a lot of transferrable knowledge, but certain functionality behaves differently, particularly with content management and rendering, as MonoGame offers cross-platform support. I have been working in Visual Studio Express 2013 and back everything up to my source control repository on BitBucket using the Git integration in Team Explorer with Visual Studio.

I have been applying what I have been learning to create a game engine, including menu systems and screen management, input handling, UI layout, inventory systems, game state management and scene decomposition, 3D geometry creation and rendering. In following posts, I’ll look at how I have gone about implementing some of these components.

No comments :

Post a Comment