Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

alexhaloETH/ToDo-notes-Skirmish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 

Repository files navigation

Welcome to this GitHub


Development for this game has been halted

πŸ”΄ --- Not done
🟒 --- Done
🟠 --- Half way done
πŸ”΅ --- Getting close to finishing

🟣 --- Error or major issue present
⚫ --- Probably impossible to do or most likely going to change


SKIRMISH COMPONENTS



----------------------------------- CAIRO CONTRACTS (Last full code clean up and commenting 25/06/22) ALL TO REDO --------------------------------------
Test token for pay transactions: 0x03e41c33cfb4081c8a40f08bc61d7b62396485587415b967e1dc295a156d03e9

CONTRACT 1: SKIRMISH MAIN CONTRACT

Main contract of the game

Status Tested Function Type Description
🟒 🟒 SetTokenAddress @external Set the token address to be payed with
🟒 🟒 SetFee @external Set the fee the contract takes when the game ends
🟒 🟒 SetSNSCost @external Set the cost to make an SNS, times by 10**18
🟒 🟒 SetSNS @external Set the SNS of the calling address
🟒 πŸ”΄ WithdrawToken @external Withdraw tokens from the contract
🟒 πŸ”΄ GameLobbyStart @external Function called on the start of the lobby by the "host". pays wager into contract
🟒 πŸ”΄ GameLobbyJoin @external Function called by the joiner. pays wager into contract
🟒 πŸ”΄ GameOutcome @external Action depending on outcome of the game
🟒 🟒 GetSNSFromAddress @view Given an SNS(felt) return the holder's address. Return 0 if not held
🟒 🟒 GetAddressFromSNS @view Given an Address return the SNS associated. Return 0 if available
🟒 🟒 GetAcceptedTokenAddress @view Return the Address of the ERC20 token accepted for payments
🟒 🟒 GetSNSCost @view Get the cost of setting an SNS. divide by 10**18
🟒 πŸ”΄ SeeBalanceOfContract @view Get the current balance of the contract (possibly will be deleted in future)
🟒 πŸ”΄ GameLobbyView @view Given a RoomCode of a current game (felt) return the address of the two players and the wager
🟒 πŸ”΄ GetServerStatus @view
🟒 πŸ”΄ SetServerStatus @external
πŸ”΄ πŸ”΄ GetClientGameManager @view
πŸ”΄ πŸ”΄ SetClientGameManager @external

Most current deployed test contract: --------

CONTRACT 2: TALK TO REALMS NFT

Status Tested Function Type Description
πŸ”΄ πŸ”΄ GetAllRealmsOfAnAddress @view
πŸ”΄ πŸ”΄ GetAllTroopsOfARealm @view

Contract used to get the data from the realms NFT to the game, data like the Realms available and the troops inside and the adventurers available Just needs to be implemented into the realms repo

CONTRACT 3: DATABASE ACCOUNT TROOPS

Status Tested Function Type Description
🟒 🟒 SetDeckData @external
🟒 🟒 GetDeckData @view

Contract used as onchain database, when the player decideds its team it will be saved on the chain


Additional Notes:
Need to add all of the owner stuff and the asserts
Look into Account abstraction
Look into events look into changing states of the games straight from cairo instead of doing something from the server cli
LOOK INTO SNARKS INSTEAD OF THE CURRENT WAY OF WINNING THE GAME (most likely STARKs)
Find ways to start to transition the server into the chain
add the possibility (in conjuction with unity) to get back into lobby by looking at the address might need another storage var
Possibility of breaking down the contract
__________________________________________
Other usefull links related to this project:
https://github.com/jrkosinski/crypto-champ
https://github.com/jrkosinski/crypto-champ/blob/master/sports-bets/contracts/SportsBets.sol
https://medium.com/visionary-hub/building-a-sport-betting-dapp-d5f1048ba524
GitHub - iden3/snarkjs: zkSNARK implementation in JavaScript & WASM
iden3 | Circom



----------------------------------- REACT BACKEND (Last full code clean up and commenting 24/06/22)----------------------------------------

