<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Will Ricketts</title>
    <description>The latest articles on DEV Community by Will Ricketts (@willricketts).</description>
    <link>https://dev.to/willricketts</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F108307%2F65401b1e-4fab-4c84-ae24-4f04dedcd0f5.jpg</url>
      <title>DEV Community: Will Ricketts</title>
      <link>https://dev.to/willricketts</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/willricketts"/>
    <language>en</language>
    <item>
      <title>Rhea's Galaxy Map</title>
      <dc:creator>Will Ricketts</dc:creator>
      <pubDate>Sat, 15 Feb 2020 18:21:17 +0000</pubDate>
      <link>https://dev.to/willricketts/rhea-s-galaxy-map-116l</link>
      <guid>https://dev.to/willricketts/rhea-s-galaxy-map-116l</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/willricketts/introducing-rhea-46p2"&gt;last post&lt;/a&gt;, I covered the various game titles and mechanics they utilize that I've drawn inspiration from for the design of Rhea. In covering Rhea's galactic map, I'd like to focus upon two of them heavily-- Eve Online and Stellaris.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inspiration
&lt;/h3&gt;

&lt;p&gt;Eve Online and Stellaris have very similar map systems. Both have solar systems represented in a DAG-like structure. The DAG's nodes represent solar systems. In the case of Eve Online, this structure's edges are representative of Stargates, and in Stellaris, warp lanes between solar systems.&lt;/p&gt;

&lt;p&gt;In any case, both systems function in a similar way, in that players and their fleets traverse a large DAG to move around the galaxy.&lt;/p&gt;

&lt;h4&gt;
  
  
  Stellaris
&lt;/h4&gt;

&lt;p&gt;Based on a system of ephemeral matches, Stellaris's game maps are generated uniquely for each. Thus, each time the player creates a new empire or species and starts a game, a new map is generated and configured via the player's selected settings when creating the game.&lt;/p&gt;

&lt;p&gt;One of the major strategies when starting a game of Stellaris is to rapidly expand to claim and build defenses around choke-point systems, or systems that have many connections as to control the flow of traffic through that portion of the map. This is a side-effect of this galactic map model that I'm intent upon creating.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aOjsFedu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/stellarismap.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aOjsFedu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/stellarismap.jpg" alt="" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Eve Online
&lt;/h4&gt;

&lt;p&gt;Eve's map is persistent, in that the game has no concept of "rounds" or "matches." The game map, save for additions by their publisher, has and will remain the same since the release of the game in 2003. Being that the intent of Rhea is to be a single persistent game world, this is the path I've elected to follow.&lt;/p&gt;

&lt;p&gt;Some very desirable but non-obvious effects arise from this kind of model for a galactic map. With a static map, various regions or sections of it become known within the playerbase for being better or worse to own from a strategic perspective. Eve has regions of the game that are notoriously difficult to invade, and has a few that are notoriously favorable for an invading military to stage their assets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y6SofbxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/evemap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y6SofbxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/evemap.png" alt="" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Generating the Map
&lt;/h3&gt;

&lt;p&gt;Creating a map of this size and detail was a challenging problem to solve, and at the time of this writing, still presents obstacles to overcome to achieve an optimal map structure.&lt;/p&gt;

&lt;h4&gt;
  
  
  First Attempts
&lt;/h4&gt;

&lt;p&gt;When I first sat down to work on figuring out the most immediate challenges in building Rhea, my intent was to get something simple working and then expand upon the idea later. Upon researching how I would go about generating a map of this nature with DAG-like properties, I found &lt;a href="https://www.nbos.com/products/astrosynthesis"&gt;Astrosynthesis&lt;/a&gt;, a piece of software used for generating celestial structures primarily for role-playing games and hobbyist world-building. This program had a bunch of great features that'd be useful for my needs, but two features stood out in particular. Astrosynthesis has a user-created plugin ecosystem and an XML exporter. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1sLhCIv1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/astrosynthesis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1sLhCIv1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/astrosynthesis.png" alt="" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before long, I had a galaxy containing ~20 solar systems and connections between them, which I exported to a large XML document, which I was able to load into the Elixir-based backend of Rhea with &lt;a href="https://github.com/homanchou/elixir-xml-to-map"&gt;elixir-XML-to-map&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using the Data
&lt;/h4&gt;

&lt;p&gt;From this &lt;em&gt;very&lt;/em&gt; large map, I perform a series of mutations on the data to order it into a list of Solar Systems and one of Gates. With these lists, I first created a DB record for each of the solar systems within PostgreSQL. With a SolarSystems table populated with data, I would need to represent the data somewhere that graph-oriented data feels right at home. This is where &lt;a href="https://neo4j.com/"&gt;Neo4j&lt;/a&gt; comes into play.&lt;/p&gt;

