[RELEASED] Hewn Core: a block-based grid framework powered by DOTS


Asset Store Link
Discord Server
Website

Hey! I’m Bradley. I am a software developer who builds video games, editors, and simulators. I’ve been developing Hewn Core for a few years now as the engine for my playful world builder, Battle Map Studio. Since many games use a block-based grid, I thought a generalized 3D hex/square grid system might be useful for a lot of devs.

So, what is Hewn Core?
Hewn Core is a grid system and worldbuilding framework that functions as the foundation for any block-based game.

Hewn Core provides easy-to-use methods for creating and manipulating world entities, like blocks and block decorations. Simply use the add, update, and remove methods, and the system will take care of the rest.

Hewn Core lets you build big without sacrificing performance. Powered by Unity’s Data-Oriented Tech Stack (DOTS), Hewn Core is blazing fast when spawning, updating, and rendering world entities.

Hewn Core is super adaptable to many game types. Choose between hex and square coordinates, toggle voxel mode, and add grid layers to get the look and feel you need.

Whether you’re building a small puzzle game, a giant sandbox RPG, or anything in between, use Hewn Core and worry less about building your own grid system.

FEATURES
:white_check_mark: Layer Offsets: Translate layers vertically and horizontally to easily shift your world at runtime.

:white_check_mark: Grid Scaling: Scale your world nonuniformly to customize grid cell sizes.

:white_check_mark: Highly Optimized Framework: Powered by Unity DOTS, Hewn Core is optimized for speed and efficiency, ensuring smooth gameplay even in vast block worlds.

:white_check_mark: Block Components: Blocks can be decorated with props, plants, rocks for infinite visual combinations.

:white_check_mark: Layers: Hewn Core layers can help organize your world, display or hide regions, and quickly move large areas of blocks.

:white_check_mark: Voxel Mode: Hewn Core’s voxel mode unlocks 3D coordinates to more easily create overhangs and caves.

:white_check_mark: Flexible Coordinate Systems: Whether it’s hexagonal charm or the classic square grid, Hewn Core has you covered.

:white_check_mark: Grid Mathematics: Hewn Core is equipped with intuitive tools and methods to handle grid calculations for features like fog of war and pathfinding.

:white_check_mark: Lots of Samples: Hewn Core comes packed with over a dozen sample projects to guide and inspire.

:sparkles:AND ALSO:sparkles:
Extensibility: Visuals, grid properties, and other aspects of Hewn Core can be extended, modified, and toggled on and off to better adapt to your project.

Real-Time Grid Manipulation: Blocks and block components are entities that can be added, interacted with, modified, and removed on the fly.

If you’re excited about Hewn Core, let me know! I want to hear your ideas so I can make Hewn Core the best it can be. I’m always around on Discord, so come hang out. :slight_smile:

-Bradley

2 Likes

Update 1.1.0 Nonuniform Grid Scaling
Hewn Core now supports nonuniform grid scaling, which allows you to change the size of your world’s grid cells. When grid cells scale, the block components can scale as well, based on the chosen block component scaling behavior.

Update 1.2.0 Layer Offsets & Endless World

  • Layers now support horizontal position offsets to more easily shift block areas at runtime.

  • Chunk Segmentation is now supported for both hex and square coordinates using the Chunk Manager.

  • Added a new sample, Endless World: explore an infinite world. This sample showcases chunk-based world segmentation, layer offset movement, and dynamic procedural generation.

  • Added multiple movement types for player movement:

  • MoveTransform: traditional translation of game object.

  • OffsetWorld_XZ: offset the active layer opposite to player movement (horizontal only).

  • OffsetWorld_XYZ: offset the active layer opposite to player movement (horizontal and vertical).

  • Updated the Layers sample to include a draggable gizmo to offset the selected layer’s horizontal position.

  • Merged the functionality of the SimpleWorldGenerator elevation and block component generation to make generation simpler.

  • Note that the parameters for the AreaUtilities.GenerateArea have changed.

Hewn Core is a Fresh Asset, so it’s half off for the next couple weeks!

