Page MenuHomeFeedback Tracker

Backpacks and weapons clipping in vehicles
Reviewed, NormalPublic

Description

One very annoying visual bug related to vehicles is that any equipment worn by characters entering a car will clip through car seats (backpacks) and the roof of the car (rifles, nightvision and other things protruding above the player's head. Long rifles (Mosin/SVD ) are especially notorious for this, but most weapons do it.)

I suggest doing one of two things:

  1. The complicated way - add attachment proxies in the boot of cars where up to four backpacks can be attached (=visually put in the boot) and make it impossible to enter a vehicle while wearing a backpack. Same with items worn in shoulder slots, it would be impossible to enter the car with items still in these slots. The items would need to be held in hands (one item) or put in the boot. This would be realistic and fit well in DayZ.
  2. The simple way - simply hide any piece of equipment worn by characters in the shoulder and backpack slots when sitting in a vehicle. This would of course be unrealistic and not very DayZ-ish (but so is backpacks and rifles protruding through car seats and roofs) but likely involve lesser development time. You already do this with items held in a character's hands so it should be simple enough.

And if attachment slots for backpacks is not something you want to do you HAVE to make it possible to put a loaded backpack in the inventory of a car (or tent). There must be better methods of preventing item stacking than this. In the real world you put your packed bags in the car, you don't empty their contents in the boot and then toss the bags on top...

Oh about that - please make it impossible to enter vehices (at the very least as driver!) with barrels, wheels or other bulky (the slow walk animation stuff) in hands. It is just too cheezy that a barrel can magically be sent into some parallell dimension when you get into a car...

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Visual-Vehicles

Event Timeline

Beavis created this task.Apr 2 2020, 9:29 AM
Beavis updated the task description. (Show Details)
Beavis updated the task description. (Show Details)
NiiRoZz added a subscriber: NiiRoZz.Apr 2 2020, 9:59 AM

This issue needs to be looked at in some way. The way it currently looks in-game with backpacks and guns clipping through vehicles looks really bad. At least alternative 2 should be fairly straightforward to do, considering items held in the character's hands are already hidden when entering a vehicle.

Beavis updated the task description. (Show Details)Nov 9 2020, 11:23 AM
drzzzt added a subscriber: drzzzt.EditedNov 9 2020, 2:21 PM

At the moment, the way it works and looks is hilarious and does take away a lot of the general goal of realism in the game, visually and most important logically.
But not all is lost, the truck showed some improvements, that I think could be a solution for smaller cars as well.

For Backpacks or Items with storage like Barrels and Chests in general, I think that a gold standard for moving them into the car inventory should be, to be required to throw the item in the trunk before you enter, or to put it in a attachement slot in the foot area of each seat. In the car inventory ("trunk") it should take away slots according to the number of slots of the empty item.
It should be changed so that the storage item is able to hold the contents as well - like the way the sea chest already works, when put in the car trunk with items in it.

If that means that the hunting backpack takes up 63 Slots in the car inventory, because that´s how much slots it can hold as Items, that would be 63 Slots of Trunk-Inventory less that´s available..
You could adjust the total available slots in the car accordingly to fit the total size of the car trunk and juggle around the backpack sizes so it fits nicely with the Icons of the items.

Also I think, additional Slots only for certain items even in non-Truck cars make sense, just like the slots for building materials in the Truck.
Think of the space between your legs, while sitting in a car - a medium tent, a hunting backpack or a Rifle could easily fit upright in your "legspace". I´d limit that to one Item only and allow an assortment of different items according to their size and the size of the car. The question here should be "would it fit in reality?".

For the Drivers ´leg Slot, this one can be non-existent or allow only smaller items - after all he has to drive so he needs some legspace.
The Leg-Space Slots should only be visible and usable, once you open the corresponding door or adjust the seat accordingly to access it. Also, holding an Item in hand while not driving should be possible as long as it´s not very big - like a car tent or a barrel (please remove this!). If you are holding an Item in hand, as a penalty you shouldn´t be able to shoot out of the window before you toggle it with your leg item slot (or open the window and throw it out), but I get ahead of myself :D

I wish for a car attachement, to hold additional Items, like a roof rack for cars which you could loot off industrial areas and the merchant part of Car Shops. On this, you could store two car tents, maybe one barrel with lashing straps, and behold: ski-equipment in a top loading box, all adding to the weight of the car and influencing the steering and top speed, but that is a different story.

Beavis added a comment.EditedJun 23 2021, 12:17 PM

Still an issue in 1.13 experimental.

Really, with drzzzt post taken into account there are three options:

  1. Hide player's backpacks and shouldered rifles when seated in a car. Easy but unrealistic option, but an acceptable quick fix.
  2. Make backpacks with cargo possible to put in the boot - just make them take up as much space as their inventory space.
  3. Attachment proxies for as many bags as the car has seats.

(2 and 3 would of course also mean you can't enter a car with a backpack on your back.)

Also, please take away the possibility to get in and drive with a barrel or any other large item in hands.

Beavis added a subscriber: Geez.EditedJun 18 2022, 11:52 PM

Please @Geez could you nudge the devs a bit on this issue? The ticket is more than two years old but the issue has been in since 0.63. The obvious band aid fix until a more logical system can be implemented is to hide the back and shoulder proxies on players when seated in a vehicle. It is done with anything held in hands, so it should be a piece of cake to do it with two more slots.

Seriously, this looks so bad:

Regards, Beav

Geez changed the task status from New to Reviewed.Jun 20 2022, 7:29 PM

Hello Beav.
The team is aware of this behaviour, though I do not have info as to when or if this could be fixed.
Regards,
Geez

Okay, not the answer I was hoping for, but thanks for the feedback.

lemmac added a subscriber: lemmac.Jun 21 2022, 12:10 PM

Just turn them invisible inside vehicle, so simple...

You'd think that yeah. They can obviously hide selected proxies depending on actions/conditions - or you wouldn't have invisible weapons etc when climbing ladders and, here's the twist, when sitting in cars. Expanding that to include back and shoulder slots should not be impossible.

@Beavis, enjoy.

modded class PlayerBase extends ManBase
{
	protected bool m_ProxiesHiddenInCar;
	protected bool m_ProxiesHiddenInCarClient;

	void PlayerBase()
	{
		m_ProxiesHiddenInCar = false;
		m_ProxiesHiddenInCarClient = false;
	}

	protected void HideBackpackAndShoulderProxies(bool state)
	{
		SetInvisibleRecursive(state, this, {InventorySlots.BACK,InventorySlots.SHOULDER,InventorySlots.MELEE});
		m_ProxiesHiddenInCarClient = state;
	}

	protected void SetProxiesHiddenInCar(bool state)
	{
		if (GetGame().IsServer())
		{
			m_ProxiesHiddenInCar = state;
			SetSynchDirty();
		}
	}

	override void EOnInit(IEntity other, int extra)
	{
		super.EOnInit(other, extra);
		
		GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( HideBackpackAndShoulderProxies, 1000, false, m_ProxiesHiddenInCar);
	}

	override void Init()
	{
		super.Init();
		
		RegisterNetSyncVariableBool("m_ProxiesHiddenInCar");
	}

	override void OnCommandVehicleFinish()
	{
		super.OnCommandVehicleFinish();

		SetProxiesHiddenInCar(false);
	}
	
	override void OnCommandVehicleStart()
	{
		super.OnCommandVehicleStart();
		
		SetProxiesHiddenInCar(true);
	}

	override void OnVariablesSynchronized()
	{
		super.OnVariablesSynchronized();

		if (m_ProxiesHiddenInCar != m_ProxiesHiddenInCarClient)
		{
			HideBackpackAndShoulderProxies(m_ProxiesHiddenInCar);
			GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( HideBackpackAndShoulderProxies, 1000, false, m_ProxiesHiddenInCar);
		}
	}
}

I continue to have absolutely no idea why it takes this team 2 years to not do what can be done in 30 minutes.

Well look at that, I took MDC's script above and applied it and it works flawlessly.

This should be the vanilla solution until the day something more realistic is implemented. If that ever happens...

mdc saves the day again :)

Well look at that, I took MDC's script above and applied it and it works flawlessly.

Also works in multiplayer, at least based on some local testing using multiple clients.

There's a minor edge case that could cause issues (specifically, the items not being shown) if another player enters your network bubble while you're in a car. The following code was included to address this:

	override void EOnInit(IEntity other, int extra)
	{
		super.EOnInit(other, extra);
		
		GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( HideBackpackAndShoulderProxies, 1000, false, m_ProxiesHiddenInCar);
	}

Synchronizing the visibility of cargo items or attachments can't be done directly on creation of the object, as the child hierarchy hasn't been loaded yet, so the first update (in OnVariablesSynchronized) fails. I've included a CallLater in EOnInit to manually re-update 1 second after initialization, which *should* be long enough, although if I was implementing this in vanilla I'd probably use a SyncJuncture or - preferably - find an event which triggers at the appropriate time.

Thinking about it, EOnAttached might actually work...

Something to test after I've had a nap lol.

Yuki added a subscriber: Yuki.Jun 22 2022, 3:07 PM

Maybe better

modded class PlayerBase
{
	protected ref array<int> clothingArray 	= new array<int>;
	protected bool m_AttachmentsHide 		= false;
	protected bool m_AttachmentsHidden 		= false;
	
	void PlayerBase()
	{
		clothingArray.Insert(InventorySlots.MELEE);
		clothingArray.Insert(InventorySlots.BACK);
		clothingArray.Insert(InventorySlots.SHOULDER);
	}
	
	void Init()
	{
		super.Init();
		RegisterNetSyncVariableBool("m_AttachmentsHide");
	}
	
	override void OnCommandVehicleStart()
	{
		m_AttachmentsHide = true;
#ifdef SERVER
		SetSynchDirty();
#endif
		Print("::: [" + this + "]: OnCommandVehicleStart: m_AttachmentsHide: " + m_AttachmentsHide);
		super.OnCommandVehicleStart();
	}

	override void OnCommandVehicleFinish()
	{
		m_AttachmentsHide = false;
		Print("::: [" + this + "]: OnCommandVehicleFinish: m_AttachmentsHide: " + m_AttachmentsHide);
		super.OnCommandVehicleFinish();
	}

	void HideAttachments(bool hiddenstate)
	{
		SetInvisibleRecursive(hiddenstate, this, clothingArray);
	}

	override void OnVariablesSynchronized()
	{
		super.OnVariablesSynchronized();

		if (m_AttachmentsHide != m_AttachmentsHidden)
		{
			m_AttachmentsHidden = m_AttachmentsHide;
			HideAttachments(m_AttachmentsHide);
		}
	}
}

Maybe better

Pretty much the same code, except you're keeping an array of 3 ints in the stack as a ref unnecessarily :-P

Also doesn't account for the instance of people entering/leaving your bubble while in a vehicle; if you test in MP you'll see what I mean :-)

