TF2 Map Scrambler

TF2 Map Scrambler 1.0.1

  • Site Migration: See bugs? Report them here. Want something changed or have an idea? Suggest it here.

The_Evil_Pickle

L2: Junior Member
Mar 19, 2015
60
TF2 Map Scrambler - Map randomization for fun and destruction!

Last jam I made a program that tried to create good maps from scratch. This time, I've made a program that ruins perfectly good maps! Why? Because I can! And also because I just didn't have a lot of time to work with and made the first thing that jumped into my head.

Introducing: The TF2 map scrambler! It takes existing maps and randomly swaps around textures, props, lighting, sound effects, and whatever else it can get its hands on.

This program runs on Lua, and is much easier to use than my previous entry. The download zip contains the source code, as well as examples of maps scrambled using it. To run the program, open up the code and change the settings variables found at the top of the file - this is where you need to set up what files the program reads and what parts of the map it scrambles. Then just run the file with lua (you do need to actually install lua, of course).


Here's a list of what the program can do:
  • Scramble surface textures
  • Scramble overlay textures
  • Scramble light colors
  • Scramble render colors
  • Scramble prop skins
  • Scramble prop models [!WIP/Unstable!]
  • Scramble audio soundscapes
  • Scramble ambient audio
  • Scramble control point layout [!WIP/Unstable!]

Common problems and fixes:
  • Broken areaportals: Decompiled valve maps, which are what this was tested on, tend to mess up areaportals. Just hide them in hammer if they cause problems.
  • "too many textinfos" error on complile: This error can pop up when scrambling textures on bigger maps. To fix it, look at the lua file at lines 41-45, "troubleshooting settings." Set the "nonrandomtextureshuffle" variable to some value between 0 and 1. Increasing this value makes the texture shuffling less random and chaotic; keep increasing it until the too many textinfos error stops showing up.
    • for example change
      nonrandomtextureshuffle=0
      to
      nonrandomtextureshuffle=0.8
  • Part of the map is invisible!: Usually this is due to areaportals being broken (see broken areaportals). Can also be caused by water, prop model scrambling, or (rarely) texture scrambling. Try disabling those to make it work.
  • The output file doesn't write properly, it stops after the word "material": If your readfiles list is empty, add the file it should be basing the map on into it.
    • For example if you are reading form cp_steel_d.vmf change
      readfiles = {}
      to
      readfiles = {'cp_steel_d.vmf'}


Example maps included in the download:
koth_nucleus_scrambled
20170807120523_1.jpg 20170807120533_1.jpg 20170807121205_1.jpg
The nucleus scramble used every kind of scramble the program has (except for control point). It's the only map of the three examples to display prop scrambling, as prop scrambling doesn't work for most maps yet.



ctf_turbine_scrambled

20170807121931_1.jpg 20170807121952_1.jpg 20170807122001_1.jpg
Because turbine is all indoors, it is lit entirely with light entities rather than skybox lighting. For this reason, it is an excelent example of how the color scrambling on lights works.


cp_steel_scrambled
20170807123718_1.jpg 20170807123726_1.jpg 20170807123854_1.jpg
As if steel wasn't confusing enough already, it's now been scrambled! The signs leading you to controls points and resupply rooms are all wrong, and the names and hud positions of the control points have been randomized. This scramble was done with
nonrandomtextureshuffle=1, meaning that texture shuffling was entirely consistent (for example all dirt floor textures turned into blue concrete wall textures). If steel is scrambled without this setting, it encounters the "too many textinfos" error when you try to compile it.