Progress Task Notes
🟒 Implement Unity and be able to call functions
⚫ Full screen on Unity startup web.Js doesnt allow calls to make applications full screen
🟒 Send transaction updates
🟒 Send address data on connect
🟣 Block game if the wallet is not connected or account is switched contacted devs and they have opened a ticket
🟒 Connect argent wallet
🟣⚫ Connect braavos wallet this is broken and probably wont be implemented in the final stage
🟣 Disconnect wallet voluntarily contacted devs and they have opened a ticket
πŸ”΅ Turn array from cairo to json to be sent to unity for troops
🟒 Handle view functions
🟒 Handle uint256 values
🟒 Add token to wallet via code
🟒 Add Util script
🟒 Add encryption and decryption
🟒 Multicall for the deckDataSet
🟠 Add contract 1
πŸ”΄ Add contract 2
πŸ”΅ Add contract 3
🟠 On contract 1 deduct fee for the contract to keep
πŸ”΄ Deploy Website somewhere

Additional Notes:
Open issue on the starknet react github for the braavos wallet
implement the starknet ID or look into it
Other usefull links related to this project:



----------------------------------- UNITY PROJECT (Last full code clean up and commenting 25/06/22) ----------------------------------------

Progress Task Notes
⚫ Autoconnect on game startup if server is available the first scene will be used as a landing page for the game/website so no autoconnect
πŸ”΅ Offline scene finished
🟒 Receive address data on connect
🟠 change from the playerprefs or put ifend regions int he code the way that saved data is stored in between scenes is not a permanent way, if anything use react backend to store data inbetween scenes
πŸ”΅ Main util script to be accessed from everywhere
🟒 Check if two of the same players exist in the server if so kick
🟠 Implement keys used for encryption
****** ****** ******
🟒 Host game menu section
🟒 join game menu section
πŸ”΅ Deck building menu section
🟒 Loading menu section
🟒 Setting menu section
🟠 Contract view menu section this menu is a mess
🟒 Receive transaction updates
πŸ”΅ Finish the menu UI check the contract menu and have the final UI in place
🟒 Show all availabe games
🟒 Basics of matchmaking and player made lobbies
🟒 Webhook to discord to be used as a database
🟠 Send webhooks to discord on starting lobby and joining lobby all implemented in the Util script, just need to set up the lobby the correct way
🟒 Pop up error UI
🟒 Sorting algos for the various menus
πŸ”΄ Basic all roudn progression checks example: the player is able to join a lobby without selecting a team, should not be allowed
****** ****** ******
🟒 Basics of RealmsUI
🟒 Basics of troopsUI
🟠 Basics of adventurerUI
πŸ”΅ Tooltip on hover over units and realms core logic is done just needs to be implemented everywhere
🟒 Able to select the realms by looking for their ID
πŸ”΅ Player is able to make its team and save it to be then used in game if the player goes back into the deckmenu there are errors, probably issues with references
πŸ”΄ Receive data from NFT
πŸ”΄ Lobby exists until the original host goes
πŸ”΅ Write data to Database account troops contract
⚫ Implement a resource folder so every prefab is available there in conjunction with the generalUtil script
****** ****** ******
πŸ”΅ function to update the player ont he server side with the client side data use the specific targetRPC example to improve on the efficiency of the server calls
πŸ”΄ divide the game into different states/rounds
🟒 Fix the names so they show in the lobby
🟠 Connect the skirmish main contract to the game
⚫ Only allowed to start the game after both players are ready
πŸ”΅ Turn based functionality setup there but not implemented with the card placing
πŸ”΅ Once the game starts send data to server so both clients can communicate this is implemented but for now only works with a button, should be called at the start of the scene
πŸ”΅ Once a player places a card replicate action on the other client cards do appear on the other client but issue thrown, something along the lines of missing reference and its not turn based yet
πŸ”΅ Prohibit client from interacting with the other client's card should be implemented but not tested
🟠 Add basic game score mechanic score mechanic is there but for some reason only works on the first call, probable issue with the detection of child objects
🟠 Add basic server checks in the middle of moves to validate moves previous states of the deck and possible cards are all stored in the turnmanager, just need to call it to compare so no "added" cards via exploits are possible
πŸ”΄ Before the start of the game check the deck is valid same as above ^^^^^^^^^^^^^^^^^^^
πŸ”΄ Deal with the outcome of the match there are no turns states implemented yet
🟠 Deal with instances from either players disconnecting early or server failure
πŸ”΄ Deploy mock server on AWS

Additional Notes:

Other usefull links related to this project:


MORE COMING....

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published