Actors with duplicate names (MH-Ziki)

Tutorials and discussions about Mapping - Introduce your own ones!
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Actors with duplicate names (MH-Ziki)

Post by Barbie »

OjitroC wrote:I find that there is a tendency for bots to jump/fall into the lava and slime.
No problem, when I'm ready I'll send it to our Master of AI and he will manage that :rock:
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Actors with duplicate names (MH-Ziki)

Post by Barbie »

(Yep, I missed your post, sorry)
Red_Fist wrote:Seems all I did was delete one of the dups, in the map editor, even though it STAYS in the editor even though looking like it is not deleted.
If you select such an Actor, the editor's Actor Properties window always shows "(2 selected)". If you choose Menu>Edit>Delete, the "(2 selected)" vanishes and also the Actor Search window shows only one now. (BTW: you cannot delete that one remaining also, there just happens nothing if you try it.) Regardless of rebuilding or not, after saving the map, closing the editor, end opening the map again in the editor, the remaining Actor is also gone!
(The only duplicate Actor I found in your map MH-Spillway_XXL72em.unr (23 Dec 2015) was "szoktarudi29" (whatever this is). See if you can find it after deleting, saving and re-opening.)
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Actors with duplicate names (MH-Ziki)

Post by sektor2111 »

Confusion
Master of AI is Higor which was doing dynamic pathing, so to speak in some empty cubes Bot is able to move based on what does Botz mutator - adding NavigationPoints in run-time, the rest of BT tweaking still doesn't exist attached but maybe someday will be doable.

As for using Editor related to A.I., oh well, in there, many and more things are doable - if exist dedication and addiction. From this UT, for clarification, Bot Support is the easiest job ever... because:
- it won't cause BSP;
- it won't look ugly because of some blue color abused;
- it won't affect some light flickering;
- Bot won't complain in forum because some wall is too ugly build or because some stuff there is useless.
Red_Fist
Godlike
Posts: 2165
Joined: Sun Oct 05, 2008 3:31 am

Re: Actors with duplicate names (MH-Ziki)

Post by Red_Fist »

ah I am mistaken, I went through the search actor list and was able to delete one at a time doing that. Just click it so you are one the one you click in the list, hit DEL. It moves fairly fast, but I know what you mean if they had piles of them duplicates.

I cleaned up the spillway dups, it wasn't that many. but when I did delete the one it doesn't disappear in the editor.

Weird on spillway, is that, it was one section of the map that had them. I wonder what people are doing to cause that.
Binary Space Partitioning
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Actors with duplicate names (MH-Ziki)

Post by Barbie »

OMG, found the next one with duplicate (68) Actors: MH-MJD_FIX3 aka "MH-MJD][". I stumbled over it because the server hung at cleaning up after finishing the map.

I tend to write a small command line program that shows if a map has this issue or not.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Actors with duplicate names (MH-Ziki)

Post by sektor2111 »

Yep, now you have convinced me to write a mutator tester tool. I'm thinking to record them or just report how many duplicates have been found... on log file and on screen as well.
Perhaps is good to know which of these "truly awesome Levels" needs removal.

EDIT: Pheew! Good and bad... Iterator AllActors doesn't work through some... eh... however 14 pieces are reported and 11 in MH2 so it's relevant somehow. Also I'm guessing Level gets wrapped a bit when is loaded... replacements, etc.
Some log + dupes

Code: Select all

DevMusic: Load music: Music utmenu23.utmenu23
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Teleporter0
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Teleporter1
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Teleporter0
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Teleporter1
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > LavaZone1
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > LavaZone1
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > ASMDAmmo4
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Health8
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Trigger70
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Health9
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Health10
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > SpecialEvent9
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > ExplodingWall2
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > ExplodingWall3
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Mover30
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Mover31
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > ASMDAmmo4
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Health8
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Trigger70
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Health9
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Health10
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > SpecialEvent9
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > ExplodingWall2
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > ExplodingWall3
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Mover30
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > Mover31
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > SpecialEvent5
ScriptLog: MH-ziki.Tester0 HIT >> Duplicate Actor found > SpecialEvent5
...
ScriptLog: MH-ziki.unr having 887 actors, contains 11 duplicated actors.
Iterators seems to get messy a bit in these types of Levels which proves not a good thing.

