Fix for maps with deleted brushes

Discussions about UT99
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Fix for maps with deleted brushes

Post by JackGriffin »

This was just posted on Discord:
Xaleros Yesterday at 9:18 AM
I uh, found out something interesting about maps with the brushwork deleted
It actually does not delete the brushes, it just sets the bDeleteMe variable to true so that if you were to rebuild it, it would delete them
but they are actually still stored in the level itself
so it reverse that, literally all you have to do is go through the level, switch all of those variables to 0 instead of 1
and then the brushes are restored
So there's your fix for stripped maps. Anyone want to make an automated script for this? It's time we restored a bunch of maps.
So long, and thanks for all the fish
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Fix for maps with deleted brushes

Post by Chamberly »

Wow... just wow.

So that's why maps were still able to play regardless... Neat!
Image
Image
Image Edit: Why does my sig not work anymore?
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Fix for maps with deleted brushes

Post by sektor2111 »

Yay, challenge accepted... but I cannot be sure if exist any brush in Editor with bDeleteMe because I can iterate and recover them or consolecommand-ing them, but I did not get any response. GarbageCollector did its job somehow ?

Edit:
Yeah, a sample: MH-Egyptica - opening map in NotePad++ exported as t3d and then as UNR. I was looking for string "Brush" - I found... Movers. Did I miss something ?
Edit2: If map without any Brush is smaller, how can I be sure that they are still in Level ? 300K contest maps have small size and one of them has a 400 k version with brushes inside. 100Kb removed by stripping brushes ? How do am I supposed to recover this data and where is it stored (compressed ???) ? Myths from discord ? April fools in January ?
:help:
EDIT3:
Trumph wrote: Fake news...
It's called CTF-300k-FrozenFrag and BSP one it's called CTF-300k-FrozenFrag_bsp. Size is definitely saying that some content from this Level is GONE - NONE. 297kb < 457kb - I need to know the Voodoo Magic turning 297 kb into 457 kb by simply setting up some value from 1 to 0 :what:
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Fix for maps with deleted brushes

Post by Barbie »

Chamberly wrote:So that's why maps were still able to play regardless... Neat!
I think that has nothing to do with the Brushes in a map. The brushes are needed to build a bsp tree (with UnrealED), and the game engine only used this tree when running this map. That's why brushes can be removed from a map while the map is still playable.

I also don't believe that deleted brushes can be recovered after the map has been saved. As Sector said the file size of a map is smaller (about 25% at one example here) if you delete the brushes and store the map so there is significant missing something.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Fix for maps with deleted brushes

Post by sektor2111 »

Barbie wrote:As Sector said the file size of a map is smaller (about 25% at one example here) if you delete the brushes and store the map so there is significant missing something.
Good to see that I do not talk dumb things 90% as nice social people are claiming. Perhaps someone can speak about a constructive solution here... except that big subtract/add used so far.
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Fix for maps with deleted brushes

Post by papercoffee »

JackGriffin wrote:This was just posted on Discord:
Xaleros Yesterday at 9:18 AM
I uh, found out something interesting about maps with the brushwork deleted
It actually does not delete the brushes, it just sets the bDeleteMe variable to true so that if you were to rebuild it, it would delete them
but they are actually still stored in the level itself
so it reverse that, literally all you have to do is go through the level, switch all of those variables to 0 instead of 1
and then the brushes are restored
So there's your fix for stripped maps. Anyone want to make an automated script for this? It's time we restored a bunch of maps.
And where do I go through the level? That's a little bit vague.
User avatar
Gustavo6046
Godlike
Posts: 1462
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Resident Wallaby
Location: Porto Alegre, Brazil
Contact:

Re: Fix for maps with deleted brushes

Post by Gustavo6046 »

