Request: Ghost Items Mutator

Search, find and discuss about Mutators!
Post Reply
User avatar
Berserker
Experienced
Posts: 128
Joined: Fri Sep 27, 2019 5:08 pm

Request: Ghost Items Mutator

Post by Berserker »

Hey guys!
I have been thinking about an idea for a mutator, which will give each item a ghost imprint after it was picked up.

What is the purpose of this you might ask? Well, besides looking cool, this mutator will be incredibly helpful for people that play new maps for the first time. One of the biggest issue when playing new maps is learning the items placement. With this mutator, people playing on new maps will no longer struggle while learning each item placement and the map itself. And, if you are like me who plays with Weapon Stay set to off, then learning new maps become incredibly hard. You will be running around with enforcer looking for weapon placements around the map, but they could be already picked up by a player or a bot. I believe this mutator can be helpful to many people and even servers.

I have made this GIF as a concept to illustrate what I'm looking for:
Image

Unfortunately, I am not a coder, so I had to do this GIF example in Ued with some cheap tricks. I basically duplicated each item in the same location, so there are 2 items on top of each other on each instance. Then I edited the Display properties for one of each item pair:

Code: Select all

AmbientGlow=0
bUnlit=True
ScaleGlow=0.5
Style=STY_Translucent
This mutator must work for the following classes: TournamentWeapon, TournamentAmmo, TournamentHealth and TournamentPickup.
STY_Translucent Style already makes the weapons translucent, but it is a little too bright by default, to fix this we need to change the ScaleGlow value as I have shown above. ScaleGlow changes the visibility of the Ghost Items, I found a value of 0.3 or 0.5 to work great. For the mutator, it would be great if we could change the ScaleGlow values from ini.


If someone has any idea how to make this mutator, I would greatly appreciate it!
Visit us on Discord:
https://discord.gg/fcRakgNCjR Image
User avatar
papercoffee
Godlike
Posts: 10451
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Request: Ghost Items Mutator

Post by papercoffee »

There are these item stands in NW3 ...I use the pentagrams. These indicate where an item or weapon once was. Or the X-Picups stands.
But yes that idea of a ghost image of the item is nice indeed.
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Request: Ghost Items Mutator

Post by Barbie »

The only idea I got was polling (sadly) and doing like that pseudocode:

Code: Select all

event Timer() {
	for each AllActors(Class'Inventory', Inv)
		if (Inv.IsInState('Sleeping'))
			SetTransLucent(Inv, true);
		else if (Inv.IsInState('Pickup'))
			SetTransLucent(Inv, false);
}
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6413
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Request: Ghost Items Mutator

Post by sektor2111 »

GhostItems.7z
(1.95 KiB) Downloaded 9 times
This is a Mutator - description it's in first post :idea2:
Featured:
Configuration for that ScaleGlow and the delay for start aka "StartDelay" - this will allow whatever mods initializing items to do their job first. Clearly is aiming "bWeaponsStay=False". Perhaps On-Line won't need declaration as "ServerPackages" due to automated replication - if something goes other way, let me know. Aside, perhaps has no problems working in "ServerActors",

Technical notes:
- Source-code is not stripped because I'm not that kind of :loool: ;
- It uses a sort of state code, each item being monitored by its own "Tracker" and required properties are reinforced each 0.3 seconds;
- Some items are better visible than others due to their Textures/Meshes (Vials compared to Flak, etc).

As a non-coder, my advice for you would be to adjust this method if it's not suitable for you or you'll find it exhaustive or abnormal for your gaming environment.
User avatar
Berserker
Experienced
Posts: 128
Joined: Fri Sep 27, 2019 5:08 pm

Re: Request: Ghost Items Mutator

Post by Berserker »

