openrct2lib
v0.1.3
Published
OpenRCT2 New Savefile Format parser
Downloads
4
Maintainers
Readme
OpenRCT2Lib
OpenRCT2Lib parses OpenRCT2's New Savefile format (*.park).
This offers *.park file's informations, such as Park's name, Scenario's objective and etc.
Install
npm install --save openrct2lib
Example
const OpenRCT2Lib = require('openrct2lib');
let parkData = new OpenRCT2Lib(__dirname + '/Example.park');
console.log(parkData.park.name); // Park's name
console.log(parkData.park.cash); // Park's cash
console.log(parkData.scenario.name); // Scenario's name
Header
Header is not compressed even if the save file is compressed with gzip. | Property | Description | Misc. | |-------------------------|----------------------------------------------|--------------------------------------------------| | header.magic | | | | header.targetVersion | | | | header.minVersion | | | | header.numChunks | Count of chunks | | | header.uncompressedSize | uncompressed size | | | header.compression | 0: uncompressed, 1: gzip | | | header.compressedSize | compressed size | | | header.FNV1a | FNV1a hash | (Offers array of integers yet due to my skill) | | header.padding | It is just a padding, which is filled with 0 | |
Chunk
0x01: Authoring
| Property | Description | Misc. | |------------------------|--------------------------------|-------| | authoring.engine | E.g. "openrct2 v0.1.2 (Linux)" | | | authoring.authors | | | | authoring.dateStarted | | | | authoring.dateModified | | |
0x02: Objects
(Not supported yet)
0x03: Scenario
| Property | Description | Misc. |
|------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|
| scenario.category | Category of the scenario | |
| scenario.name | Name of the scenario | |
| scenario.parkName | Park name of the scenario | |
| scenario.details | Description of the scenario | |
| scenario.objective.type | Objective type in number.1: Guests by {guests}2: Park value by {currency}3: Have Fun!4: Build the best {guest} you can!5: To have 10 different types of roller coasters6: Guests by {guests} with park rating 700 above7: Monthly ride income at least {currency}8: To have 10 roller coasters with min. length {guests}9: To finish 5 coasters with excitement ratings of at least {currency}10: Repay loans and park value with {currency}11: Monthly profit from food/drink/sales of at least {currency} * {guests} = objective.guests
, {currency} = objective.currency
| |
| scenario.objective.typeText | Objective type in text | |
| scenario.objective.year | Year value of objective | |
| scenario.objective.guests | Count of Guests for objective.type=1RideId for objective.type=4Min. length of coaster for objective.type=8 | |
| scenario.objective.currency | Money value for objective.type=2, 7, 10, 11Min. excitement ratings for objective.type=9 | |
| scenario.objective.ratingWarningDays | | |
| scenario.objective.completedCompanyValue | Completed company value | |
| scenario.objective.allowEarlyCompletion | 1 if the scenario early completion is allowed | |
| scenario.objective.scenarioFileName | | Seems not accurate? | | Seems not accurate? |
0x04: General
| Property | Description | Misc. | |-------------------------------|-----------------------|-------| | general.gamePaused | | | | general.currentTicks | | | | general.dateMonthTicks | | | | general.dateMonthsElapsed | | | | general.rand | | | | general.guestInitialHappiness | | | | general.guestInitialCash | | | | general.guestInitialHunger | | | | general.guestInitialThirst | | | | general.peepSpawns | (Not supported yet) | |
0x05: Climate
| Property | Description | Misc. | |---------------------|----------------------------------------------------------------------------------|-------| | climate.state | Current weather state0: Cool and wet1: Warm2: Hot and dry3: Cold | | | climate.updateTimer | | | | climate.current | weathertemperatureweatherEffectweatherGloomlevel | | | climate.next | (Same with above) | |
0x06: Park
| Property | Description | Misc. | |----------------------------------|-------------------------------------------------|-------| | park.name | Park name | | | park.cash | Current cash | | | park.loan | Current loan | | | park.maxLoan | Maximum loan | | | park.loanInterestRate | Interest rate of loan | | | park.parkFlags | | | | park.parkEntranceFee | Entrance fee of the park | | | park.staffHandymanColour | Colour index of Handymans | | | park.staffMechanicColour | Colour index of Mechanics | | | park.staffSecurityColour | Colour index of Securities | | | park.samePriceThroughoutPark | | | | park.numMonths | | | | park.numTypes | | | | park.expenditureTable | | | | park.historicalProfit | | | | park.marketingCampaigns | | | | park.currentAwards | | | | park.parkValue | Current park value | | | park.companyValue | Current company value | | | park.parkSize | Area of the park | | | park.numGuestsInPark | Count of guests in the park | | | park.numGuestsHeadingForPark | Count of guests heading for the park's entrance | | | park.parkRating | Park rating | | | park.parkRatingCasualtyPenalty | | | | park.currentEpenditure | | | | park.currentProfit | | | | park.weeklyProfitAverageDividend | | | | park.weeklyProfitAverageDivisor | | | | park.totalAdmissions | | | | park.totalIncomeFromAdmissions | | | | park.totalRideValueForMoney | | | | park.numGuestsInParkLastWeek | | | | park.guestChangeModifier | | | | park.guestGenerationProbability | | | | park.suggestedGuestMaximum | | | | park.peepWarningThrottle | | | | park.parkRatingHistory | History of park rating | | | park.guestsInParkHistory | History of count of guests in the park | | | park.cashHistory | History of cash | | | park.weeklyProfitHistory | History of weekly profit | | | park.parkValueHistory | History of park value | |
0x08: Research
| Property | Description | Misc. | |--------------------------|-------------|-------| | research.fundinglevel | | | | research.priorities | | | | research.progressStage | | | | research.progress | | | | research.expectMonth | | | | research.expectDay | | | | research.lastItem | | | | research.nextItem | | | | research.itemsUninvented | | | | research.itemsInvented | | |
0x09: Notifications
(Not supported yet)
0x20: Interface
(Not supported yet)
0x30: Tiles
(Not fully supported yet)
| Property | Description | Misc. | |-----------------|-------------|-------| | tiles.mapX | Map width | | | tiles.mapY | Map height | |
0x31: Entities
(Not supported yet)
0x33: Banners
(Not supported yet)
0x36: Cheats
(Not supported yet)
0x37: Restricted objects
(Not supported yet)
0x80: Packed objects
(Not supported yet)
References
- https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/openrct2/park/ParkFile.cpp
- https://raw.githubusercontent.com/OpenRCT2/OpenRCT2/develop/docs/save-format.md
(I think it might be outdated but useful for ref.)