Inspiration
- InflationRPG
- Lineage
- Being 100% onchain without sacrificing hack and slash (but staying true to source of truth [chain]).
What it does
Link to submission video on non-centralised hosting https://ipfs.zod.tv/ipfs/QmV9w4gQWYoLsiQXSRFZ8k4VSmZw92TB9DA87K9sBwrCf4
- The game is 100% onchain, there is no backend.
- Its an idle battler all the turns are played in-advance then returned with future time and replayed on the client.
- We religiously rely on VRF and ported a RNG implementation as the builtin was way too gas expensive and hard to audit. https://github.com/zodtv/nearknights/blob/main/contracts/nk/assembly/rng.ts
- We realize the shortcomings using VRF and cant wait until VRF2
- There is a gacha system (not on UX yet) https://github.com/zodtv/nearknights/tree/main/contracts/nk/assembly/formulas
How we built it
- PhaserJS for gameengine, ReactJS for UX/UI overlayed on top the engine
- AssemblyScript for contracts and a generator to fill items+monsters
- UX / UI - https://github.com/kasim393
- Integration - https://github.com/vans163
Challenges we ran into
- gas is too expensive to return typed objects (classes) from contract
- allowance, for some reason the wallet asks to sign every transaction after the AccessKey spent approx 0.06 NEAR. Even tho allowance was 0.25.
Accomplishments that we're proud of
- 100% onchain (item drops, formulas, dicerolls)
- No offchain oracle or offchain showNtell RNG
What we learned
- A 3rd team member to do phaserjs shaders/effects/animations would be great
- NEAR Classes inside contracts are WAY too gas expensive to return or write to storage (because they are json serialized each time)
- Write data to the log to avoid the above gas problem
- Buffer + Write data as 1 line to the log to avoid the problem above as log is limited to 500 calls per TX.
What's next for NEARKnights
- Bring onboard 3rd member
- animations and effects, right now everything is static.
- Sound.
- Spell system.
- More content to explore.
Built With
- assemblyscript
- javascript

Log in or sign up for Devpost to join the conversation.