&lt;p&gt;If you're unfamiliar, Neo4j is a graph database. This turned out to be the perfect tool for Rhea. It was immediately apparent that its Cypher query language had the features needed to power several in-game systems for Rhea. Namely its ability to find the shortest path between nodes, or in the domain of Rhea, solar systems.&lt;/p&gt;

&lt;p&gt;Claiming victory over my first set of development goals, I took a 2-month break from working on Rhea to focus on a large project I was leading at work, a large web service responsible for creating and marshaling Twilio conference calls in parallel-- also built using an Elixir umbrella, also structured with the intent of utilizing BEAM's distribution features in the future.&lt;/p&gt;

&lt;p&gt;When I finally had time to devote to Rhea again, I revisited the map I'd generated and simply wasn't happy with the result. After generating entirely new map data, this time for 2000 solar systems, I was dismayed to learn that the XML schema for my new map data was fundamentally different than that of my previous map. This would require me to write an entirely new parser and process for loading the map data into PostgreSQL and Neo4j. This was unacceptable to me.&lt;/p&gt;

&lt;p&gt;Not being comfortable with the idea of such a pivotal piece of the system relying upon a proprietary dependency, I started exploring ways of generating my own map from scratch, but how?&lt;/p&gt;

&lt;h4&gt;
  
  
  Enter Diffusion Limited Aggregation
&lt;/h4&gt;

&lt;p&gt;A while back, I was reading about &lt;a href="https://en.wikipedia.org/wiki/Brownian_motion"&gt;Brownian Motion&lt;/a&gt; and the aggregation of particles to form a structure. After diving back down that rabbit hole, I discovered &lt;a href="https://en.wikipedia.org/wiki/Diffusion-limited_aggregation"&gt;Diffusion Limited Aggregation&lt;/a&gt;. This seemed to be the ideal method for generating a structure akin to the galactic maps of both Stellaris and Eve Online.&lt;/p&gt;

&lt;p&gt;I found a simple &lt;a href="https://github.com/fogleman/dlaf"&gt;C++ implementation of DLA&lt;/a&gt; and quickly generated a set of 2000 particles. This algorithm has a CSV output of the following schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id, parent_id, x, y, z
0,-1,0,0,0
1,0,0.934937,0.354814,0
2,0,0.0525095,-0.99862,0
3,1,0.989836,1.35331,0
4,3,1.92472,1.70826,0
5,3,0.65572,2.29584,0
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;EUREKA!&lt;/p&gt;

&lt;p&gt;That was precisely what I needed to generate a fully original map! I built out each point as a Solar System in Postgres and Neo4j with its coordinates. After reducing the list down to a collection of IDs and Parent IDs, I was then able to build the stargates that connect the various solar systems together.&lt;/p&gt;

&lt;p&gt;Originally, &lt;a href="https://gist.github.com/willricketts/dfc4e2ce63d8a9934434d18cdb860510"&gt;I built a name generator to automatically name each Solar System&lt;/a&gt;, but this was quickly outgrown and I was once again searching for a solution to unblock my map work.&lt;/p&gt;

&lt;p&gt;After finding a &lt;a href="https://github.com/hbi99/namegen/blob/master/namegen.js"&gt;super slick name generator built in Javascript&lt;/a&gt;, I was able to give each solar system a unique name that doesn't sound like a Heroku deployment.&lt;/p&gt;

&lt;p&gt;Below: the final structure of my fractally generated galaxy map:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TalIQaqV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/rheamapsmall.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TalIQaqV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/rheamapsmall.png" alt="" width="800" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below: a closer view of a group of solar system:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iwejL6YF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/rheamapclose.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iwejL6YF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/rheamapclose.png" alt="" width="800" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Future Plans
&lt;/h3&gt;

&lt;p&gt;Having a totally original galaxy map with a predictable and repeatable process for generation opens up all sorts of possibilities for new features and clever tricks. Having tied all of the generation and persistence process to a single function in the backend, rebuilding the map and trying generation with different inputs takes a matter of seconds::&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="n"&gt;build_universe&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;construct_map_db&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="n"&gt;construct_graph&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Universe created"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# I couldn't resist writing a function called "destroy universe"&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="n"&gt;destroy_universe&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="ss"&gt;:ok&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;async&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="no"&gt;Main&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;destroy_map_db&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="no"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;async&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="no"&gt;Main&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;destroy_graph&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="no"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;await&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Universe destroyed"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Wormholes
&lt;/h4&gt;

&lt;p&gt;If you're familiar with graphs, then you were probably left wondering why I refer to Rhea's map as a &lt;em&gt;directed&lt;/em&gt; acyclic graph as opposed to an &lt;em&gt;undirected&lt;/em&gt; acyclic graph. Rhea's stargates are represented in its persistence layer as pairs of gates, each unidirectional. This enables me to, at some point, build a wormhole system in which a player's fleets can travel from one part of the galaxy to another instantly, but perhaps not return home through the same wormhole.&lt;/p&gt;

