DOWNLOAD
To install, what you want to do is put the file "polymin.CON" in the folder that contains your other CON files, then open one of them up, and near the top add "include polymin.CON"
First of all, results are mixed. In some cases, using this code will substantially increase framerate by introducing some pop-in to the game. In other cases, you get the pop-in without any significant benefit. In some rare cases, it may even give you reduced performance while introducing glitches. A notable success that I had was when adding it to Mark's Medevil TC (based on WGR2). My framerate went from an average of 16 to an average of 35, with the only drawback being some pop-in.
Polymin is an "optimization" in the same way that sawing your family's legs off so that they can all fit in a compact car for the road trip is an optimization. What it does is collapse sectors that you "don't need" at the moment. It also restores them when they are needed, though. So unlike on that roadtrip, your family will have working legs at the end. Probably.
Here are some defined values at the top of file that you can mess with:
define SECTBUFFERDIST 4096 define VIEWCUTDIST 16384 define SECTINC 512 // sectors processed for culling/restoring per-tic define LAGTIME 3 // consecutive tics of low framerate before sector culling begins define FPSTARGET 36 // framerate target
SECTBUFFERDIST is the amount of distance beyond where you are standing and beyond where you are looking before sectors will be collapsed. VIEWCUTDIST is something like the maximum distance your hitscans can go before my code says "you've looked far enough, if the framerate is low then sectors will be cut from that distance on". The other values are explained in the comments above.
Other notes: The code will do nothing unless polymer is the renderer. The code will do nothing until the framerate drops below FPSTARGET. This code does nothing to alter polymer lights. However, lights will automatically stop working in collapsed sectors (and start working again when sectors are restored). If you used this code in combination with code that culled/restored lights or changed/restored lights from spotlights to pointlights, you would probably get additional benefits.
Unfortunately, there are some visual glitches that go beyond pop-in. Not too many, from what I have seen, but I am aware of them. When it comes to bugs, I am more concerned about gameplay stuff (like sector effects getting broken). If you come across anything like that, please let me know. If anyone wants to share any success stories, please do -- I would like to think that this code is useful.
EDIT: A FEW LINES OF MY CODE USE DEFINED LABELS SO FOR GOD'S SAKE INCLUDE THIS CODE BELOW "INCLUDE DEFS.CON".
FOR EXAMPLE IN YOUR GAME.CON IT COULD LOOK LIKE THIS
include DEFS.CON
include USER.CON
include polymin.CON