Tuesday, June 14, 2016

Day 30: Busy and Bugged

Finally! A performance hit. Seems as when I gather too many cells (size too small) on large enough terrain, the frame rate takes a hit:


Now I wonder what it'll do for only one cell?

As for bugs, I found out that the enemy, when the player is currently attaching to it and it goes back to normal, actually crashes the system. Gadzooks! That's what happens when an actor is destroyed without waiting until the next tick. I made sure to use a boolean to make sure that exactly happens.

We also got an assignment, so I'll keep the words short. Gotta fix the memory manager code!

Monday, June 13, 2016

Day 29: Grassy Patches

In capstone, today was a day for refactoring. That is, take all of the recommends to take my else-if statements and polymorphize them. That said, I did also put in the new particle system effect for our elevator, and tested it out so the level would be playable:


I also mainly worked with procedurally applying textures to the terrain. After the TGA-loading issue gave me trouble, I defaulted to loading a dds texture instead, as the data doesn't load in a wonky way based on the bpp value. That said, does setting the texture based on a singular slope check work out?


Yeugh. Yeeeuch. That is definitely looking more like pond scum than grassy overlay. What to do? Linear interpolation! Just applying it based on the grass texture at the lowest slope to the rock texture at the slope value did the trick. I also did a similar interpolation with normals:


What to do next? Applying several levels of depth would probably do the trick. Snow, grass, and...why not hot lava?

Sunday, June 12, 2016

Day 28: A Slippery Slope

Today was another day for wrapping up big bug fixes and little changes, such as setting players' powers upon respawning checkpoints so they couldn't take a power where they shouldn't. There's also the deal of fixed camera angles, where for special camera angles and vistas the player camera blends with a fixed point. However, the player's movement wouldn't be in relation to that camera. What to do? Constrain the rotation while the camera was borrowed by that fixed point so the player could only move in relation to that point in space.

As for procedural texturing? I'm still figuring out the TGA format in terms of loading files; the method I figured only works with 32-bpp, and trying to fnangle it for 16-bpp makes some weird designs. As for slope based texturing, one can take the normal's vertical value (essentially the normal would be perpendicular to the tangent (slope) value and vary the texture based on that slope. I'm still figuring how to make the TGA file loader more friendly so I can use more textures, but I used an example with the rock slopes to make it more apparent:


Hopefully I can figure out this 16-bpp malarky!

Saturday, June 11, 2016

Warp Surfing and the Moon

Today was a light day, but carried its fair share of busy all the same.

For capstone, it was mainly fixing the big bugs of yesterday's playtest. What were the bugs? Mainly being able to spam the warp button and using its small vertical offset to reach ridiculous heights, along with the cube actually carrying the player in a warp if shot from below. The first one required a cooldown, but the second one required a tricky sweep in which the player had to sweep her body and check for a cube; the cube sweep had more of a chance to sweep into something else, since its body is larger.

As for terrain? Good news! I figured out what was the problem with the terrain mapping. This hearkens back to my studies in depth mapping, where depth values vary exponentially, or at least not on a solidly linear scale. That meant that around the values 0.9-1.1 were the big depth values in terms of varying texture. In that case, I decided to go with three levels of detail: One with the fully detailed normal, one with the stretched out distance map, and one with absolutely no normal map. This manages at least some more level of detail that feels a bit more natural than just dropping from lots of detail to no detail:


Also, the deep blackness of space and the barren environment reminds me of the moon; I should probably introduce greener pastures.

Friday, June 10, 2016

Day 26: Not Sure If Distance Mapping Or Not

Got distance mapping to work on top of height map movement! Whew!

After wrapping up the work to get metrics measured on a small room scale (as opposed to the whole game), I fixed up height based movement on my terrain. Essentially the inputs would be an x and z, and would search for the triangle to use. Once the triangle had been found in the specific cell, a raycast would be shot through the triangle and an intersection would be calculated at that point (from 1.0f through the triangle. The intersection would essentially be a float value that I could use to set that distance. Behold!


I assure you, it's a lot more interesting in video form.

As for distance-based normal mapping, the idea is to only set the actual normal mapping at a set depth value. The other one would be a less detailed map that would be stretched over a larger quad (say, stretched over an entire cell). That way, less detail would mean less processing power on getting the little details in. However, I'm not entirely convinced, and may need to play around with values until I get what I'm looking for:


Thursday, June 9, 2016

Day 25: Metrics Revamp and Stats Galore

Today is a statistical kind of day!

Just kidding, here's another podium design. The idea is to consistently slow and speed up an object to give a general idea what the power does:


As for more stats, it seems as if the team is finally ready to start testing out room-based metrics, so we'll see how that goes. I also started work on gathering new data such as warp recall/placement, as well as time spent in gravity wells and during slow time dilation effects.

As for my terrain project, I finally figured out what the problem was with font! (subtracting textures in the vertex shader, hurr durr) And as a result, I've started up gathering statistics such as position, cell and triangle render count, and frame rate:


Luckily enough, large-scale terrain pretty much has me rendering only half as many cells on an average basis.

As for the next step? Let's try moving along the terrain! Which means...complex raycasting to place oneself on a triangle! Woo!

Wednesday, June 8, 2016

Day 24: What I Can't See

This week poses quite the odd assignment: it seems that in order to make the identity of the ley-giving powers more obvious and less dangerous (see: evil electric gates), the producers are having me work on a podium-based design, in which we'll be showing mini-behaviors of the powers at work. This'll require taking out the powers and replicating them in a repetitive, mini-environment. So far the gravity podium has been rather simple, but the time one may be a bit tricky depending on which movement we will use. Since the dissolving blocks now only dissolve one material instead of the other, I think I may opt for the spiral design.


As for the terrain work, I've (I think?) successfully culled terrain cells that are not visible in the viewing frustum! How do I know this?

...I don't yet! But that's what statistics are for. I'm currently working on those now in a screen-space UI shader.