Yuki added a comment.Jun 22 2022, 3:18 PM

Maybe better

Pretty much the same code, except you're keeping an array of 3 ints in the stack as a ref unnecessarily :-P

Also doesn't account for the instance of people entering/leaving your bubble while in a vehicle; if you test in MP you'll see what I mean :-)

I'll keep in mind, it's just that this code was written quite a long time ago and not even by me. But overall, I'm still surprised that BI didn't add this themselves.

modded class PlayerBase extends ManBase
{
	protected bool m_ProxiesHiddenInCar;
	protected bool m_ProxiesHiddenInCarClient;

	override void Init()
	{
		super.Init();
		
		RegisterNetSyncVariableBool("m_ProxiesHiddenInCar");
	}
	
	protected void HideBackpackAndShoulderProxies(bool state)
	{
		SetInvisibleRecursive(state, this, {InventorySlots.BACK,InventorySlots.SHOULDER,InventorySlots.MELEE});
		m_ProxiesHiddenInCarClient = state;
	}

	protected void SetProxiesHiddenInCar(bool state)
	{
		if (GetGame().IsServer())
		{
			m_ProxiesHiddenInCar = state;
			SetSynchDirty();
		}
	}

	override void EEItemAttached(EntityAI item, string slot_name)
	{
		super.EEItemAttached(item, slot_name);

		if (IsInVehicle() && (m_ProxiesHiddenInCar))
			HideBackpackAndShoulderProxies(m_ProxiesHiddenInCar);
	}

	override void OnCommandVehicleFinish()
	{
		super.OnCommandVehicleFinish();

		SetProxiesHiddenInCar(false);
	}
	
	override void OnCommandVehicleStart()
	{
		super.OnCommandVehicleStart();
		
		SetProxiesHiddenInCar(true);
	}

	override void OnVariablesSynchronized()
	{
		super.OnVariablesSynchronized();

		if (m_ProxiesHiddenInCar != m_ProxiesHiddenInCarClient)
			HideBackpackAndShoulderProxies(m_ProxiesHiddenInCar);
	}
}

Should be the most efficient solution; uses EEItemAttached as a one-time sync for players entering the network bubble as it's called by the creation of proxy attachments on the player.

m_ProxiesHiddenInCar is set on PlayerBase object creation, so should always remain synced.

Awesome, than you for this @mdc !

This comment was removed by Geez.