sektor2111 wrote: Sat Nov 11, 2023 9:43 am
GhostItems.7z
This is a Mutator - description it's in first post :idea2:
Woah this is amazing! The functionality of your mutator is perfect, thank you for your work!
sektor2111 wrote: Sat Nov 11, 2023 9:43 am Some items are better visible than others due to their Textures/Meshes (Vials compared to Flak, etc).
Yeah you are right. I am so sorry :facepalm:, I should have thought about this... The issue doesn't seem to be caused by the mesh textures, the main culprit seems to be the STY_Translucent style. The reason some items are more visible than others is mainly because of how the STY_Translucent style blends in relation to the map lighting. Here is an example of a ghost minigun and 2 ammo boxes, notice how the minigun and ammo are way too visible on areas where there is no lighting (like on Deck16):

Image

Now check out this second example. I simply moved the minigun and 2 ammo boxes inside that red circle. But because of the bright floor texture and lighting, the Ghost Items become completely invisible:

Image

I am not sure if there is a solution to this except changing the STY_Translucent style to STY_Normal. STY_Normal will be much better and won't blend like STY_Translucent. However, I am not sure if a ghost effect is even possible with STY_Normal :(
Visit us on Discord:
https://discord.gg/fcRakgNCjR Image
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Request: Ghost Items Mutator

Post by Barbie »

Maybe add a TriggerLight with bSpecialLit?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
OjitroC
Godlike
Posts: 3650
Joined: Sat Sep 12, 2015 8:46 pm

Re: Request: Ghost Items Mutator

Post by OjitroC »

Tried this out and got a lot of the following lines in the log

Code: Select all

ScriptWarning: ITracker DM-DSTowerBridge.ITracker40 (State GhostItems.ITracker.Fading:0042) Accessed None 'TheItem'
ScriptWarning: ITracker DM-DSTowerBridge.ITracker40 (State GhostItems.ITracker.Fading:0089) Accessed None 'TheItem'
The ITracker number varied - 38, 39 and 40 - could be Relics? I'm using 3 of Wormbo's Enhanced Relics.

Using 469dRC2 and Counter Strike weapons (+ ammo and armor) in StuffSwapper. As noted previously, noticed that some items were invisible.   
Auto merged new post submitted 32 minutes later
Yes, it's the Relics. Removing them and playing the map again confirms this - no longer get those ScriptWarnings. Something to bear in mind though.
User avatar
f7r
Experienced
Posts: 111
Joined: Mon Oct 19, 2020 6:53 pm

Re: Request: Ghost Items Mutator

Post by f7r »

OjitroC wrote: Sat Nov 11, 2023 4:55 pm Tried this out and got a lot of the following lines in the log

Code: Select all

ScriptWarning: ITracker DM-DSTowerBridge.ITracker40 (State GhostItems.ITracker.Fading:0042) Accessed None 'TheItem'
ScriptWarning: ITracker DM-DSTowerBridge.ITracker40 (State GhostItems.ITracker.Fading:0089) Accessed None 'TheItem'
In class ITracker expands KeyPoint

Code: Select all

state Fading
{
	Begin:
//	log("Working...",Name);
		if ( TheItem == None || TheItem.bDeleteMe )
			Goto('End');
		InitGlow = TheItem.ScaleGlow;
	Loop:
		if ( TheItem.IsInState('Pickup') )
		{
			TheItem.ScaleGlow = InitGlow;
			TheItem.Style = STY_Normal;
			Sleep(0.3);
			GoTo('Loop');
		}
		if ( TheItem.IsInState('Sleeping'))
		{
			TheItem.AmbientGlow = 0.000000;
			TheItem.Style = STY_Translucent;
			TheItem.ScaleGlow = UsedGlow;
			TheItem.bHidden = False;
			Sleep(0.3);
			GoTo('Loop');
		}
		Sleep(0.3);
		GoTo('Loop');
	End:
		GoToState('');
		Destroy();
}
This condition

Code: Select all

if ( TheItem == None || TheItem.bDeleteMe ) 
	Goto('End');
must be inside loop. You need to add this lines right after line label Loop:


It still doesn't work for me in a net (not lan) game. The item does not become translucent and visiblity (ScaleGlow) not change i.e. it looks like normal pickup.
User avatar
papercoffee
Godlike
Posts: 10451
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Request: Ghost Items Mutator

Post by papercoffee »

