Graphic glitch when using Hive to assist seraphim construct

This is for troubleshooting of problems with the FAF client and Forged Alliance game.

Moderator: PhilipJFry

Graphic glitch when using Hive to assist seraphim construct

Postby bamboofats » 10 Jun 2015, 09:44

Hi. I found a peculiar graphic glitch when Cybran hives are used to assist the construction of seraphim buildings. A missing texture kind of decal appears at the construction base.(see picture below) Tested without mods on 3640, and it appears to go back to vanilla FA.

seton.jpg
seton.jpg (203.93 KiB) Viewed 2334 times


It happens on many old official maps. Here i show it on setons, alpha 7 and bermuda locket. Some user created maps do not have this issue, such as the recent Selkie Isle, but others do.

alpha7.jpg
alpha7.jpg (188.08 KiB) Viewed 2334 times


I hope someone is able to help me check if it is reproducible. Currently I found that it appears if
= map can produce this issue. Eg seton's
= Cybran hive (stage 1, 2 or 3) used to assist construction, can assist automatically or manually
= Assist construction of seraphim building 2x2 or larger. 1x1 T1 Pd, walls not affected apparently.
= Can assist at any stage of the building progress. Does not affect upgrading structures or building units/ mobile experimentals
= Cybran hive has to be built , not spawned by console
= Glitched decal visible over network
= Hive can belong to the player, or can assist an allied player.

Heres how I produced the glitch on my faf install
Start with map ,eg (setons) and any race.
Spawn sufficient power/mass if desired
Spawn T2 or higher Cybran engineer, and any seraphim engineer. (I used 1 cybran 1 seraphim sACU)
Build a hive
Build any seraphim structure (2x2 or larger) within the hive radius.

bermuda.jpg
bermuda.jpg (326.88 KiB) Viewed 2334 times


Here shows a stage 3 hive assisting an AIx

Anyone knows if this is an issue or just a bad FA install
bamboofats
Crusader
 
Posts: 32
Joined: 10 May 2015, 14:38
Has liked: 0 time
Been liked: 7 times
FAF User Name: bamboofats

Re: Graphic glitch when using Hive to assist seraphim constr

Postby bamboofats » 11 Jun 2015, 08:03

I found how this issue affects only seraphim construction could be related to the ground decals differences.

Untitled.jpg
Untitled.jpg (202.23 KiB) Viewed 2303 times


I am testing this on a custom map that doesnt have the graphic glitch(red black stripes texture). This shows a row of pgens.

Above it is the decal during construction. I had the sACU start building, stopped it halfway and reclaim the half built structure.
The below row shows the decal AFTER construction. Fully built pgen reclaimed.
The seraphim is different from the rest as the decal is not shown while he is growing the building. It is only placed after the building is done, the transition covered by a flash of light.

1.jpg
1.jpg (118.97 KiB) Viewed 2303 times

Seraphim construction does not have a decal during growing.

2.jpg
2.jpg (96.24 KiB) Viewed 2303 times

However, if aided by any other faction engineers (UEF Cybran aeon), the building's decal is placed immediately. This usually is a non issue as the building looks the same with the correct ground decal after the completion.
bamboofats
Crusader
 
Posts: 32
Joined: 10 May 2015, 14:38
Has liked: 0 time
Been liked: 7 times
FAF User Name: bamboofats

Re: Graphic glitch when using Hive to assist seraphim constr

Postby bamboofats » 11 Jun 2015, 08:09

3.jpg
3.jpg (114.95 KiB) Viewed 2303 times

Going by the same logic with using hives to assist.

4.jpg
4.jpg (110.47 KiB) Viewed 2303 times

When using hives, instead of forcing the seraphim ground decal to appear prematurally, the hive imposes its own cybran ground decal on the seraphim structure.
Apparently this cybran ground decal was causing the graphic glitch to appear for me on other maps.

6.jpg
6.jpg (143.87 KiB) Viewed 2303 times

