Source-checkedLibraries & compatibility

manis lib generated chunk index

by suumani · for Factorio

chunk indexer for developers.

522Downloads
7 mo agoLast updated
MITLicense
2.0Latest game version

About manis lib generated chunk index

From Factorio Mod Portal

chunk indexer for developers.

Manis Lib Generated Chunk Index

A lightweight library mod that maintains an index of generated Factorio chunks per surface, designed for other mods to query via a remote interface.

This mod has no gameplay content and no UI.

What this mod does

✅ Maintains a generated-chunk index

For each surface, the mod tracks generated chunks using:

  • chunk key format: "cx:cy"
  • set representation: chunk_key -> true
  • array representation: array<string> for sampling and iteration

A “generated chunk” means:

  • surface.is_chunk_generated({cx, cy}) == true

✅ Works for both new and existing saves

  • Tracks new generation via:
  • on_chunk_generated
  • on_chunk_deleted
  • Handles existing saves by enumerating:
  • surface.get_chunks()
  • validating with surface.is_chunk_generated(pos)

✅ Exposes a read-only remote interface

Interface name:

manis_generated_chunk_index


Remote Interface API

All functions take surface_index as the first argument.


1) is_ready(surface_index) -> boolean

Returns whether the index is ready for the given surface.


2) get_surface_status(surface_index) -> table|nil

Returns status information for the surface.

Possible fields:

  • ready (boolean)
  • scanning (boolean)
  • count (integer)
  • bounds (table|nil)
  • bounds_dirty (boolean)
  • surface_name (string|nil)

May return nil if the surface is unknown.


3) get_generated_chunk_keys(surface_index) -> array<string>

Primary API for callers.

Returns an array of chunk keys in "cx:cy" format.

Intended for:

  • uniform sampling
  • iteration
  • derived structure building

4) has_chunk(surface_index, cx, cy) -> boolean

Returns whether the specific chunk exists in the index.

Intended for:

  • point membership queries
  • validation loops
  • adjacency checks

5) get_generated_chunk_set(surface_index) -> table|nil

Returns the internal set representation:

  • chunk_key -> true

Intended for:

  • debugging
  • special or advanced use cases

Caller must treat the returned table as read-only.


6) get_bounds(surface_index) -> table|nil

Returns best-effort bounds:

{ min_cx, max_cx, min_cy, max_cy }

Provided as a convenience.

Caller must not treat bounds as authoritative truth.


Recommended Call Patterns

Pattern A — Gate heavy logic with is_ready

Use when your mod depends on a complete index.

local iface = "manis_generated_chunk_index"
if not (remote.interfaces and remote.interfaces[iface]) then return end

local surface_index = game.surfaces["nauvis"].index
if not remote.call(iface, "is_ready", surface_index) then
  return
end

-- safe to use index
## Pattern B — Prefer has_chunk for point checks
If you only need a few coordinates, avoid pulling full data.

if remote.call(iface, "has_chunk", surface_index, cx, cy) then
  -- generated
end
## Pattern C — Use get_generated_chunk_keys for sampling
If you need random generated chunks:

local keys = remote.call(iface, "get_generated_chunk_keys", surface_index)
if keys and #keys > 0 then
  local key = keys[math.random(#keys)]
end
## Pattern D — Avoid frequent full-set pulls
get_generated_chunk_set(surface_index) may return a large table.

Best practice:

- Call it rarely
- Do not call every tick
- Convert to your own compact structure if needed

## Data Guarantees
- The mod maintains an index of generated chunks per surface.
- The remote interface is read-only.
- Chunk keys are stable in "cx:cy" string format.

## Non-Guarantees
- Ordering of chunks is not guaranteed.
- Bounds are best-effort derived data.
- No per-tick change stream is provided.

## Compatibility
- Library mod (no entities, no UI).
- Designed for Factorio 2.0 runtime.
- Caller mods must treat returned data as read-only.

# update

- 0.0.3 bug fix

Highlights

From source data

Game versions

Built for Factorio 2.0.

Footprint

Rated a light load on a server.

License

Published under MIT.

manis lib generated chunk index on Nxeon

From our catalogue
One-click install
Supported on Nxeon Factorio servers. We download it from Factorio Mod Portal, place it, and restart the server.
Server side
Required on the server
Server load
light
Smallest plan we suggest
Factorio — 2 GB (2 GB RAM). This follows our own load rating above, not a benchmark.
Latest build
1.0.0, released 2026-03-28

Recent builds

BuildReleasedGame versionsLoaders
1.0.02026-03-282.0n/a
0.0.72026-03-262.0n/a
0.0.62026-03-142.0n/a
0.0.52026-03-072.0n/a
0.0.42026-03-072.0n/a
0.0.32026-03-022.0n/a

Dependencies

Declared by the newest build that lists any. Required ones are installed with it on one-click installs.

Run manis lib generated chunk index on a Factorio server

Pick a server or deploy a new one above; it is installed in one click.

What kind of mod it is

From the catalog
Listed on Factorio Mod Portal as “Mods”

Libraries & compatibility

Foundations and fixes other mods build on. Usually installed because something else needs it.

Runs on your server

From source side support

Factorio Mod Portal lists manis lib generated chunk index as required on the server. Check its Factorio Mod Portal page to see whether players need it too.

Compatibility

Game
Factorio
Runs on
Serverrequired on the server
Game versions
2.0

Verified at the source

  • ✓Factorio Mod PortalOfficial listing, checked 2026-10-08Open ↗
  • ✓Authorsuumani, as published on Factorio Mod Portal
  • ✓LicenseMITFree

manis lib generated chunk index, answered

Generated from the mod’s own source data.

Do my players need to install manis lib generated chunk index?

Factorio Mod Portal lists manis lib generated chunk index as required on the server. Check its Factorio Mod Portal page to see whether players need it too.

Is it free?

Yes. manis lib generated chunk index is free to download from Factorio Mod Portal. Its license is MIT.

How do I add it to my Nxeon server?

Use “Add to a server” on this page, or open NxLabs from your dashboard. We install it, restart your server and switch it on.

NxLabs

Run manis lib generated chunk index on a Factorio server.

Deploy in about a minute from $2.99 a month, then add manis lib generated chunk index in one click.