dedit
a tool for Teeworlds demo file shenanigens
git clone https://jhhm.no/repos/dedit.git
dedit/README.md
get raw file: README.md
1 2 3# dedit 4 5Dedit is a [Teeworlds](https://teeworlds.com/) / [DDNet](https://ddnet.org/) 6demo inspector and editor, written in portable C99 with zero external 7dependencies beyond the standard C library. The code repository is hosted 8[here](https://jhhm.no/repos/dedit) and on 9[GitHub](https://github.com/johannesHHM/demo-edit). 10 11## features 12 13- rename tees 14- change the skin of tees 15- change the map of the demo 16- merge data from multiple demos 17- extract the map from the demo 18- print chat log (same as [demo_extract_chat](https://ddnet.org/codebrowser/DDNet/tools/demo_extract_chat.cpp.html)) 19- print information about each demo chunk 20 21## status & future work 22 23Dedit is currently only tested and confirmed working for demo versions 5 and 6 24(DDNet), and the Teeworlds 0.6 network protocol. I might tinker with supporting 25older demo versions, but the use case for this would be slim to none. Support 26for the 0.7 network protocol is planned, but I don't know when I will get 27around to implementing it. 28 29## compile 30 31Requires a C99 compiler and a POSIX compatible `make`. 32 33```sh 34make 35``` 36 37## examples 38 39Below are a couple of examples that should run without issue after compiling. 40 41Prints info of `clip.demo`. Info consists of demo header and chunk counts. 42```sh 43./dedit testdata/clip.demo --info 44``` 45 46Rename player with clientid 3 to *holymadtee*, change map to `ice.map` 47and save the output to `out.demo`. 48```sh 49./dedit testdata/clip.demo --rename 3 holymadtee --map testdata/ice.map --output out.demo 50``` 51 52Set the skin of player with name *New Hero* to *bomb*, rename *New Hero* 53to *Bob-omb*, change map to `jungle.map` and save the output to `out.demo`. 54```sh 55./dedit testdata/clip.demo --skin "New Hero" bomb --rename "New Hero" Bob-omb --map testdata/jungle.map -o out.demo 56``` 57 58Merge demos `catchup_hero.demo`, `catchup_hex.demo` and `catchup_faceless.demo` 59and save the output to `out.demo`. 60```sh 61./dedit testdata/catchup_hero.demo -M testdata/catchup_hex.demo -M testdata/catchup_faceless.demo -o out.demo 62``` 63 64Tip: `out.demo` can be quickly viewed by running 65```sh 66DDNet out.demo 67``` 68 69## help 70 71``` 72Usage: dedit <demo> [OPTIONS] 73 74Argument: 75 <demo> Sets input demo 76 77Options: 78 -r, --rename <id/name> <name> Renames player with id/name to name 79 -s, --skin <id/name> <skin> Set skin of player with id/name to skin 80 -m, --map <map> Changes the map of demo to map 81 -M, --merge <demo> Merges the game data of demo into input demo 82 -e, --extract-map <file> Saves the map of demo to file 83 -o, --output <file> Saves the output demo to file 84 -i, --info Prints info of demo 85 -I, --extended-info Prints extended info of demo 86 -c, --chat Prints the demo chat log 87 -h, --help Prints this help info 88``` 89 90## credits 91 92Some functions/implementations are heavily inspired by other sources. 93They are commented in the code with links to their references. 94Below are some credits: 95 96- [libtw2](https://github.com/heinrich5991/libtw2): variable length int implementation, demo/snapshot documentation 97- [Teeworlds](https://github.com/teeworlds/teeworlds): huffman implementation 98- [DDNet](https://github.com/ddnet/ddnet): some demo writing specifics 99 100## license 101 102This project is licensed under the GNU General Public License Version 3 103(or, at your option, any later version). See the `LICENSE` file for the 104full license text. 105 106This project also includes code that is derived from other sources, with 107their own licenses. See the `NOTICES` file for additional copyright, 108license, and attribution information.