Edit:
Spoiler
DevMusic: Load music: Music Mech8.Mech8
ScriptLog: XC: Helper Win Closed
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush1262
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light90
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light90
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light41
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light39
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light40
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light42
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light250
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light6
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light41
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light39
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light40
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light42
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light250
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light6
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light33
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light17
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light33
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light17
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush266
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Brush266
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Tree2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Tree2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light54
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light51
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light53
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light50
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light54
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light51
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light53
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light50
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light216
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > Light216
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SkyZoneInfo0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SkyZoneInfo0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack1
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack3
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack4
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack6
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack7
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack8
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack9
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack10
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack1
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack3
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack4
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack6
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack7
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack8
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack9
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > RocketPack10
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox1
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox3
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox4
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox6
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox7
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox1
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox3
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox4
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox1
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox3
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox4
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox6
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SteelBox7
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox1
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox2
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox3
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox4
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > SmallSteelBox5
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > EscapePod0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > MonsterEnd0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > EscapePod0
ScriptLog: MH-MJD_FIX3.Tester0 HIT >> Duplicate Actor found > MonsterEnd0
ScriptLog: MH-MJD_FIX3.unr having 2462 actors, contains 52 duplicated actors.
I think this will be my admin tool for first basic check - NOT really for server, but only a pre-check tool. I wanna know which Levels doesn't worth any effort, heh "FIX3" :thudown: even if several brushes are not took in account by iterator the rest seems reported. I could store them in some array with a more fancy report, but... is too much effort for garbage after all.
Map_Dup.zip
(2.69 KiB) Downloaded 68 times
Dependencies are only CORE and ENGINE.
Edit:
If a crash does occur due to Iterator Limit (10000000 or such) because of a huge Level, we can get the slower way bypassing over 10000000 using another way.
Map_Dup2.zip
(2.46 KiB) Downloaded 76 times
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Actors with duplicate names (MH-Ziki)

Post by Barbie »

sektor2111 wrote:NOT really for server, but only a pre-check tool
Yep, it does not make really sense to check this on every map load.

BTW: Your algorithm shows every duplicate twice. Instead of an dynamic list or an array I use simply a string to store the names:

Don't use the following code - see thread viewtopic.php?f=15&t=11380
Spoiler

Code: Select all

DONT USE - SEE thread "https://ut99.org/viewtopic.php?f=15&t=11380"
function int CheckDuplicateActors() {
local Actor A;
local string s;
local int result;

	s = ":";
	foreach AllActors(Class'Actor', A)
		if (InStr(s, ":" $ A.Name $ ":") >= 0)
		{
			log("CheckDuplicateActors: Actor" @ A @ "has duplicate name");
			result++;
		}
		else
			s = s $ A.Name $ ":";
	return result;
}
<edit 2016-03-27>Added hint "don't use"</edit>
Last edited by Barbie on Sun Mar 27, 2016 2:37 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
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Actors with duplicate names (MH-Ziki)

Post by sektor2111 »

Yes, as shown in log and then will show "number/2" of duplicates = in game duplicates, but we have even 4 the same brush, it's good for showing if Level has problems, the rest of very very fine tuning doesn't make sense, it's not a common mutator it's a checker. We check if exist troubles, if yes fix/delete Level, if not, go for it. I would like to see your tool.
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Actors with duplicate names (MH-Ziki)

Post by Barbie »

sektor2111 wrote:I would like to see your tool.
My yesterday's approach was to use existing programs, basically the following

Code: Select all

%UCC% batchexport %1 Level t3d %TMPDIR%
find "Begin Actor" %T3DFILE% | sort | %UNIQ% -D
but UCC.EXE does the export only if all map dependencies can be solved. This is a unnecessary restriction, and so my next try will be reading the map file directly in a Win32 application - just waiting for the wiki... :sleep:
<EDIT>
Reading the name table directly from map package and analysing it showed that it is clean (no duplicates). Unfortunately the wiki does not provide enough information how to read the data section beside the header so that I have to stay with the above given UC code for a mutator or GameInfo.
</EDIT>
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Actors with duplicate names (MH-Ziki)

Post by sektor2111 »

Bump here, I wanna see an alternate version of DuplicateChecker or TrashFinder or GarbageLevelFinder mutator tool usable by new admins (or non-admins as now days is trendy...).

Community needs such tools and I'm wondering why nobody mentioned nothing all this time...
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Actors with duplicate names (MH-Ziki)

Post by Barbie »

As written above, I have no information about reading the data section of an Unreal Package, and I definitively do not want to find it out by trail end error. So my native Win32 application has to wait until I find that information somewhere.

