CS184: Deviant3D Progress

Calvin Wong, Chris Park, Sambodh Mitra, Rafael Ostrea

5/5 Progress - More Animations (Boss Death), Flying Enemies, Randomized Powerup Spawning!

TODO: Describe this stuff

5/4 Progress - Low Gravity and Friction Powerups, Additions to Camera Shake

TODO: Describe this stuff

5/3 Progress - Sky Rotates With Player, Built-in Toon Shader

TODO: Describe this stuff

5/2 Progress - SSAO, Multiplayer bugfixes, Custom controls

TODO: Describe this stuff

5/1 Progress - More Animations, Water shader, Water Physics

Made the player's gear kind of tilt down when it's idle, and bob a little when walking, using sine and cosine and the time elapsed to smooth it out.

So I'm too lazy to go into the details for the shader but using a tutorial and a subdivided plane mesh, we used depth testing to make foam and time displacement to make bobbing vertices (which made the plane look like it was waving) and used some noise and screen texture calculations to calculate a nice looking wave texture. We also optimized the shader by reducing if elses to boolean statements.

As for water physics, if the player fell below sea level, we applied an upwards force, which overnegated gravity by just a bit. However, to do actual swimming, we have to create a new set of controls/physics, which will also need to be networked. Singleplayer wise, it's more or less working, but will need some work to get it multiplayer ready.

Also color coded the menus and made the GUI a little nicer visually. You can now change graphics in game, and set view distance (ie: far), and buttons have color :D

Todos: videos for this and better explanation for the shader, networking swimming, figuring out why shadows don't show up at long distances. Here's images though :)

4/30 Progress - Way better grappling animation, multimesh (GPU efficient rendering) asteroids!

There wasn't too much of a challenge for the better grappling animation, it was basically add two cuboids, linearly interpolate it to rotate towards the grappling position, then do some clever parenting so it rotated with the player mesh. However, the result was a very satisfying procedural animation.

No real cosmetic changes to asteroids. Unfortunately, multimeshes don't handle collisions for us, so we did need to instantiate many collision shapes for each asteroid, but now there was a single draw call instead of dozens. Hopefully we can find a similar solution to other procedurally generated terrain, since our current approach uses multiple different meshes so we can't just convert it to a multimesh.

The hardest part was manipulating transforms, since for multimeshes, we needed to directly set the Transform (which was a bit more involved than simple Euler angles). This involved setting basis vectors, rotating along the three basis vectors, then finally figuring out how to do a simple translate (since the built in Transform.translate translated along the basis vectors, rather than adding to the origin).

Todos for this: make a second multimesh so we have a variant on the color, improve hook graphics maybe, hook rope physics (right now it's just a 3D line)

Video todo, but here's some pictures (with screen space ambient occlusion, thanks to Godot):

4/29 Progress - Aim centering!

What we did was project a ray from the center of the camera directly forward, then rotate the gun towards the intersection point.

The most difficult part was simply making sure the rotation was correct and syncing it in multiplayer, since we wanted it to be pretty accurate but also not add any extra network usage to sync it up, so we ended up having the camera gimbal system be its parent, so existing syncing of the camera rotation rotated the ray without extra network usage.

Notice how switching between third person and first person doesn't change the fact that we shoot at the center, it was very satisfying :3

4/28 Progress - Procedural Terrain!

This was done by first generating a 2D grid, then randomly adding offsets to the grid, then using OpenSimplex Noise to get a height value, then setting material appropriately.

The biggest challenges were actually generating a cuboid mesh, and making sure normals and everything were correct. Using the default cuboid and modifying it was a pain, since we had to figure out which vertex was indexed to which number, where normals pointed after modifications, etc.

Current todos for this are syncing over multiplayer and creating sloped rather than flat surfaces.

There's also a lot of optimizations to be done, since our current approach is literally using a cuboid for each "square" of the grid. Consolidating these into a single mesh rather than multiple cuboids is definitely something we want to do, as well as getting rid of extraneous faces similar to how Minecraft or other voxel engines do it.

4/27 Videos

Sorry, forgot to adjust recording downsampling, so it's a little low res


Explanation of features (Youtube link in case it can't load):


Multiplayer :

The worm is not fully synced yet but everything else should be!

4/27 Accomplishments & Results

  1. Blur shader for menu (takes advantage of mipmaps)
  2. WIP sketch shader (borrowed from here, aiming for edge detection type of shader as described in lecture)
  3. Random asteroid position generation (synced over multiplayer)
    • Syncs random number generation seed before generation
    • Then uses open simplex noise where if noise value is over a certain amount, spawns an asteroid with random height
  4. Surfaces act as magnets (using surface normals and a series of raycasts, reorient the player’s basis if raycasts hit a surface)
  5. No gravity option (nothing fancy, just didn't apply gravity force, but it was pretty cool to see it sync in multiplayer)
  6. Worm boss
    • Uses a “follow the leader” sort of procedural animation
    • Idea is head moves freely, and joints rotate towards successive joints while keeping a set distance between the joints
  7. Player physics
    • Uses similar approach to Verlet by using WASD inputs as acceleration forces
    • Also applies constant downward force for gravity (if gravity is on)
    • Adds acceleration to the velocity, then applies “friction” by damping the velocity (if on ground)
    • lastly move the player by the velocity
  8. Grappling physics
    • Uses Hooke’s law and raycast collisions to detect where to grapple to
    • Slightly dampens current velocity so that player doesn’t circle around grappling point forever
    • Once player gets within certain distance to grappling point, applies a relatively strong damping to current velocity so player “magnets” to point

Reflection and Schedule (Modified)

So learning Godot took a little bit more time than expected (time conflicts and all), but we wrapped up custom physics for the player, and it is pretty much multiplayer ready. We also did some relatively simple random asteroid generation, and wrapped up procedural animations for the worm, and some other shaders. Overall we are on schedule, with some slight setbacks.

Week:

  1. Learning Godot Engine/working on shaders DONE
  2. Some shaders, custom physics for player, some procedural animation (worm) DONE
  3. Shaders, procedural terrain and animation, custom physics for other objects
  4. More shaders, custom physics and procedural animations (other bosses)