/quake3_log_parser

Quake 3 log parser (Test for Cloudwalk software engineering position)

Primary LanguageTypeScript

How to use

  1. To group the game data of each match, run the following command and this will create a file called "Killed_parsed.log" with the corresponding data:
npx ts-node src/killsParser.ts
  1. To create a script that prints a report (grouped information) for each match and a player ranking, run the following command and this will create a file called "Kills_per_game.json" with the corresponding data:
npx ts-node src/killsPerGame.ts
  1. To generate a report of deaths grouped by death cause for each match, run the following command and this will create a file called "Deaths_by_cause.json" with the corresponding data:
npx ts-node src/deathsByCause.ts

(These steps do not need to be sequential)

To run all three scripts at once, run:

npm run all

Testing

To run all the tests for the project, run:

npm test

1. Introduction

This test is intended for candidates applying to Software Engineering positions at CloudWalk.

You are welcome to use a programming language that you are comfortable with.

2. Requirements

  • Git
  • A development environment
  • Quake game log

3. Tasks

3.1. Log parser

Create a project to parse the Quake log file.

The log file was generated by a Quake 3 Arena server, including a great deal of information of every match.

The project should implement the following functionalities:

  • Read the log file
  • Group the game data of each match
  • Collect kill data

Example


21:42 Kill: 1022 2 22: <world> killed Isgalamido by MOD_TRIGGER_HURT

The player "Isgalamido" died because he was wounded and fell from a height enough to kill him.


2:22 Kill: 3 2 10: Isgalamido killed Dono da Bola by MOD_RAILGUN

The player "Isgalamido" killed the player "Dono da Bola" using the Railgun weapon.

Example of grouped information for each match:

"game_1": {
"total_kills": 45,
"players": ["Dono da bola", "Isgalamido", "Zeh"],
"kills": {
	"Dono da bola": 5,
	"Isgalamido": 18,
	"Zeh": 20
	}
}

Additional notes:

  • When kill a player, that player loses -1 kill score.
  • Since is not a player, it should not appear in the list of players or in the dictionary of kills.
  • The counter total_kills includes player and world deaths.

3.2. Report

Create a script that prints a report (grouped information) for each match and a player ranking.

3.3. Plus

Generate a report of deaths grouped by death cause for each match.

Death causes (extracted from source code)

// means of death
typedef enum {
MOD_UNKNOWN,
MOD_SHOTGUN,
MOD_GAUNTLET,
MOD_MACHINEGUN,
MOD_GRENADE,
MOD_GRENADE_SPLASH,
MOD_ROCKET,
MOD_ROCKET_SPLASH,
MOD_PLASMA,
MOD_PLASMA_SPLASH,
MOD_RAILGUN,
MOD_LIGHTNING,
MOD_BFG,
MOD_BFG_SPLASH,
MOD_WATER,
MOD_SLIME,
MOD_LAVA,
MOD_CRUSH,
MOD_TELEFRAG,
MOD_FALLING,
MOD_SUICIDE,
MOD_TARGET_LASER,
MOD_TRIGGER_HURT,
#ifdef MISSIONPACK
MOD_NAIL,
MOD_CHAINGUN,
MOD_PROXIMITY_MINE,
MOD_KAMIKAZE,
MOD_JUICED,
#endif
MOD_GRAPPLE
} meansOfDeath_t;

Example

"game-1": {
"kills_by_means": {
	"MOD_SHOTGUN": 10,
	"MOD_RAILGUN": 2,
	"MOD_GAUNTLET": 1,
	...
	}
}

4. Deliverable

You can deliver the code by sharing the repository with the interviewer in any public service (Github, BitBucket, Gitlab), or by sending the zip git repository. Align with the interviewer which best fits you.

Enjoy :)

The evaluation will cover:

  • Overall implementation (accuracy, readability, etc)
  • Git skills (fragmentation, commit messages, etc)
  • Documentation (source code, readme file, etc)
  • Testability (testing framework, coverage, etc)