For the meantime I've written a small bash script that exports the map with UCC, extract the lines starting with "Begin Actor" and checks if there are duplicate lines. A run over the 260 maps on my server showed that 18 maps (~7%) have issues.
Spoiler
53ea3744e8605a1331ffe77d65aaf30d ../Maps/MH-400K-Slope.unr: DUPCOUNT=3
bb6213f4657ffc201a10a21b68e31c4e ../Maps/MH-Andromeda-Ancient-Test1V.unr: DUPCOUNT=1
6dbccff34b6cf771532c0a6683a4978a ../Maps/MH-AutoRIP(SB).unr: DUPCOUNT=1
b3d999cc710fec084e6d276551c81337 ../Maps/MH-Bluff+SBFix.unr: DUPCOUNT=1
cf8dac06ed3d9a4d33e9d5af40c318f6 ../Maps/MH-Brute.unr: DUPCOUNT=4
3007909b2589354d8afd73964db4754d ../Maps/MH-Cryptrunners{fix}.unr: DUPCOUNT=18
48090772f190bc119a242391761ce90c ../Maps/MH-DKDasaCellars{fix}.unr: DUPCOUNT=2
10ac8ec4465a47fbe437cc42805d4aa8 ../Maps/MH-Gauntlet.unr: DUPCOUNT=1
2bef91b9b5cb7d06584584cfb9afd89a ../Maps/MH-Glacialis_Beta3.unr: DUPCOUNT=68
89e125467339d5f1ca5df103b0d7b75e ../Maps/MH-HTD-Victory-ComplexF2.unr: DUPCOUNT=122
74ada57f7359f7e411b3a2356411eb9a ../Maps/MH-Human_PreyS-HTD+.unr: DUPCOUNT=14
7c7e2c7ae1e9edc05e681cb96fe3d91b ../Maps/MH-Illustrious2.unr: DUPCOUNT=15
6afebc36db3e1170e131ee797f265504 ../Maps/MH-LandsOfNapali.unr: DUPCOUNT=2
1dfb0f3fa048a35aa246b5ce026f282d ../Maps/MH-MJD][.unr: DUPCOUNT=65
6ade9fac1e0110706d2d1572eab50ddb ../Maps/MH-NaliC.unr: DUPCOUNT=2
60162b272d6f0fb39d58d55cddffd45c ../Maps/MH-November_AI.unr: DUPCOUNT=2
1548ad492da4305f53e6ce6638858c69 ../Maps/MH-ProxyMoon_V2.unr: DUPCOUNT=1
283226bd4d761d15c9bcf2d391907969 ../Maps/MH-Spillway_XXL72em.unr: DUPCOUNT=1
The script:

Code: Select all

#!/bin/bash

declare -r UCC_BIN=./ucc-bin # working dir MUST be the System directory...

########## no changes below needed ##########

declare -r TMPDIR="$(mktemp -d)"
declare -r T3DFILENAME=MyLevel.t3d
declare -r T3DFILE=$TMPDIR/$T3DFILENAME
declare -ri VERSION=20150317
declare -r  PROGNAME=FindDuplicateActors
declare -r  AUTHOR="SeriousBarbie AT googlemail MAKEADOT com"

function ErrorExit {
    echo "ERROR: $@"
    exit 1
}

function help {
	echo $PROGNAME, version $VERSION
    echo "usage: $0 <unreal package file name>"
    echo "to list duplicate actors in that package"
	echo report bugs to $AUTHOR
    exit 0
}

test -z "$1" && help
test -r "$1" || ErrorExit "file \"$1\" not found"
test -x "$UCC_BIN" || ErrorExit "UCC_BIN \"$UCC_BIN\" is not executable"
if [ -f "$T3DFILE" ]; then
	rm "$T3DFILE" || ErrorExit "could not remove old T3D file \"$T3DFILE\""
fi

$UCC_BIN batchexport "$1" Level t3d "$TMPDIR" -nohomedir > /dev/null || ErrorExit "an UCC error occoured"
test -f "$T3DFILE" || ErrorExit "coud not find T3D file \"$T3DFILE\""
DUPCOUNT=$(grep "Begin Actor" "$T3DFILE" | sort | uniq -d | wc -l)
if [ ! "$DUPCOUNT" == "0" ]; then
  echo "$(md5sum $1): DUPCOUNT=$DUPCOUNT"
fi
rm "$T3DFILE" || ErrorExit "Could not delete T3D file \"$T3DFILE\""
rmdir "$TMPDIR" || ErrorExit "Could not delete temporary directory \"$TMPDIR\""
<EDIT 2016-05-10>
If you need a current (and improved) version of this script, just PM me.
</EDIT 2016-05-10>
Last edited by Barbie on Tue May 10, 2016 8:21 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
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Actors with duplicate names (MH-Ziki)

Post by sektor2111 »

Thanks for the list, Barbie.
Note: CTF-November by default seems fascinating... those duplicated lights are not only a bad thing but... are even useless in game too, look where they have been placed :wth: . Thank you, Cannon... to not forget defenses and the rest...

Edit: My trash-tool was able to find these so I think it will be my primary tool in checking stuff. I'm gonna add it first in MH playground and then in the rest (CTF/DM). In max. 2 weeks I'll clean up the trash.

Edit2: I would like to see another Uscript-ed one as long as I won't use Linux. So far in Windows, XC stuff works cute (might still crash in different Linux builds). To not mention that some XC natives are fixing and improving Engine so it will be my primary tool, so I'm more than motivated to stay on "DLL".
//off-topic
Feel free to test how Works default PlayerCanSeeMe() vs Linux version vs XC version - go figure what I mean... I'll try to stay on topic.
//end for off-topic
Actor-Mutator will be loaded into Mapvote, starting game, waiting, checking results - saving map-name - stop server, removing all those trash-types, end of cleaning job.

Edit:
Previous seeker was OK against infinite recursions crashes but not faster... Reconsidering that method needs a "speed-up" I think I did it. Let's say a map with 4000 Actors will be checked in 5 seconds not 15-20 as it was.
Changes here:
Spoiler

Code: Select all

class Tester2 expands Mutator;

var bool bPostInit, bFirstAcquisition, bInProcess;
var int NAc, NBugs, Totals, NTest, NRate;
var Name Older, Bugger;
var Actor Crt, ATest;
var int i;

event BeginPlay()
{
	if ( !bPostInit )
	{
		bPostInit = True;
		SetTimer(Level.TimeDilation*3,False);
		CountNeeds();
	}
	else
	{
		log (Self$" > Called again... Denied!");
		return;
	}
}

function CountNeeds()
{
	local Actor A;

	Totals = 0;
	foreach AllActors(class'Actor',A)
	{
		NRate++;
		Totals++;
	}
	bInProcess = True;
	NAc = -1;
}

function DoStart()
{
	local Actor A;

	foreach AllActors(class 'Actor', A )
	{
		NRate++;
		NAc++;
		if ( NAc == NTest )
		{
			if ( NTest < Totals )
				NTest++;
			Older = A.Name;
//			log ( Self@"check"@Older@"of"@Totals@"at position"@NTest );
			Crt = A;
			break;
		}
		if ( NTest >= Totals )
		{
			bInProcess = False;
			Crt = None;
			bFirstAcquisition = True;
		}
	}
	NAc = -1;
}

function LookDupe()
{
	local Actor Atest;

	foreach AllActors (class'Actor',ATest)
	{
		NRate++;
		if ( Older == ATest.Name )
		{
			i++;
			if ( i == 2 )
			{
				NBugs++;
				log (Self$" HIT >> Duplicate Actor found >"@ATest.Name);
			}
		}
	}
	i = 0;
}
/*
function int CheckDuplicateActors()
{
	local Actor A;
	local string s;
	local int NBugs;

	s = ":";
	foreach AllActors(Class'Actor', A)
	Nac++;
	if (InStr(s, ":" $ A.Name $ ":") >= 0)
	{
		log("CheckDuplicateActors: Actor" @ A @ "has duplicate name");
		NBugs++;
	}
	else
		s = s $ A.Name $ ":";
	return NBugs;
}
*/
//-------------
Auto State StartUp
{
Begin:
	Sleep (2.00);
	NRate=0;
	if ( !bFirstAcquisition && bInProcess )
Looping:
	CountNeeds();
	if ( NRate > 900000 )
	{
		NRate=0;
		Sleep(0.000001);
	}
	DoStart();
	if ( NRate > 900000 )
	{
		NRate=0;
		Sleep(0.000001);
	}
	if ( Crt != None )
		LookDupe();
	if ( bFirstAcquisition && !bInProcess )
		Stop;
	Goto('Looping');
}
//------------------
event Timer()
{
	if ( DeathMatchPlus(Level.Game)!= None )
	{
		if ( DeathMatchPlus(Level.Game).bRequireReady && Level.NetMode != NM_StandAlone )
		{
			BroadcastMessage("Scanning Duplicated Actors in Level >"@Level.GetURLMap());
			SetTimer(Level.TimeDilation*4,False);
		}
		else
		{
			if ( bFirstAcquisition )
			{
				if ( NBugs > 0 )
				{
					NBugs=NBugs/2;
					log (Level.GetURLMap()@"having"@Totals@"actors, contains"@NBugs@"duplicated actors.");
					BroadcastMessage("This Level >"@Level.GetURLMap()@"having"@Totals@"actors, contains"@NBugs@"duplicated actors.");
				}
				else
				{
					log (Level.GetURLMap()@"has"@Totals@"actors, and NONE duplicate actors.");
					BroadcastMessage("This Level >"@Level.GetURLMap()@"has"@Totals@"actors, and NONE duplicate actors.");
				}
			}
			else
			{
				BroadcastMessage("Scanning Duplicated Actors in Level >"@Level.GetURLMap()$". Done"@NTest@"of"@Totals$"..." );
				SetTimer(Level.TimeDilation*4,False);
			}
		}
	}
}
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Actors with duplicate names (MH-Ziki)

Post by Barbie »

Some more investigations have shown that not all duplicates are found by the AllActors iterator, for example 'Brush1254' in map "MH-MJD_FIX3". It seems that the engine does some kind of optimization while loading the map.
Brush1254@MH-MJD_FIX3.jpg
Brush1254@MH-MJD_FIX3.jpg (13.09 KiB) Viewed 5412 times
Another UScript based approach to test a map for duplicate actors (except the ones mentioned above) I use at the moment:
Spoiler

Code: Select all

function bool FindDuplicateActor(name ActorName, bool bLogDuplicates) {
/******************************************************************************
Returns TRUE if at least two Actors with the name *ActorName* exist. The search
is terminated with the first occurrence of a duplicate name.
******************************************************************************/
local actor A;
local bool FirstFound;

	FirstFound = false;
	foreach AllActors(class'Actor', A)
	{
		if (A.Name == ActorName)
			if (FirstFound)
			{
				if (bLogDuplicates)
					warn("Duplicate Actor:" @ A);
				return true;
			}
			else
				FirstFound = true;
	}
	return false;
}


function int FindDuplicateActors(bool bLogDuplicates) {
local actor A;
local int result;

	result = 0;
	foreach AllActors(class'Actor', A)
	{
		if (FindDuplicateActor(A.name, bLogDuplicates))
			result++;
	}
	return result;
}
The algorithm: call a sub routine for each Actor, that searches the Actor list for a second Actor with that name (O(n²)).
<EDIT>
Hotfix for the code^^ (removed unused variable "index")
</EDIT>
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Actors with duplicate names (MH-Ziki)

Post by sektor2111 »

And if you call an iterator from another I cannot be sure what will happen when map has 3000+ actors. Simply using a state and sleep between a number of cycles you'll prevent infinite recursions crash and/or a high load in that moment.
My toy was helping me until this moment. In first version I've been trapped but I solved problem later. Anyway this tool... came somehow a bit late... This would be priceless in past years...

Now days we need 20 MB of UScript for fixing a mountain of MH trash - some only Editor is able to cure them. This MH-Ziki is an example of a nothing supposed MAP. No paths, duplicated actors, no end, bad mover options for a Multiplayer session - MH "ported" version is utterly garbage. No worries, original is not much better.
I could see Levels with paths rammed crashing sooner or later as in a lottery, bad meshes changed, bad movers options, monster ordered with unexistent craps, double skins for nothing, queens breaking counters, monsters firing NONE projectiles, errors done by monsters triggering themselves when die, and list goes to spam. I can continue with the rest of bad brushes, no zoning, as result of a retarded work just saving files from Editor. I'm thinking to quit this war because it goes nowhere, soon engine won't help with so much "push-fix". I prefer to load 120 maps - Old Good ones - and to forget everything over 2012 (some End of World announced in that time probably made people to act like idiots).
I believe I'm gonna start working at another TeamGamePlus (TDM) of course supporting creatures - team creatures - it's probably the best option to spawn monsters as they should, not placed in Level and screwed to make a mess. Already CTF and DM with monsters are a good alternative for MH. I'm just feel sorry for my time spent in tweaking and writing fixes and thinking at solutions all this time. What for? :???: I'm losing a lot of CPU power to run fixes rather than Level itself...
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Actors with duplicate names (MH-Ziki)

Post by sektor2111 »

These duplicates seems to come probably from older versions of Editor and/or doing unauthorized stunts in mapping. After doing some research with my toy I could see DM-Grinder, DM-grit-TURNEY, DM-Morbias][, DM-Pyramid, DM-Vault having the same problems. Why I'm not surprised by server hang-up in old days ?

Eh, I'm gonna modify starter actor in order to start game automatically each time and I'm gonna check when server will be freezing. It's time for a high stress at server.
Last edited by sektor2111 on Mon Apr 04, 2016 6:02 am, edited 1 time in total.
Post Reply