RampantTrackGeneration is..
.. the Track generation logic for Rampant on the Tracks.
The logic is invoked by calling
@staticmethod
def generate_track(
diagram_width: int,
diagram_height: int,
num_diagram_regions: int,
angle_min_quantile: float,
length_min_quantile: float,
num_path_nodes_min_quantile: float,
max_fuel_cost: float,
min_cycle_period: int,
max_cycle_period: int,
max_length_travel_duration_seconds: int,
stop_radius: int
) -> Track:
in TrackGenerator.
Track
@dataclass(frozen=True)
class Track:
nodes: dict[uuid4, Point]
edges: dict[uuid4, EdgeVertexInfo]
start_node_id: uuid4
destination_node_id: uuid4
start_destination_path_edges: tuple[uuid4]
node_info: dict[uuid4, NodeInfo]
edge_info: dict[uuid4, EdgeInfo]
describes a set of edges, each a connection between two Points. nodes are the Points.
generate_track derives the Track from a randomly generated Voronoi diagram.
It preserves the organic appeal of the diagram's shape - unevenly spaced points connected by edges of varying length - and goes on to enhance that by
- removing all edges shorter than
diagram_edge_min_acceptable_lengthand/or contributing to an angle less thandiagram_edge_min_acceptable_angle - examining the set of subgraphs
Swith lengthicreated by edge removal and connecting them sequentially and looping over them, connectingS[i]toS[i + 1] - for each edge
AandBthat intersects at a pointj, splitting both edges onjso that there are four edges - calculating edge fuel costs, number of stops, and " junction block cycle " period
- determining
start_node_idanddestination_node_id - constructing and returning a
Trackfrom the information so far
The diagram is generated with Voronout and modeled with rustworkX.
node_info contains further information about nodes
@dataclass(frozen=True)
class NodeInfo:
num_steps_to_destination: int
num_seconds_block_cycle: int
for game logic - num_steps_to_destination tells you how many edges away it is from destination_node_id's node, while num_seconds_block_cycle is used in the " junction block cycle " mechanic.
edge_info is likewise for edges
@dataclass(frozen=True)
class EdgeInfo:
edge_traversal_fuel_cost: float
edge_traversal_duration: float
edge_stop_info: tuple[StopInfo]
edge_image_default_b64: str
edge_image_focused_b64: str
edge_traversal_fuel_cost is the fuel spent in-game by a Walker traversing the edge - edge_traversal_duration is the time it takes to do so in seconds, used for animation purposes.
edge_image_*_b64 are the edge's graphical representations in its default/focused states, stored in base64. The game converts them into sprites to show on-screen.
@dataclass(frozen=True)
class StopInfo:
stop_point: Point
stop_id: uuid4
stop_fuel: float
stop_fuel is how much fuel a Walker can draw from the stop.
Metadata
Release files for RampantTrackGeneration 0.0.2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rampanttrackgeneration-0.0.2.0.3.tar.gz | 8.6 MB | Without provenance | Details for rampanttrackgeneration-0.0.2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rampanttrackgeneration-0.0.2.0.3-py3-none-any.whl | Python 3 | none | any | Details for rampanttrackgeneration-0.0.2.0.3-py3-none-any.whl |
Total release size: 8.6 MB
Release files / rampanttrackgeneration-0.0.2.0.3.tar.gz
| Download URL | rampanttrackgeneration-0.0.2.0.3.tar.gz |
|---|---|
| Size | 8.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3fcfdf42a22b2fde8601715f46e617e468fa1dc745ea4f98b009bc3afd6902a
|
|
BLAKE2b-256 checksum How to use checksums |
a1e7fc373b770e3743db651e65bab511b54e79130e68e4c45860aa2434abac43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / rampanttrackgeneration-0.0.2.0.3-py3-none-any.whl
| Download URL | rampanttrackgeneration-0.0.2.0.3-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fffad0d5c71ddda9aa0e9462fb2f1068f8f3ff7671499902383c9747deff0cf
|
|
BLAKE2b-256 checksum How to use checksums |
a3bd332c64d6d8a84ae13e0489dbf9a24c50ccaada8f3188f1656b331d8e1d62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for RampantTrackGeneration 0.0.2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.