&lt;h4&gt;
  
  
  Tactical Structures
&lt;/h4&gt;

&lt;p&gt;Perhaps I'll introduce a player owned structure that prevents enemy fleets from leaving a Solar System once they've traveled through a stargate. This would lead to a much more robust system of player combat tactics and provide an overall more engaging experience, possibly allowing the few to overcome the many in a fleet engagement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;The map is far too linear, and this needs to be fixed before proceeding. This is my primary development item on the project, and I'm currently working on an algorithm that utilizes Solar System coordinates to create connections between solar systems that share a geographic region with one another. I assure you that will get its own blog post :)&lt;/p&gt;

&lt;p&gt;For now, I'm happy enough with my work to begin sharing the obstacles I've overcome in building the game I've always wanted.&lt;/p&gt;

&lt;p&gt;Thanks for reading, and I'll see you in the next post.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>indiegame</category>
      <category>elixir</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Introducing Rhea</title>
      <dc:creator>Will Ricketts</dc:creator>
      <pubDate>Fri, 14 Feb 2020 06:01:23 +0000</pubDate>
      <link>https://dev.to/willricketts/introducing-rhea-46p2</link>
      <guid>https://dev.to/willricketts/introducing-rhea-46p2</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9khixF6R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/scifi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9khixF6R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/scifi.jpg" alt="" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Over the last several months, I've been working on the backend for a lofty project. While not &lt;em&gt;that much&lt;/em&gt; of a PC gamer, I generally focus on two types of games:&lt;/p&gt;

&lt;h3&gt;
  
  
  Grand Strategy / 4x (explore, expand, exploit, exterminate)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.paradoxplaza.com/europa-universalis-all/"&gt;Europa Universalis 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.paradoxplaza.com/hearts-of-iron-iv/HIHI04GSK-MASTER.html"&gt;Hearts of Iron&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.paradoxplaza.com/stellaris/STST01G-MASTER.html"&gt;Stellaris&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.paradoxplaza.com/crusader-kings-ii/CKCK02GSK-MASTER.html"&gt;Crusader Kings 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;
  
  
  Sci-fi Sandboxes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.eveonline.com/"&gt;Eve Online&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[the idea of] &lt;a href="https://robertsspaceindustries.com/"&gt;Star Citizen&lt;/a&gt; (lol if it ever comes out)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://planetarion.com/"&gt;Planetarion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Aside from Star Citizen, due to the possibility of it being vaporware, all of these titles have been staples of the last several years of PC gaming for me-- especially Eve Online, Planetarion, and Stellaris.&lt;/p&gt;

&lt;p&gt;Each of these games have unique characteristics that I really enjoy, but I've always thought about what it would be like for a game to incorporate all of them in harmonious union. Eve Online's metagame, political intrigue, complex player-driven economy, and expansive universe create an immersive third person experience with an extremely high skill cap. Stellaris focuses more on developing and scaling an empire from the perspective of its leader. Planetarion shares with Stellaris its perspective, but is a tick-based game played largely in text within a web browser, making it extremely portable and not totally married to a client with its own specific system or platform needs. To distill these properties into those that inspire the dynamics of Rhea:&lt;/p&gt;

&lt;h3&gt;
  
  
  Eve Online
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Persistent universe&lt;/li&gt;
&lt;li&gt;Player-to-player political intrigue&lt;/li&gt;
&lt;li&gt;Player-driven economy&lt;/li&gt;
&lt;li&gt;Robust industrial system&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;
  
  
  Stellaris
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Played from the context of the leader of an empire as opposed to Eve's perspective of a single pilot in a large universe&lt;/li&gt;
&lt;li&gt;Player-driven relationships with NPC factions&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;
  
  
  Planetarion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Can be played in the browser&lt;/li&gt;
&lt;li&gt;Tick-based&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Whew. There's a lot to unpack there. Suffice to say, I've had a bit of difficulty describing the project in a brief way that's easy to understand for someone who's unfamiliar with these three titles, so I've taken to describing Rhea as "a tick-based 4x space conquest strategy MMO." Most people are familiar with terms like "MMO" and "space conquest," though a bit of this might take some explanation.&lt;/p&gt;

&lt;p&gt;The tick system of Planetarion is very different than the temporal systems of most strategy games, in that a "tick" takes place every hour. A tick consists of all of the calculations required to update the game's state for the next hour. Player resource balances are updated, fleets are moved based on their course, and combat outcomes are calculated. This allows the game to be played over a longer period of time in which the players are able to set up actions to be performed, and the system will execute them over time. The player is able to note when their attention will be needed next, and can return to the game upon a tick in which they want to perform their next action.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Game
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Map
&lt;/h4&gt;

