GithubHelp home page GithubHelp logo

ryan-c-scott / roblox-leveler Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 7.48 MB

NodeJS service + Roblox plugin for loading specially formatted Tiled files to generate heightmap derived terrain, water, and object placements.

JavaScript 57.69% Lua 42.31%

roblox-leveler's Introduction

Roblox Leveler

A tool for generating level data from specially formatted Tiled files.

Requirements

  • Nodejs
  • Roblox Studio
  • Tiled (for editing files)
  • Rojo (optional for getting plugin code into Roblox Studio)

Setup

Copy in as a local Plugin in Roblox Studio or running Rojo in .

Running

The service component, , serves up files from the current directory, so change to the directory where your files are stored (eg. `).

cd test
node ../leveler.js

Tiled Usage

Tiled serves as a simple, abstract level editor.

Tile Width

In order to deal with large terrains, the service can operate on pieces of terrain one by one. Map/Map Properties/[TileWidth|TileHeight] should be set to the same value at a reasonable size that is a factor of the overall image size. Values around 100 to 150 work well for Roblox Studio.

Heightmaps

A single Image Layer should be used to represent the heightmap. Each pixel maps to a single voxel in the smooth terrain system.

One voxel is 4 studs wide. To convert that to a meters for the default Roblox scale, which is 3 studs to a meter:

local m = pixels * 4 / 3

Custom Properties

  • height - The height of the terrain to generate.

Water

Areas of water are specified using Point objects on an Object Layer name water. The specified depth is used to flood fill the heightmap at the specified position.

Custom Properties

  • depth - The surface of the water above the height at the specified point.

Objects

Object names must correspond to asset folders in Studio. Objects that are not given a name directly will use their layer's name.

Custom Properties

  • random
  • base

Object Areas

Object areas are circles (Ellipses with the uniform height and width). The property type is read by the service as a float representing the density of the placement of objects in that area.

A density of 1 would mean 1 object for every surface voxel of generated terrain.

From the density the number of objects to place is calculated and then each placed randomly.

Individual Objects

Individual object placements are specified using Point objects on an Object Layer.

Roblox Place Setup

Tiled object names should match Folders under ReplicatedStorage/Leveler/ containing one or more objects to randomly choose between for placement.

Running

The Leveler plugin exposes a series of buttons.

  • Terrain - Generates all smooth terrain
  • Objects - Generates all object placements
  • Test Area - Generates everything in a 4x4 chunk area in the center of the map
  • Test Area (objects) - Generates only the objects from a 4x4 chunk area in the center of the map
  • Everything - Generates all terrain and objects in the map (this can take a long time with large maps)
  • Clear Terrain/Objects/Everything - Destroys generated terrain or objects as you might expect

roblox-leveler's People

Contributors

ryan-c-scott avatar

Watchers

James Cloos avatar Ben Tkacheff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.