V1.3.0 Pointy Hexes & Block Meshes

  • Added block meshes: These procedurally generated meshes sit on top of blocks and are useful for water, lava, or other liquids.
  • Added a new sample called S_ProceduralMesh. In this sample, you can paint and erase water from the environment.
  • Added support for non-scaling block objects (see the BlockScalingBehavior). This makes stacking blocks much easier.
  • Made it easier to add different block prefabs for the same grid type. Block prefabs now have a resource code that can be associated to a data class, which is verified in update jobs.
  • Added support for pointy-hex grid type (see GridType).
  • Improved the sample camera script (used for culling) to not need to update view bounds as often.
  • The InitializeLayer logic on the TerrainObjectManager is now optional. You could always inherit from the TerrainObjectManager and insert your own logic, but this makes it easier to configure out of the box.
  • Improved block and block component change verification to require fewer jobs scheduled to update changes.
  • Baker systems have been changed to implement ISystem instead of SystemBase.
  • The UseCulling variable is now a CullingTypeCode. There are now three options: off, on, and ignore update. Ignore update is new and does not remove entities outside of view but instead just ignores them in update jobs.
  • Removed the MeshTerrainTypes. The MeshStyleTileMap is now used instead.
  • Added new customizable world variables:
    • Tile Component Tier determines which block component tier changes block vertical positioning.
    • Block Component Tiers determines which component tiers are used to index block components on each grid position in certain methods.
    • Grid Cell Scale informs position scaling on the grid, which allows the block data scale to be different from the grid cell scale.
    • Block Rotation: adds to all block rotations.
    • Mesh Visual Offset determines how far vertically offset a generated mesh is off of each block.
  • Mesh Chunk Radius determines how big each mesh chunk can be.
  • Added new Customizable block variables:
  • MeshWElevation determines the mesh W and elevation. This is useful for offsetting water or other meshes away from a block without needing to create a new layer or invisible block for the mesh.
  • Memory usage improvements:
  • Grid positions are no longer indexed in native collections. Instead, integer hash codes of grid positions are used.
  • GBlockData, GBlockComponentData, and GBlockMeshData no longer are added to entities. Instead, BlockEntityData, GBlockComponentEntityData, and GBlockMeshEntityData are used as components to index data from native collections, which could be modified inside or outside a job. This essentially cuts the memory usage of Hewn Core entities in half.
  • Fixed several areas where native collections were not properly disposed.
  • Moved material and animation data into separate components, so that when a block doesn’t have a model, or animation is disabled, these components don’t consume memory unnecessarily.
  • Added support for blocks without an associated model, for increased performance in situations where the entity is a parent to many children renderers. Note: when blocks have no model, many visual-related components are not added to the block entity. Use the HasModel bool on a GBlockEntityDataProxy prefab to toggle baking behavior for meshes on and off.

New release!

NEW IN v1.4.0

  • Layers can now be individually rotated to rotate positions and/or entities.
  • Quad 2D mode has been added to support 2D graphics.
  • Culling Radius property has been added to remove entities outside set disance.
  • New Samples!
    • Mountaineer: climb to the top of the mountain in this 3D platformer jumping scene using physics-based movement and side-on 2D perspective.
    • Terra Land: explore the 2D world from a top-down perspective.

Full v1.4.0 Changelog

  • Added world properties for terrains:
    • Terrain Scale controls terrain scale.
    • Terrain Tile Type controls terrain material.
    • Terrain Tile Blend controls terrain material blending.
  • Added world space property:
    • TwoD is used for 2D graphics using SpriteRenderers (not fully supported in DOTS yet).
    • ThreeD is used for typical 3D objects.
    • QuadTwoD is used for 2D graphics using quads.
  • Added world properties for culling radius:
    • Culling Area Center is the center to cull from
    • Culling Radii controls the radius of block and block component culling within a certain distance from the Culling Area Center.
  • Added support for individual layer rotations.
  • Added world properties for layer rotation settings to control position and entity rotation within layers.
    • If positions are not rotated, nothing is rotated.
    • If only positions are rotated, entities do not rotate (good for side scrollers).
    • If both positions and entities are rotated, entity positions and rotations rotate with the layer (good for 2D perspective).
  • Added two new samples:
    • Mountaineer: climb to the top of the mountain in this 3D platformer jumping scene using physics-based movement and side-on 2D perspective.
    • Terra Land: explore the 2D world from a top-down perspective.
  • Changed how scenes are identified to use an enum instead of a string.
  • Updated positioning logic to take layer rotation into account.
  • Added a map generator for generating platform maps using voxels.
  • Added support for 2D and 3D character entities.
  • Added support for per-map component transform randomization.
  • Added support for inner-outer min/max transform randomization to allow for positions, scales, or rotations within a certain inner and outer range.
  • Updated package to use 2022.3.52f1