&lt;p&gt;Rhea's map is in essence, a giant DAG (directed acyclic graph) with solar systems represented as nodes and the stargates that connect them represented as the edges between those nodes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZxFP6T0L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/dag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZxFP6T0L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://s3.amazonaws.com/images.willricketts.com/rhea/dag.png" alt="" width="796" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is not unlike the maps of all three games I've used as examples and inspiration for Rhea. In my view, it's a great system, so I'll borrow from their developers' wisdom. The interesting difference in Rhea is that the Galaxy, in its current working model, contains 2000 distinct solar systems.&lt;/p&gt;

&lt;p&gt;Check out an &lt;em&gt;extremely&lt;/em&gt; early-stage rendering of Rhea's game map &lt;a href="https://rheaverse.com"&gt;here&lt;/a&gt; (edit: temporarily removed, under rework). Also to note is that this is not the final structure of the galaxy, as it's simply the initial result from being fractally generated. There's still plenty of work to be done in transforming the structure to have more interconnectedness and to be less of a corridor and chokepoint heavy layout.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Player's Position in the Galaxy
&lt;/h4&gt;

&lt;p&gt;When the player creates a character and enters the game, as of the time of this writing, they are provided a basic ship, are given some basic resources for expanding their wealth and influence, and are dropped into the game in a central area of the map in which they cannot be attacked by other players. This is a concept that was inspired by Eve Online's idea of "high security space" or "hisec." This is essentially an area of the game that's PVE (player versus environment) only in which attacks on other players are disabled. The player has the freedom to exploit the very basic resources in this area and eventually equip themselves to venture further away from the galactic center in pursuit of greater wealth or conquest.&lt;/p&gt;

&lt;p&gt;Players are able to claim space as their own, colonize planets, build facilities on orbital bodies that exploit their resources, and build defensive structures to stave off attacks and raids from other players or groups of players.&lt;/p&gt;

&lt;p&gt;Players can form organizations with other players, are able to claim solar systems on their behalf, and can go to war with other player organizations for any number of reasons-- from conquest and annexation of their enemies' sovereign space to a simple raid over an enemy's borders to pillage resources from an orbital facility.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Codebase
&lt;/h2&gt;

&lt;p&gt;I've chosen Elixir for the backend implementation of the various game services due to its wonderful ability to handle i/o bound operations with great efficiency. I also believe using a functional language is wise for building a "tick" system as a tick itself is basically a process of performing a large mutation of externally held state (PostgreSQL) in a predictable and repeated way.&lt;/p&gt;

&lt;h4&gt;
  
  
  Structure
&lt;/h4&gt;

&lt;p&gt;Rhea's backend, in its current state, is built as an Elixir umbrella with a few sub-apps handling various aspects of the game, such as its public api, persistence layer, galactic map (more on this part of the project in later posts), and a general orchestration layer, &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Aside from &lt;code&gt;main&lt;/code&gt;, each of these sub-apps exposes an interface to its various public functions as to prevent cross-application coupling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="k"&gt;defmodule&lt;/span&gt; &lt;span class="no"&gt;GalaxyMap&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Importers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;MapGraph&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nv"&gt;@moduledoc&lt;/span&gt; &lt;span class="sd"&gt;"""
  Interface for Map Graph importer
  """&lt;/span&gt;
  &lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="no"&gt;GalaxyMap&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Importers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;MapGraph&lt;/span&gt;

  &lt;span class="k"&gt;defdelegate&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;solar_systems&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="ss"&gt;to:&lt;/span&gt; &lt;span class="no"&gt;MapGraph&lt;/span&gt;
  &lt;span class="k"&gt;defdelegate&lt;/span&gt; &lt;span class="n"&gt;clear_graph_data&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="ss"&gt;to:&lt;/span&gt; &lt;span class="no"&gt;MapGraph&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Temporal Features
&lt;/h4&gt;

&lt;p&gt;Rhea leverages the &lt;a href="https://github.com/quantum-elixir/quantum-core"&gt;Quantum&lt;/a&gt; library to handle its various timed jobs, the majority of which take place when a tick is executed (every 20 minutes). Other various temporal features include scheduled statistics gathering, fleet combat precalculation, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Rhea is a large project. For a single developer working on it in their spare time, it's a &lt;em&gt;really&lt;/em&gt; large project, but it's a game that combines my favorite mechanics of my favorite titles as well as adding mechanics and systems I've always wanted to see in the 4x strategy genre. In essenece, I feel like I'm building the game I've always wanted.&lt;/p&gt;

&lt;p&gt;I plan on releasing more comprehensive posts regarding game mechanics, technical implementation, and game lore in the future. &lt;/p&gt;

&lt;p&gt;Thanks for taking a look :)&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>gamedesign</category>
      <category>indiegame</category>
      <category>elixir</category>
    </item>
  </channel>
</rss>
