Implement core TypeScript game engine#3
Open
Spbd1 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
packages/engine/srcincludingtypes.tsplus modulesrandom.ts,gini.ts,mapGenerator.ts,production.ts,decisions.ts,contracts.ts,shocks.ts,roundResolver.ts,serverSimulator.ts,scoring.ts, andvalidation.ts, and exported everything fromindex.ts.random.ts(SeededRandom/createRandom) and used it inmapGenerator.tsto create a 10x10 parcel grid with parcel fields (x,y,soil,water,marketAccess,risk,quality) and LOW/HIGH inequality quality mappings and aparcelQualityGinihelper; addedgini.tsfor Gini calculation.production.tswith defaults (A = 10,betaQ = 0.8,betaK = 0.5) and shock multipliers; implemented deterministic shock generation and schedules inshocks.tsand contract creation/resolution and reliability computation incontracts.ts(informal vs formal fee/default risk differences).validation.tsanddecisions.ts(action points, resource cost checks, exited-player prevention, parcel ownership checks, contract fees/treasury transactions, public good payouts, investments, safe assets, lobbying, exit), deterministic institutional rule changes at rounds 3 and 5 forUNCERTAINservers inserverSimulator.ts, aresolveRoundfunction inroundResolver.tsthat returns updated server/players/parcels/contracts/events/treasury/summary, scoring metrics inscoring.ts, and arunServerSimulationhelper to run multiple rounds.index.test.tscovering deterministic map generation,gini, production output, action-point validation, overspending checks, exited-player prevention, deterministic shock schedule, inequality Gini comparison, and a basic round resolution sanity check.Testing
tsc --noEmit -p packages/engine/tsconfig.build.jsonwhich completed successfully for the new engine sources.prettier --write packages/engine/srcto format the new files successfully.pnpm --filter @parcel-society/engine test(Vitest) but execution failed becausenode_modulesare not present in this environment andvitestis unavailable; the test suite is included and will run in CI or after installing dependencies (pnpm install).pnpm installbut it was blocked by the environment (npm registry returned403 Forbidden), so external tool-based checks (Vitest, ESLint) could not be executed here.Codex Task