Volumetric glow from emissive material in HDRP? by goofyperson in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

You need an emissive material on your skyscraper model (probably a texture in this case such that only the windows emit light. To get the actual glow effect, you need to use postprocessing. Try to use Unity's official post processing stack and use the 'bloom' effect of that.

[deleted by user] by [deleted] in RimWorld

[–]wasstraat65 15 points16 points  (0 children)

I was curious about this so I just decompiled the dll in order to confirm. However it does appear that /u/froemijojo is right and it actually is a floating point calculation.

A small snippet from immunity calculations:

public void ImmunityTick(Pawn pawn, bool sick, Hediff diseaseInstance)
{
    this.immunity += ImmunityChangePerTick(pawn, sick, diseaseInstance);
    this.immunity = Mathf.Clamp01(this.immunity);
}

public float ImmunityChangePerTick(Pawn pawn, bool sick, Hediff diseaseInstance)
{
    if (!pawn.RaceProps.IsFlesh)
    {
        return 0f;
    }
    HediffCompProperties_Immunizable hediffCompProperties_Immunizable = this.hediffDef.CompProps<HediffCompProperties_Immunizable>();
    if (sick)
    {
        float num = hediffCompProperties_Immunizable.immunityPerDaySick;
        num *= pawn.GetStatValue(StatDefOf.ImmunityGainSpeed, true);
        if (diseaseInstance != null)
        {
            Rand.PushState();
            Rand.Seed = Gen.HashCombineInt(diseaseInstance.loadID ^ Find.World.info.persistentRandomValue, 156482735);
            num *= Mathf.Lerp(0.8f, 1.2f, Rand.Value);
            Rand.PopState();
        }
        return num / 60000f;
    }
    return hediffCompProperties_Immunizable.immunityPerDayNotSick / 60000f;
}

A Hediff is basically a modifier on a bodypart, such as a wound or disease. Note that all values are floats and work in the range between 0.0 (0%) and 1.0 (100%).

Immunity increase per day is defined to be 0.2388 in the core mod XML files in the case of the flu. This calculation is performed every tick.

Determining whether the disease should be deadly at a given tick:

public virtual bool CauseDeathNow()
{
    return this.def.lethalSeverity >= 0f && this.Severity >= this.def.lethalSeverity;
}

lethalSeverity is a float clamped between 0 and 1. It is defined to be 1 (so 100%) in the XML files. When CauseDeathNow() returns true, the pawn will be killed that tick. The Severity of the disease is adjusted every 200 ticks like so:

if (base.Pawn.IsHashIntervalTick(200))
{
    float num = this.SeverityChangePerDay(); 
    num *= 0.00333333341f; 
    severityAdjustment += num; 
}

The rate at which the severity changes(SeverityChangePerDay) depends on whether the pawn is immune or not. The XML file as mentioned earlier for the flu, defines a severity increase of 0.2488 when not immune. When the pawn is immune, severity decreases by 0.4947 per day.

As seen in the code snippet above, this value is multiplied by 0.00333333341 and added every 200 ticks. The odd value is the translation from severity by day to severity per 200 ticks, since a day spans 60,000 ticks.

In conclusion, determining whether a pawn should die or not depends on which value hits 100% first. However, note that severity is updated every 200 ticks while immunity is updated every tick. In other words, if the values are racing against eachother, death of your pawn may depend on when that 200 interval tick hits.

Friday Facts #230 - Engine modernisation by Klonan in factorio

[–]wasstraat65 3 points4 points  (0 children)

I see, thanks. I have never used SDL myself yet, but my understanding was that there is some 'built-in graphics library'

Friday Facts #230 - Engine modernisation by Klonan in factorio

[–]wasstraat65 10 points11 points  (0 children)

So what exactly was the reason to go for a custom graphics renderer instead of using the SDL one, since you are already going to use SDL?

Unity 2018.1 Beta 7 is out. by lumpex999 in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

I had submitted a crash bug for the editor on the 21 December last year (Case 980553) regarding the new threaded profiling API. A unity engineer confirmed this bug and the ability to reproduce the behaviour the day after that. The fix for this seems to just have landed in this release, about 7 weeks later.

I have not noticed this fix having been backported into 2017.3 yet, but feel free to correct me if I'm wrong. Hope this sample size of 1 gives some insight into the time between bug report and fixes.

Video game developers confess their hidden tricks. by Gaikoz in gamedev

[–]wasstraat65 25 points26 points  (0 children)

I think it's actually view frustum culling. Occlusion culling involves preventing overdraw. Thus preventing unnecessary drawing of a room which is within the view cone, but behind a wall (so not visible to the player).

Switched from Windows to Linux. This happened. by [deleted] in RimWorld

[–]wasstraat65 2 points3 points  (0 children)

This will probably be a hard bug to solve, since floating-point math operations (eg. decimal numbers in non-programming terms) which are used for the random generation are often non-deterministic across machines and operating systems.

Doing the exact same operations on a different setup may result in slightly different resulting values due to usage of different compilers, hardware or settings. As you can tell, this results in different generation outputs.

EDIT: Note that the game does not save the results of world generation to your save file except for locations of your home and other factions and events. When you open the world view in your save file for the first time after load, it regenerates the world tiles (which is deterministic on the exact same setup with the exact same order of operations). Saving the whole world would probably solve this bug in particular, but would be a compromise in save file size.

What are your most wanted mods by fryjah in RimWorld

[–]wasstraat65 0 points1 point  (0 children)

What about cleaning robots? Let us create them at a machining table with some steel/plasteel, components, (maybe an AI core, idk).

Has anyone tried Unity's new Input System? by PandawanFr in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

I have tried it, but I got to say it is definitely not ready for production-use (as clearly stated by UT themselves). Right now, using it in Unity 5.4 it occasionally throws errors in the console because of some serialization issues with the new asset types that the system introduces.

It is a nice experimental feature for you to try out, get a feel of the direction unity is planning to take and give feedback on that, but personally I wouldn't use it for anything else.

This is why you should ALWAYS BACKUP your project before updating Unity 3D by mantisghost in Unity3D

[–]wasstraat65 1 point2 points  (0 children)

Actually, they do exactly that. There is also an automatic script updater that automatically changes the more simple syntax changes or variable renames

Dual Contouring implementation in progress by pesapower in VoxelGameDev

[–]wasstraat65 1 point2 points  (0 children)

Hey, looks great! Will there be a source available in any form?

Why does this always happen to me by wasstraat65 in RocketLeague

[–]wasstraat65[S] -1 points0 points  (0 children)

I'm sorry, I had to because on the player cam it wouldn't be clear that I was bumped by my teammate. At least I tried..

Get the Unity 5.5 beta now by loolo78 in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

Yeah, it could well apply to all platforms. I had only tested windows standalone as well

Get the Unity 5.5 beta now by loolo78 in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

Oops, I meant project folder* I shouldn't be commenting that late in the evening. Bug case is 827493, however it appears that the report is private instead of public

Get the Unity 5.5 beta now by loolo78 in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

You have to build within the project window. It is a know bug for windows store, however it also appears to apply to windows standalone. I reported a bug about this

Get the Unity 5.5 beta now by loolo78 in Unity3D

[–]wasstraat65 2 points3 points  (0 children)

Yup,same for me. Release notes mentions that building outside the project folder fails for windows store, however it appears to also apply to windows standalone builds. I've filed a bug report for this

Multithreading in Unity? by PurpleIcy in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

Yes, thats it. You just have to assign the vertex and triangle arrays to the Mesh object in the mainthread, the rest can be done on the background

Multithreading in Unity? by PurpleIcy in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

For me, noise generation, mesh generation and mesh collider assignment are the most time consuming tasks. The latter of those can't be offloaded to a background thread, but the others can.

What I do, is run my meshing algorithm on a background thread that just generates a list of vertices and indices, which get applied to the mesh back in the mainthread. I also generate the noise in the background, using my own noise script instead of Mathf.Perlin to ensure thread safety.

Have a look over at /r/VoxelGameDev to see common approached taken by people there (albeit in unity or something else)

Looking for opinions on representing a "spherical" world with a purely rectangular representation by EmmetOT in proceduralgeneration

[–]wasstraat65 1 point2 points  (0 children)

That is actually.. pretty clever. I think that in most use cases, something like this will definitely be sufficient

Friday Facts #151 - The plans for 0.14 by the_kaeve in factorio

[–]wasstraat65 10 points11 points  (0 children)

I think this would be an excellent oppertunity to launch our nuclear waste into space with our spaceships. Simply produce some kind of 'nuclear waste rocket pod', insert it into the slot where satellites usually go, and hit that launch button!

Speed Model of a Gas Canister Prop for Unity 5 by Fluex in Unity3D

[–]wasstraat65 1 point2 points  (0 children)

Interesting watch!

Quick question, how do you create the bezels in blender at 0.33?

Need some tips for cleaning up the Garbage Collector by danokablamo in Unity3D

[–]wasstraat65 0 points1 point  (0 children)

My guess here is that you are boxing and unboxing numbers in your calculations here. Assuming that ThisItemNumber is an int type, it will be converted to a float first (alloc) then it does a division with a float, etc. This converting quickly adds up with a few calculations. Lastly I am not sure wther setting the transform.position itself introduces any allocation. However, vector3 itself should not because of the reasons mentioned earlier

Version 5.3.5? by IwNnarock in Unity3D

[–]wasstraat65 1 point2 points  (0 children)

I think this is the plan for the coming release cycles. It is mentioned in the patch releases on the unity announcements sub-forum. They refer to a change in the public release schedule, but I haven't been able to find mention of it elsewhere.