Posts

Showing posts from February, 2021

Progress Update #11

Image
   Planetary  Ring Systems in UE4     Since completing gas giants last week I wanted to add one more feature to make these pretty simple planets a little more interesting: rings (or as Wikipedia defines them " ring systems ").     The first problem to solve was how I was going to go about adding rings to planets. As in would they be a component, part of the root mesh, a separate actor, or something else? In the end, I decided to make ring systems an actor component for a few main reasons. 1) I would be able to add rings to terrestrial planets too 2) Actor components would be more flexible than hard-coding them into a single planetary class and 3) I haven't used actor components yet in this project and it would expand my knowledge base. The biggest downside to this approach, as I would soon find out, is that actor components have no rendering capabilities meaning that I would have to spawn and use a separate static mesh component to take care of all rendering. The Material

Progress Update #10

Image
  Gas Giants in UE4     I have been dealing with terrestrial planets for quite some time now, and the solar system is looking a bit bland. It is time to tackle gas giants. (p.s. this is going to be more technical art than the usual C++) Research     Since I wasn't following any sort of tutorial, I was starting completely from scratch with this one. Doing some simple google research reveals that gas giants do have a solid core, but the "surface" of the planet that we see is made of gasses. For the game, this meant I could use a simple sphere for the mesh and add all of the detail through the material.       I intend to use an  icosphere for this purpose because of its even distribution of faces and its less distorted UVs. For now though I am using the standard unreal UV sphere which causes distortion near the poles and is more jagged near the equator.     Thinking about how I could replicate the look of a gas giant in a game I came up with a list of requirements for the ma

Progress Update #9

Image
  Bugs Beget Bugs     In the process of fixing a recent bug I have inadvertently discovered many more.     The issue that I just fixed had to do with biomes, and has existed since I implemented biome blending. The issue being that if you had more than 2 biomes the material would freak out and band the biomes around latitude lines quite strangely. Here are some pictures to help explain what I'm talking about: No biome blending Blended biomes @ 0.1 strength Expected outcome w/ three biomes Actual outcome     To try to debug this problem I first tried ol' reliable; the print string. I set up a UE_LOG in the BiomePercentFromPoint() function to see what it was returning. The weird thing was it was supposed to return something between 0-1 but it was always returning either 0, a really large number in the billions, or the same large number but negative. Something was clearly amiss so I dug deeper with breakpoints.     I set a breakpoint at the end of the function so I could see every

Progress Update #8

Image
  Orbit Debug Visualization     Over this past week I have worked on and finished 90% of the orbit visualization. This means drawing paths for where planets will go when you hit play given their mass, velocity and position.      DrawOrbits is the main function for the Orbit Debug actor so let's go through how it works. We start by removing the previous orbits with ClearOrbits() . This function either calls  FlushPersistentDebugLines() if the orbits were drawn with debug lines or clears the splines if they were created that way. Then lines 5-12 gather all celestial bodies into array Bodies. If we are using splines to make the orbits then lines 14-17 will make a spline for each body. Lines 19-26 then initialize more variables.     Per the comment on line 28, the loop starting on line 29 makes "VirtualBodies" for all celestial bodies in the scene. A virtual body is essentially an ultra stripped down celestial body with only the information it needs for movement.     The loo