And how would you do that when all the data you have is BSP? You can't open it in Notepad. The best solution would be to make some weird sort of UnrealEd plugin that iterates on every brush actor and set that variable, but even then, I have my doubts. Sektor has a valid point (how rare!), and I'm sure the brushes are indeed deleted (in most striped maps, anyway), and the only reason the map playable is that it has BSP leftovers (its geometry hasn't been rebuilt).

Moreover, if a map author doesn't want a derivate of any of his work to be published, we need to respect it. It's pretty much the same as breaking the terms of a license that disallows derivate work, except there is no license, and I'm pretty sure it would be much more difficult to be taken to court for that.
"Everyone is an idea man. Everybody thinks they have a revolutionary new game concept that no one else has ever thought of. Having cool ideas will rarely get you anywhere in the games industry. You have to be able to implement your ideas or provide some useful skill. Never join a project whose idea man or leader has no obvious development skills. Never join a project that only has a web designer. You have your own ideas. Focus on them carefully and in small chunks and you will be able to develop cool projects."

Weapon of Destruction
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Fix for maps with deleted brushes

Post by PrinceOfFunky »

Why would you need all the vertices of brushes if you can have less than half usually in an entire map? Why keeping a brush which of most vertices are stuck in another brush? Or keeping the vertices of a subtracted brush. I believe the brushes get converted into Level when you build them, indeed when you build a brush and move the brush somewhere else the built brush is still there until you rebuild.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

Re: Fix for maps with deleted brushes

Post by FraGnBraG »

Ya'll know this is a bunch of Malarky?

There is no flag called bDeleteMe in UT99. There is in ut 2003/4. I believe this is for something else (it only occurs once).

Using 300k FrozenFrag as an example - the CSG brush data is gone gone gone. When you delete the csg brushes and save, the data is gone.
If the map was built, then there is still the compiled data, of course. The 2d viewports don't lie - they use csg brush data to draw lines.
3d views used the compiled data (we refer to as "bsp"). So you can still see things in these views.

Most you can do to recover a brushless map for editing is this:
surround the whole thing with a giant cube builder brush and then de-intersect. subtract the brush and order to first. rebuild.
tada! of course only works with simple maps - I think (correct me if i'm wrong, but you only have about 500 surfaces per brush
before it blows up in UED ... some such thing :)
2019-01-15_20-34-55.jpg
If the single brush is not TOO BIG then you could subtract this and add or subtract some extra brushes from it.
Lots of chances for HOMs though...

Another example: Not 100% sure, but this one smells like it was "recovered" and then edited (Thornsv3)
There were tons of these back in the day...
2019-01-15_21-08-08.jpg
-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Fix for maps with deleted brushes

Post by JackGriffin »

Between Funky and Frag I think that pretty much sums up things nicely in a way I've never really thought of. Funky is right that when the map is built the brushes convert to level. That's the key thing to remember. Once those brushes get converted they really aren't needed any longer. You can delete all of them and everything is fine as long as you don't rebuild. Frag's example of encompassing the level in a brush works because the level data is still there, just not the individual brush data.

I now think of brushes in a map as a list of instructions for the compiler. Once the instructions are followed you don't really need to leave them in. It also logically follows that you can't de-engineer the map back into the component brushes because a lot of that data is lost in the compiling. Overlapping brushes, intersecting areas, all that would no longer be necessary information. The engine doesn't need any more data than the resulting shape after the brushes are applied. Really this is just designing something like a chair in editor but just on a larger scale.

Damn, that feels good to finally understand. Thank you guys. Now it's settled: there will never be a way to recover stripped maps. Some data is simply not retrievable.
So long, and thanks for all the fish
User avatar
UTPe
Masterful
Posts: 583
Joined: Sun Jul 12, 2009 7:10 pm
Personal rank: Dude
Location: Trieste, Italy
Contact:

Re: Fix for maps with deleted brushes

Post by UTPe »

ouch, I've been dreaming like a fool for some seconds :lol2:
anyway, I found this somewhere time ago, maybe can help (it's about the de-intersect method).

greets,
Pietro
Attachments
Restoring Deleted Brushes.pdf
(851.33 KiB) Downloaded 60 times
Personal map database: http://www.ut99maps.net

"These are the days that we will return to one day in the future only in memories." (The Midnight)
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Fix for maps with deleted brushes

Post by Feralidragon »

There's in fact a very simple way to know if the brushes are still there or not, rather than assuming they aren't just because the file size is smaller (which could happen for other non-obvious reasons, such as some editor-specific cleanup): open one of those maps in UTPT and check if there are any brushes.

I never checked it myself, so I am not sure what you will find there, but it will become clear as crystal which is the case once you do.
No need to make potentially false assumptions (not saying the brushes are there, everything indicates they aren't, but you have to open the map and see the binary contents with UTPT for example to be 100% sure).
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Fix for maps with deleted brushes

Post by PrinceOfFunky »

Feralidragon wrote:There's in fact a very simple way to know if the brushes are still there or not, rather than assuming they aren't just because the file size is smaller (which could happen for other non-obvious reasons, such as some editor-specific cleanup): open one of those maps in UTPT and check if there are any brushes.

I never checked it myself, so I am not sure what you will find there, but it will become clear as crystal which is the case once you do.
No need to make potentially false assumptions (not saying the brushes are there, everything indicates they aren't, but you have to open the map and see the binary contents with UTPT for example to be 100% sure).
Surely exporting to T3D won't export any brush except for the active one.

Many games turn their static objects into one or a few unified objects, especially for those games that had to fit in a small storage like PS1 games, it's like baking in Blender.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Fix for maps with deleted brushes

Post by Barbie »

PrinceOfFunky wrote:Surely exporting to T3D won't export any brush except for the active one.
Do not use Menu>Brush>Export but Menu>File>Export to export the complete map.
Feralidragon wrote:a very simple way [...]: open one of those maps in UTPT and check if there are any brushes.
My first guess is that UTPT reads the name table only. My second is there may be differences between the name table and the data content of a package. I stumbled over that while I was coding a program that reads a package and tries to detect duplicate Actors. The name table is clean in this case, but I guess that UnrealEd reads the content and therefore shows Actors with duplicate (or even multiple names).

See for example "Miniammo2" from map MH-Dark-Laws{fix}.unr in UTPD and UnrealEd.
MH-Dark-Laws{fix}-UTPT.jpg
MH-Dark-Laws{fix}-UnrealEd.jpg
Last edited by Barbie on Wed Jan 16, 2019 5:51 pm, edited 1 time in total.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

Re: Fix for maps with deleted brushes

Post by FraGnBraG »

PrinceOfFunky wrote:Why would you need all the vertices of brushes if you can have less than half usually in an entire map? Why keeping a brush which of most vertices are stuck in another brush? Or keeping the vertices of a subtracted brush. I believe the brushes get converted into Level when you build them, indeed when you build a brush and move the brush somewhere else the built brush is still there until you rebuild.
ya true - this reminds me of some thoughtful things. It is not too hard to imagine what the compiler is doing with brush data in order to process the "bsp-tree". I actual have/had (engineering) documents how these algorithms work.

Abstractly, the business of lining vertices up all neat and tidy on the uu grid otherwise it's a disaster is a bit silly. That's just humans being tidy.

It's all 3D math using double-precision numbers, rounding (at some depth/tolerance) and triangles with normals so the compiler knows which face is in space, or the void.
Basically the compiler/algorithm only cares about the faces in the space side of normals, ignoring the void. So really, additive csg brushes that exist in or extend into the void is basically IGNORED by the complier. Of course the exposed part is used in calculations.

There's more to it obviously, like occlusion (data to support what to render to the camera (FOV / POV), collision, lightmapping blah blah). Lots of room for ERRORS - resulting in things like hommies, holes, invisible "walls", black blotches etc.

Some guys, knowing this, would consciously throw mud in the face of the so-called "guru" mappers (in the editor, of cource). A favorite example of mine is Blito3 and his map "Island of the skull devils". Open it in the editor and have a look. Hilarious! And it works - of course it does :P Now try and find HOMs. Good luck - i don't believe you'll find any. Now open CTF-Tuesday (by you know who) not hard to find HOMs in that one, as I recall.

Anyways, fun stuff, as always :D

Cheers
-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
Post Reply