/infinite-world

Primary LanguageJavaScriptMIT LicenseMIT

A game

A final project before graduating.

The idea

The core concept is a procedurally generated world that the player can explore. More details and gameplay might be added along the way.

Priorities

Terrain

  • Generate random z values to create hills
  • Look up and implement Perlin/Simplex noise
  • Return z value to player
  • Randomize x and y values as well, to avoid grid feeling
  • Create world class with global world functions
  • Generate nine terrain tiles
  • Calculate if tiles are too far away and should be removed
  • Generate new terrain tiles
  • Smooth adding and removing of tiles (distance/fog?)
  • Tweak layered noise for better terrain generation

Content

  • Generate environment (flowers, trees, ponds)
  • Randomize rotation, height and models of flowers and trees
  • Add content not only to vertices
  • Create tree- and flower meshes, to cut down on rendering
  • Turn meshes into instance buffers or use object pooling
  • Don't add stuff on top of each other

Player

  • Get y value from terrain
  • Mouse movements through raycasting
  • Third person view
  • Collision detection
  • Find better sprite for player

Camera

  • Only render terrain in view
  • Smooth chase cam

Backlog

  • Nicer colors and overall look
  • Continuously generated world, or world as sphere
  • Some actual gameplay

Changelog

2018-11-12
  • Vegetation meshes added, but very sensitive and a bit buggy
  • Added layered noise function, needs to be tweaked
2018-11-09
  • Started on vegetation meshes
2018-11-07
  • Refactored tiles into World object for global world functions and terrain calculations
  • Calculated if tiles should be removed
2018-11-05
  • Ditched moving terrain, focusing on chunks/tiles instead
2018-11-03
  • Added basic terrain generation on movement
2018-10-31
  • Added shadows to trees
  • Configured colors and randomization
2018-10-30
  • Basic randomized addition of trees and flowers to terrain based on vertex and simplex noise
2018-10-29
  • Decided on third person view and flat shaded art style for simplicity.
  • Spent a lot of time trying to understand Blender. Finally managed to import 3D models.
2018-10-24
  • Tried out both first and third person controls, kept both for later decision.
  • Tried out spheric world, but it got too complicated. Continuing with plane for now.
2018-10-23
  • Changed approach. Abandoned third person view and focused more on core concept.
2018-10-22
  • Added raycasting, so that player movement is based on mouse movement
  • Can't figure out the y-position of player
2018-10-21
  • Started on player movement
2018-10-18
  • Sat the entire day trying to figure out why stuff would disappear behind terrain.
  • Realized I need to rotate stuff using radians, not degrees. Problem fixed!
2018-10-17
  • Implemented simplex noise for natural randomness, started working on camera angles
  • Added materials, lights and shadows
2018-10-16
  • Generated plane with random terrain, started researching Perlin/simplex noise
2018-10-15
  • Set up basic structure, started playing around in three.js