What about instead of translucent meshes of the weapon ...a monochrome sprite of that weapon/item?
It would need some textures, but...
User avatar
sektor2111
Godlike
Posts: 6413
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Request: Ghost Items Mutator

Post by sektor2111 »

But... it also depends on environment. If walls are using similar colors it will be hard to figure an item from certain distance... lololol.

We are coming to the old conclusion posted elsewhere (some far past) regarding to this gaming chapter: Watch out what you want, it might come a reality which you will not like. Cough... more things are doable, but... are they really useful ? How about some prediction of consequences ?
Even non-coders can write certain mutator/actor, but some of them are able already to predict if this it's just something without too much success.
Now you understand why I check maps before adding them blindly into folders ? And YES, disregarding what some "mapper" said, a map first need an investigation aka "surgery" not just started without to know if it's damaging or useless. A new map can be nasty in first games, but later it might be annoying in how easy can be managed. Extra-help for items, for monsters, radars, etc.... for me these are just pointless additions that takes memory and nobody cares about them later especially if said player has played map X+ times. Only a dynamic map might change the stage, but... Did you see such thing ?
User avatar
papercoffee
Godlike
Posts: 10451
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Request: Ghost Items Mutator

Post by papercoffee »

A helpful member of the community pointed out that AMC-Modular uses some really nice sprite indicators to show where an item or weapon once was.
That could be maybe useful?
User avatar
darkbarrage99
Skilled
Posts: 187
Joined: Fri Jan 02, 2009 12:41 am
Personal rank: Barron O' Beefdip
Location: VA, USA

Re: Request: Ghost Items Mutator

Post by darkbarrage99 »

Berserker wrote: Sat Nov 11, 2023 1:09 pm
sektor2111 wrote: Sat Nov 11, 2023 9:43 am
GhostItems.7z
This is a Mutator - description it's in first post :idea2:
Woah this is amazing! The functionality of your mutator is perfect, thank you for your work!
sektor2111 wrote: Sat Nov 11, 2023 9:43 am Some items are better visible than others due to their Textures/Meshes (Vials compared to Flak, etc).
Yeah you are right. I am so sorry :facepalm:, I should have thought about this... The issue doesn't seem to be caused by the mesh textures, the main culprit seems to be the STY_Translucent style. The reason some items are more visible than others is mainly because of how the STY_Translucent style blends in relation to the map lighting. Here is an example of a ghost minigun and 2 ammo boxes, notice how the minigun and ammo are way too visible on areas where there is no lighting (like on Deck16):

Image

Now check out this second example. I simply moved the minigun and 2 ammo boxes inside that red circle. But because of the bright floor texture and lighting, the Ghost Items become completely invisible:

Image

I am not sure if there is a solution to this except changing the STY_Translucent style to STY_Normal. STY_Normal will be much better and won't blend like STY_Translucent. However, I am not sure if a ghost effect is even possible with STY_Normal :(
what if it was set to translucent + unlit? would it be overly bright in the dark areas?
User avatar
Berserker
Experienced
Posts: 128
Joined: Fri Sep 27, 2019 5:08 pm

Re: Request: Ghost Items Mutator

Post by Berserker »

papercoffee wrote: Sun Nov 12, 2023 11:45 am sprite indicators to show where an item or weapon once was.
Correction: AMC-Modular by @Krull0r does not seem to show where an item or weapon once was. AMC-Modular has changed custom textures of items and unfortunately it does not leave a ghost imprint when they are picked up. The pick up behavior does not seem to be changed from my tests. When an AMC-Modular item is picked up, they disappear as normal:
Image

Looking at the AMC-Modular meshes, they also have the same STY_Translucent and Unlit flags. The properties are basically the same as Ghost Items, except they have nice blue wireframe textures of each item using the UV maps to draw the lines:
Image

The STY_Translucent Item textures of AMC-Modular are pretty nice, however as I've mentioned in my previous post, STY_Translucent will have an inconsistent blending based on the map lighting - If an area is too bright the items become invisible and if an area is completely dark then the items become way too visible.

