Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable adventurers to discover existing beasts #309

Open
loothero opened this issue Mar 16, 2023 · 1 comment
Open

Enable adventurers to discover existing beasts #309

loothero opened this issue Mar 16, 2023 · 1 comment
Assignees
Labels
Context: intricated deep understanding of the codebase required Difficulty: hard require extensive knowledge about the field Duration: few days will take a few days Type: feature a new feature to implement

Comments

@loothero
Copy link
Contributor

When a beast is discovered, it is minted/saved to the blockchain. If the beast kills an adventurer, it receives XP the same as adventurers. Currently however there is no way to encounter these on-chain beasts which limits the fun.

We should update our Adventurer explore() function to have a small chance to find an existing beast. The chance should increase with the number of beasts on-chain (ones that have slain adventurers) but should never exceed 20% chance.

@loothero loothero added Difficulty: intermediate mobilise some notions about the field, but can be learned while doing Duration: few days will take a few days labels Mar 16, 2023
@loothero loothero added this to the Adventurer Arcade Game MPG milestone Mar 16, 2023
@loothero loothero added the Type: feature a new feature to implement label Mar 16, 2023
@starknetdev
Copy link
Contributor

I believe we still have an issue on this in regards to computational complexity or storage, something I don't think Cairo 1 will be able to solve either.

Two of the only approaches I can see will be costly in gas. Both of these come after the chance to discover an existing beast has been calculated:

First approach is to store an array of the beast IDs that have defeated an adventurer, then use rng to pick one between the size of the list. The problem is that the storage costs could be large and theoretically infinite, even if the beats are removed from this array when killed.

Second approach would be to generate a random number between the total number of beasts and check whether it's alive (slain an adventurer). If the outcome is negative, we would increment this number in a loop, until a beast which is alive is found. Although there is no added storage costs, the computation required to loop through the beats is large, and if none are alive, then it's large computation for a pointless outcome.

Interested to see if anyone has another potential solution?

@loothero loothero changed the title Loot Survivor | Enable adventurers to discover existing beasts Enable adventurers to discover existing beasts May 3, 2023
@loothero loothero self-assigned this May 6, 2023
@loothero loothero added Difficulty: hard require extensive knowledge about the field Context: intricated deep understanding of the codebase required and removed Difficulty: intermediate mobilise some notions about the field, but can be learned while doing labels May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context: intricated deep understanding of the codebase required Difficulty: hard require extensive knowledge about the field Duration: few days will take a few days Type: feature a new feature to implement
Projects
None yet
Development

No branches or pull requests

2 participants