This package allows parsing .aurp
replays saved with this mod inside NodeJS environment.
yarn add @tkulpa/among-us-replay-nodejs
or
npm install @tkulpa/among-us-replay-nodejs
const amongUsReplay = require('@tkulpa/among-us-replay-nodejs');
amongUsReplay(`assets/replays/replay.aurp`).then(({ map_id, events }) => {
const p5 = require('node-p5');
const mapData = mapsData[map_id || 0];
function sketch(p, { mapImage }) {
const convertX = (pos) => pos * mapData.scale + mapData.offsets[0];
const convertY = (pos) => pos * -mapData.scale + mapData.offsets[1];
p.setup = () => {
let canvas = p.createCanvas(mapImage.width, mapImage.height);
p.image(mapImage, 0, 0);
setTimeout(async () => {
const filename = await p.saveCanvas(
canvas,
`output/${replayName}`,
'png'
);
console.log(`saved the canvas as ${filename}`);
}, 100);
p.noLoop();
};
p.draw = () => {
p.stroke('red');
p.strokeWeight(10);
events.forEach((e) =>
e.player_states.forEach(
({ is_dead, position_x, position_y }) =>
!is_dead && p.point(convertX(position_x), convertY(position_y))
)
);
};
}
p5.createSketch(sketch, { mapImage: p5.loadImage(mapData.imgPath) });
});
All Players pathing across whole game
Example implementation inside example
folder
All Players pathing across whole game
Example implementation inside example
folder
All Players pathing across whole game
Example implementation inside example
folder