Here compares structure built on without assist (left) and with hive assist (right). On a map without the glitch texture. (FA world domination)
The seraphim decal appears on completion and is layered ontop on the cybran one.
bamboofats
Crusader
 
Posts: 32
Joined: 10 May 2015, 14:38
Has liked: 0 time
Been liked: 7 times
FAF User Name: bamboofats

Re: Graphic glitch when using Hive to assist seraphim constr

Postby bamboofats » 11 Jun 2015, 10:43

I found the condition where the cybran decal imposed by the hive assist appears with a glitch or not.

mapedit.jpg
mapedit.jpg (79.58 KiB) Viewed 2288 times

It depends on the painted terrain type as defined by the map editor. This affects stuff like the footprints and dust effects while moving.
If the seraphim structure is built where the terrain type style is under "default", the decal appears ok. If the style is anything other then default, the decal is glitched.

Several custom maps like dry canyon, selkie isles etc do not have the glitch because the author did not put terrain type variations in the map, they simply left it as default 1 entirely.
bamboofats
Crusader
 
Posts: 32
Joined: 10 May 2015, 14:38
Has liked: 0 time
Been liked: 7 times
FAF User Name: bamboofats

Re: Graphic glitch when using Hive to assist seraphim constr

Postby ckitching » 11 Jun 2015, 16:33

Great investigation! I'll investigate this later (and stick it on github)
User avatar
ckitching
Avatar-of-War
 
Posts: 229
Joined: 03 Jan 2015, 12:51
Has liked: 2 times
Been liked: 69 times
FAF User Name: ckitching

Re: Graphic glitch when using Hive to assist seraphim constr

Postby bamboofats » 11 Jun 2015, 20:59

I messed around a bit with some of the code and *appear* to have fixed the issue for myself, though I don't know if it is a good method.

I couldnt find out why the hive created the cybran decal on seraphim structures, It was too complicated. So I stopped the glitch by preventing the decals for seraphim buildings from appearing before completion. Also, now any faction engineers can assist seraphim construction just like normal seraphim engineers; the proper decal appears after the building is done.

I edited /lua/sim/Unit.lua

Original=======================
OnStartBuild = function(self, unitBeingBuilt, order)
if order == 'Repair' then
if unitBeingBuilt.WorkItem ~= self.WorkItem then
self:InheritWork(unitBeingBuilt)
end
self:SetUnitState('Repairing', true)
end

local bp = self:GetBlueprint()
if order ~= 'Upgrade' or bp.Display.ShowBuildEffectsDuringUpgrade then
self:StartBuildingEffects(unitBeingBuilt, order)
end
self:SetActiveConsumptionActive()
self:DoOnStartBuildCallbacks(unitBeingBuilt)
self:PlayUnitSound('Construct')
self:PlayUnitAmbientSound('ConstructLoop')
if bp.General.UpgradesTo and unitBeingBuilt:GetUnitId() == bp.General.UpgradesTo and order == 'Upgrade' then
unitBeingBuilt.DisallowCollisions = true
unitBeingBuilt:SetCanTakeDamage(false)
end

if unitBeingBuilt:GetBlueprint().Physics.FlattenSkirt and not unitBeingBuilt:HasTarmac() then
if self.TarmacBag and self:HasTarmac() then
unitBeingBuilt:CreateTarmac(true, true, true, self.TarmacBag.Orientation, self.TarmacBag.CurrentBP )
else
unitBeingBuilt:CreateTarmac(true, true, true, false, false)
end
end
end,

EDITED=================================
I edited the CreateTarmac conditions to

OnStartBuild = function(self, unitBeingBuilt, order)
if order == 'Repair' then
if unitBeingBuilt.WorkItem ~= self.WorkItem then
self:InheritWork(unitBeingBuilt)
end
self:SetUnitState('Repairing', true)
end