sektor2111 wrote: Sun Nov 12, 2023 10:11 am But... it also depends on environment. If walls are using similar colors it will be hard to figure an item from certain distance... lololol.
I don't think so, this is all related to blending issues with STY_Translucent and I have been testing this for a really long time. If it's possible to make meshes "see trough" with STY_Normal, then this whole issue with the blending inconsistency of the Ghost Items would become fixed.

I did some tests to back up my claim and this is what it would like with STY_Normal. The Ghost Items will be visible even on pure white walls:
Image
sektor2111 wrote: Sun Nov 12, 2023 10:11 am for me these are just pointless additions that takes memory and nobody cares about them later especially if said player has played map X+ times.
Well, to be honest I did had my doubts as well, but to my surprise it seems a lot of people got interested in this mutator.
darkbarrage99 wrote: Sun Nov 12, 2023 1:06 pm what if it was set to translucent + unlit? would it be overly bright in the dark areas?
Yes, this example was done with translucent + unlit. If you put Minigun and ammo in that Deck16 spot, they become invisible even with unlit flag. This is all related to how translucent blends with bright textures.
Visit us on Discord:
https://discord.gg/fcRakgNCjR Image
User avatar
sektor2111
Godlike
Posts: 6413
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Request: Ghost Items Mutator

Post by sektor2111 »

f7r wrote: Sat Nov 11, 2023 11:39 pm ^^
Honestly I haven't tested it with any relics and here might be some obscure issue in timings. The fix would be simple in this case, adding a sanity check for said "item" and... done. I think relics are there for the moment and then... they simply get vanished being spawned others and this is what makes "Tracker" to fail.

About On-Line Stage
Technically actor class has all sort of replication data, I'll look for what is not being aligned as it should in hoping that I don't have to do actions in clients because ACE will spit heat oil on me again for nothing... as it did with some stock codes :omfg: .

And then... if such a mutator means something and its interest seems high, I'll go to do other additional test for figuring if something it's not normal in a server...

Edit: Simulating On-Line and wrapping code a little bit - using bUnLit to me looks more suitable and reverting it in original if "Item" goes in Pickup state. As I expected... It works "On-Line" unless some other things from Mutators chain don't do damage. Sample of such instances:
When I added a Relic, Mutator showing damage has ceased to work. If other tools are messing with mutators that's not my business. Give me time to check some relics... On-Line hint - You can adjust net properties of mutator (if is not a "ServerPackages" item) because it won't mismatch anything. Actor's replication should do its job here if something else doesn't block this toy from working normally. And then... if I'm using STY_Normal, my render shows item normally, NO ghosting at all.

Edit2: AMC-Modular with those custom things - there are things that are working as they should (armors and ammo, etc.) and also there are things that doesn't work (WEAPONS) - these are always visible. I checked settings in the map itself and... weapons don't seems to change anything toward bUnlit, Style, ScaleGlow, they just stay as they are - D3D9 UT 440 - I cannot answer why those weapons are working like that... I'll try a work around this subject.

Edit3: Things with custom meshes in state sleeping will have original stock mesh - if it was changed, this way is closer to the goal. When pickup is active it will have the customized one. A few tests were somehow normal - saying a few because a "NewThang" was bitching on me in this map and then... I'm not bother to keep it loaded here...

Code: Select all

Critical: NewThang
Critical: FMovingBrushTracker::AddPolyFragment
Critical: FMovingBrushTracker::Update
Critical: URender::SetupDynamics
Critical: URender::OccludeFrame
Critical: NewThang
Critical: FMovingBrushTracker::AddPolyFragment
Critical: FMovingBrushTracker::Update
Critical: URender::SetupDynamics
Critical: URender::OccludeFrame
   
Auto merged new post submitted 6 hours 19 minutes later
Here it is similar thing with relic support and using "bUnlit" Inventories. Still HealthVials makes the difference, too visible will be confusing (for humans, Bots know when item it's available or not).
GhostItems_11_12_23.7z
(2.39 KiB) Downloaded 7 times
And source code...
GhostItems_src.7z
(1.3 KiB) Downloaded 7 times
Post Reply