Origami is a collection of essential primitives designed to facilitate the development of onchain games using the Dojo engine. It provides a set of powerful tools and libraries that enable game developers to create complex, engaging, and efficient fully onchain games.
The magic of origami is in seeing a single piece of cairo evolve into a masterpiece through careful folds
Sensei
| Crate | Content |
|---|---|
origami_defi |
Gradual Dutch auctions (discrete, continuous) and VRGDAs (linear, logistic) on fixed Q32.32 numbers |
origami_hexmap |
Hexagonal tile maps: generators, BFS and weighted search, ranges and rings, bit-parallel on one felt252 |
origami_map |
Square tile maps: maze, cave and random walk generators, A*, BFS, DFS, Dijkstra and greedy finders |
origami_random |
Dice and card decks from a seed |
origami_rating |
Elo rating |
origami_security |
Commit-reveal commitments |
Toolchain: Scarb 2.19.4 (Cairo 2.19.4); origami_hexmap is
tested with Starknet Foundry 0.61.0.
From the scarbs.xyz registry, one crate at a time:
scarb add origami_defi@1.8.0
scarb add origami_hexmap@1.8.0
scarb add origami_map@1.8.0
scarb add origami_random@1.8.0
scarb add origami_rating@1.8.0
scarb add origami_security@1.8.0origami_defi takes and returns fixed::Fixed values: add scarb add fixed@0.4.0 as well.
Or from git, in your [dependencies]:
[dependencies]
origami_hexmap = { git = "https://github.com/dojoengine/origami", tag = "v1.8.0" }For linear algebra, use the nalgebra and glam packages on scarbs.xyz.
- Toolchain. Scarb and Cairo 2.19.4 (from 2.12.2). The crates are published on scarbs.xyz for the first time.
origami_algebraremoved, with itscubitdependency: usenalgebraorglam.origami_defionfixed0.4.0: signed Q32.32 numbers, range[-2^31, 2^31), resolution2^-32; intermediate products are kept wide.- New
origami_hexmap: hexagonal maps where every operation works on the whole board at once. Measured with snforge 0.61.0 (sierra gas, seeGAS.md): a 17x14 cave, its connected component, an entrance, 10 objects and a 15-step path cost 1.14M gas, against 145.8M for the same scenario onorigami_map18x14 (cairo-test estimate);search_pathacross a 17x14 cave (24 steps) 706k,new_cave142k.
See CHANGELOG.md for the details.
Now you will be able to use origami like any other Cairo package!
Your expertise can shape the future of game development! We're actively seeking contributions.
Run into a snag? Reach out on our GitHub Issues or join the conversation in our Discord community for tailored assistance and vibrant discussions.