local bp = self:GetBlueprint()
if order ~= 'Upgrade' or bp.Display.ShowBuildEffectsDuringUpgrade then
self:StartBuildingEffects(unitBeingBuilt, order)
end
self:SetActiveConsumptionActive()
self:DoOnStartBuildCallbacks(unitBeingBuilt)
self:PlayUnitSound('Construct')
self:PlayUnitAmbientSound('ConstructLoop')
if bp.General.UpgradesTo and unitBeingBuilt:GetUnitId() == bp.General.UpgradesTo and order == 'Upgrade' then
unitBeingBuilt.DisallowCollisions = true
unitBeingBuilt:SetCanTakeDamage(false)
end


local bpp = unitBeingBuilt:GetBlueprint()
local FactionName = bpp.General.FactionName
if FactionName == 'Seraphim' and order ~= 'Upgrade' then
else
if unitBeingBuilt:GetBlueprint().Physics.FlattenSkirt and not unitBeingBuilt:HasTarmac() then
if self.TarmacBag and self:HasTarmac() then
unitBeingBuilt:CreateTarmac(true, true, true, self.TarmacBag.Orientation, self.TarmacBag.CurrentBP )
else
unitBeingBuilt:CreateTarmac(true, true, true, false, false)
end
end
end

end,
=======================
So that seraphim buildings initial placement do not create the decal. It is called elsewhere upon completion.
During upgrading the decal is deleted and respawned using this function so i had to exclude it.

See if this is of any help.
bamboofats
Crusader
 
Posts: 32
Joined: 10 May 2015, 14:38
Has liked: 0 time
Been liked: 7 times
FAF User Name: bamboofats

Re: Graphic glitch when using Hive to assist seraphim constr

Postby ckitching » 11 Jun 2015, 23:45

You could always file a pull request on our www.github.com/FAForever/fa

In any case, this seems interesting.
User avatar
ckitching
Avatar-of-War
 
Posts: 229
Joined: 03 Jan 2015, 12:51
Has liked: 2 times
Been liked: 69 times
FAF User Name: ckitching

Re: Graphic glitch when using Hive to assist seraphim constr

Postby ckitching » 11 Jun 2015, 23:47

(Or if nothing else please post an actual diff so your changes are clear. Playing spot-the-diffrrence on two unformatted code blocks in a forum post is not cool ;)
User avatar
ckitching
Avatar-of-War
 
Posts: 229
Joined: 03 Jan 2015, 12:51
Has liked: 2 times
Been liked: 69 times
FAF User Name: ckitching

Re: Graphic glitch when using Hive to assist seraphim constr

Postby bamboofats » 12 Jun 2015, 06:13

Sorry about that block of text. I am not too familiar with how stuff goes on at github so i think its safer to leave my suggestion here. Not sure if it is the best way to solve this without breaking anything but it appears to work for me so far. I dont have much experience so its a bit of trial and error

Inside lua/sim/unit.lua

The function titled OnStartBuild

there is this section for the creation of the tarmacs. I added some lines in bold

local bpp = unitBeingBuilt:GetBlueprint()
local FactionName = bpp.General.FactionName
if FactionName == 'Seraphim' and order ~= 'Upgrade' then
else

if unitBeingBuilt:GetBlueprint().Physics.FlattenSkirt and not unitBeingBuilt:HasTarmac() then
if self.TarmacBag and self:HasTarmac() then
unitBeingBuilt:CreateTarmac(true, true, true, self.TarmacBag.Orientation, self.TarmacBag.CurrentBP )
else
unitBeingBuilt:CreateTarmac(true, true, true, false, false)
end
end
end
bamboofats
Crusader
 
Posts: 32
Joined: 10 May 2015, 14:38
Has liked: 0 time
Been liked: 7 times
FAF User Name: bamboofats

Re: Graphic glitch when using Hive to assist seraphim constr

Postby Deering » 13 Jun 2015, 00:59

I have to say great documentation.
Deering
Evaluator
 
Posts: 673
Joined: 18 Sep 2013, 11:47
Has liked: 16 times
Been liked: 41 times
FAF User Name: Deering

Next

Return to Tech Support

Who is online

Users browsing this forum: No registered users and 1 guest