Page 4 of 4

Re: Open: House and Ship information

Posted: Fri Feb 16, 2018 8:55 pm
by Interkarma
Will do mate. :)

Re: Open: House and Ship information

Posted: Fri Feb 16, 2018 9:53 pm
by Interkarma
Hazelnut wrote: EDIT: Also for setting climate using dfMesh.SetClimate() where should I get the climateBase and climateSeason from? No rush for this bit - I can add climates later.
You can get climateBase from static helper class ClimateSwaps using the current climate type from PlayerGPS.

Code: Select all

ClimateBases climateBase = ClimateSwaps.FromAPIClimateBase(GameManager.Instance.PlayerGPS.ClimateSettings.ClimateType);
For climateSeason, you can probably just use ClimateSeason.Summer in the bank UI. I can't recall if classic applies snow texture set inside the bank interface. Otherwise, you can work out climateSeason from world time.

Code: Select all

DaggerfallDateTime.Seasons worldSeason = DaggerfallUnity.Instance.WorldTime.Now.SeasonValue;
ClimateSeason climateSeason = ClimateSeason.Summer;
if (worldSeason == DaggerfallDateTime.Seasons.Winter)
    climateSeason = ClimateSeason.Winter;
If you're wondering about the different climate & season handling between DFTFU and Daggerfall Unity, it's kind of a historical thing. All the layout guts were ported over from DaggerfallConnect and Daggerfall Modelling at the beginning when I was just building DFTFU. Which in turn came from my C++ codebase for Daggerfall Explorer written around 2000-2001.

As I started building out Daggerfall Unity, it was apparent the game world needed better climate & season handling beyond just the simplified model (climate+summer/winter/raining) required for laying out models. Rather than retro-fit this back onto the model layout code (which didn't really need it anyway), I just bridged them across with some helper methods. It can make things a but confusing though.

I also think it's kind of cool to see the progression of this layout code across the years from Daggerfall Explorer, to Daggerfall Modelling, to Daggerfall Unity.
daggerfall-explorer-2001.jpg
daggerfall-explorer-2001.jpg (81.57 KiB) Viewed 2598 times
daggerfall-modelling-2009.jpg
daggerfall-modelling-2009.jpg (99.24 KiB) Viewed 2598 times
daggerfall-unity-2017.jpg
daggerfall-unity-2017.jpg (100.01 KiB) Viewed 2598 times
The engines above are Alchemy for Daggerfall Explorer (one of my first attempts at a game engine back in my DirectX and C++ days), XNALibrary for Daggerfall Modelling (built on XNA and C#), and of course Unity and C# today for Daggerfall Unity.

Re: Open: House and Ship information

Posted: Fri Feb 16, 2018 10:56 pm
by Hazelnut
Thanks for the info. I actually don't appear to get snowy houses in classic so can't really test whether seasons affect houses in bank UI. Tried both evening and morning star. Trees are snowy but not buildings. Ah well I will leave it affected by the current season for now.

Re: Open: House and Ship information

Posted: Fri Feb 16, 2018 11:44 pm
by Hazelnut
PR submitted for when you need a break from magic. Far too excited about this so for now I've just handled loading inside a bank by using the no houses for sale message. I'm happy to switch from using BuildingDirectory to datafiles, but not convinced it's worth it for this edge case. I'll sleep on it and see what opinions are posted by you, or others.

Player housing! 8-)

Re: Open: House and Ship information

Posted: Sun Feb 18, 2018 12:04 pm
by Hazelnut
Closing this as player housing is all done. Just need to wait until someone finds a bug. :)