Adding coastal locations using world data system (difficult)

Discuss modding questions and implementation details.
User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Re: Modding Tutorials: World Data Overrides

Post by Yagiza »

Hazelnut wrote: Sun Nov 10, 2019 3:14 pm I didn't know, and had to look at the code to find out. Seems that info comes from Politic PAK file, and you can't override that with the system. That would require a lot of corresponding changes in the other data files I suspect, so I'm not going to be adding it either.
I can try to implement that if you don't mind.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Modding Tutorials: World Data Overrides

Post by Hazelnut »

Wouldn't it be easier to just put your location somewhere else along the coast where the region does stretch to? There are many coastal towns in the game, it's simply where the region is defined here.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Re: Modding Tutorials: World Data Overrides

Post by Yagiza »

Hazelnut wrote: Mon Nov 11, 2019 9:05 am Wouldn't it be easier to just put your location somewhere else along the coast where the region does stretch to? There are many coastal towns in the game, it's simply where the region is defined here.
I need to create ports for each port town (capitals of Daggerfall, Sentinel and Wayrest). So I need such pixels near those towns. But I can't find any.

User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Re: Modding Tutorials: World Data Overrides

Post by Yagiza »

I have another question here. Is location always centered in the pixel it belongs to? Or I can move location across pixel? It seems Latitude and Longitude fields are ignored and only MapID determines which map pixel the location beongs to.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Yagiza wrote: Mon Nov 11, 2019 7:06 pm I have another question here. Is location always centered in the pixel it belongs to? Or I can move location across pixel? It seems Latitude and Longitude fields are ignored and only MapID determines which map pixel the location beongs to.
It's always centered. A location can have 64 RMB blocks in total using an 8x8 grid, dumplocation Daggerfall City to see an example of this. The locations that use the 8x8 layout always have city wall blocks surrounding them so the actual cities themselves consist of 6x6 normal RMB blocks and are then surrounded by the wall blocks.

In theory it would be possible to use RMB blocks without buildings to push the other blocks to a certain position in the pixel but so far no-one has tested this. I have tested doing an 8x8 layout with regular blocks and that breaks the terrain smoothing DFU uses when it encounters city walls. Breaks the terrain as in, there was a visible gap that allowed me to jump under the map.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Re: Modding Tutorials: World Data Overrides

Post by Yagiza »

BadLuckBurt wrote: Mon Nov 11, 2019 7:24 pm It's always centered. A location can have 64 RMB blocks in total using an 8x8 grid, dumplocation Daggerfall City to see an example of this. The locations that use the 8x8 layout always have city wall blocks surrounding them so the actual cities themselves consist of 6x6 normal RMB blocks and are then surrounded by the wall blocks.

In theory it would be possible to use RMB blocks without buildings to push the other blocks to a certain position in the pixel but so far no-one has tested this. I have tested doing an 8x8 layout with regular blocks and that breaks the terrain smoothing DFU uses when it encounters city walls. Breaks the terrain as in, there was a visible gap that allowed me to jump under the map.
So, it seems to be impossible to create a port in Daggerfall...
Well... I have to test such location (which fills the whole pixel with empty terrain blocks) at coastline pixel.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Modding Tutorials: World Data Overrides

Post by Hazelnut »

It it essential that these ports are fast travel destinations and available as quest locations? Maybe it would be useful to start a thread about what you're trying to do and context, to see what solutions may fit best given the constraints that exist.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Re: Modding Tutorials: World Data Overrides

Post by Yagiza »

Hazelnut wrote: Tue Nov 12, 2019 11:34 am It it essential that these ports are fast travel destinations and available as quest locations? Maybe it would be useful to start a thread about what you're trying to do and context, to see what solutions may fit best given the constraints that exist.
Yes. The most important part is to make those places normal places where the player can fast travel.
Anyway, I almost it. The result of my investigations are attached to the post. I created a location in the ocean pixel, so there is no need to adjust its height. To stretch coastline to the pixel, where my location is, I created anothe location in the neighbour coastline pixel.

There are a few issues, which I consider DFU engine bugs:
  • Both locations are not displayed on the region map, 'cause they're in the deifferent region. I think region map should be fixed this way: since there is no possibility to open region map of High Rock sea coast, if location pixel is on the screen and it belongs to High Rock sea coast region, display it.
  • When mouse is over such pixel, wrong location name displayed (when mouse is over Port Daggerfall, "Hearthfield Manor" is displayed, and when it is over "Test", Charing is displayed. This is obviously a bug. If we allow fast travel to a different region and display names of the locations in it, location name must be taken from the region, location belongs to, not from current region.
  • When player fast travel to Port Daggerfall from North, it appears not in Southern block of the location, but somewhere in the middle of the pixel (in water), or just falls in the void. This must be also a bug.
  • Of course, a bug with incorrect display of player location on the world map, when player is in Hight Rock sea coast region must be also fixed.
I can easily fix those issues in a mod, by overriding World Map pop-up windows with my own, but I think they must be fixed in the core.

Anyway, please, check attached files. Test location is 2 pixels West and 2 pixels South from Daggerfall: Copperfield Manor. Port Daggerfall location is in southern neighbour of Test location. Please, fast travel to Test, then walk South, to see Port Daggerfall.
Attachments
PortDaggerfall-Test.zip
(3.85 KiB) Downloaded 101 times

User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Modding Tutorials: World Data Overrides: Dungeon entrance

Post by Yagiza »

I still can't figure out, how dungeon entrances are defined. Where defined, that a specific object in the exterior block is clickable and it's an entrance of the dungeon?

User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Re: Modding Tutorials: World Data Overrides

Post by Yagiza »

BTW, when I try to use files from WorldDataTestFiles.zip with worldDataDev branch, I cannot enter the crypt in The Newarch Vaults. When I click on the door of the crypt, I have this message in the Unity editor console:
Spoiler!
NullReferenceException: Object reference not set to an instance of an object
DaggerfallWorkshop.Utility.ModelCombiner.Add (DaggerfallWorkshop.ModelData& modelData, Matrix4x4 matrix) (at Assets/Scripts/Utility/ModelCombiner.cs:137)
DaggerfallWorkshop.Utility.RDBLayout.AddModels (DaggerfallWorkshop.DaggerfallUnity dfUnity, DaggerfallConnect.DFBlock& blockData, System.Collections.Generic.Dictionary`2 actionLinkDict, System.Int32[] textureTable, Boolean allowExitDoors, System.Collections.Generic.List`1& exitDoorsOut, Boolean serialize, DaggerfallWorkshop.Utility.ModelCombiner combiner, UnityEngine.Transform modelsParent, UnityEngine.Transform actionModelsParent) (at Assets/Scripts/Utility/RDBLayout.cs:671)
DaggerfallWorkshop.Utility.RDBLayout.CreateBaseGameObject (DaggerfallConnect.DFBlock& blockData, System.Collections.Generic.Dictionary`2 actionLinkDict, System.Int32[] textureTable, Boolean allowExitDoors, DaggerfallWorkshop.DaggerfallRDBBlock cloneFrom, Boolean serialize) (at Assets/Scripts/Utility/RDBLayout.cs:170)
DaggerfallWorkshop.Utility.RDBLayout.CreateBaseGameObject (System.String blockName, System.Collections.Generic.Dictionary`2 actionLinkDict, DaggerfallConnect.DFBlock& blockDataOut, System.Int32[] textureTable, Boolean allowExitDoors, DaggerfallWorkshop.DaggerfallRDBBlock cloneFrom, Boolean serialize) (at Assets/Scripts/Utility/RDBLayout.cs:116)
DaggerfallWorkshop.Utility.GameObjectHelper.CreateRDBBlockGameObject (System.String blockName, System.Int32[] textureTable, Boolean allowExitDoors, DungeonTypes dungeonType, Single monsterPower, Int32 monsterVariance, Int32 seed, DaggerfallWorkshop.DaggerfallRDBBlock cloneFrom, Boolean importEnemies) (at Assets/Scripts/Utility/GameObjectHelper.cs:536)
DaggerfallWorkshop.DaggerfallDungeon.LayoutDungeon (DaggerfallConnect.DFLocation& location, Boolean importEnemies) (at Assets/Scripts/Internal/DaggerfallDungeon.cs:290)
DaggerfallWorkshop.DaggerfallDungeon.SetDungeon (DFLocation location, Boolean importEnemies) (at Assets/Scripts/Internal/DaggerfallDungeon.cs:116)
DaggerfallWorkshop.Utility.GameObjectHelper.CreateDaggerfallDungeonGameObject (DFLocation location, UnityEngine.Transform parent, Boolean importEnemies) (at Assets/Scripts/Utility/GameObjectHelper.cs:1337)
DaggerfallWorkshop.Game.PlayerEnterExit.TransitionDungeonInterior (UnityEngine.Transform doorOwner, StaticDoor door, DFLocation location, Boolean doFade) (at Assets/Scripts/Game/PlayerEnterExit.cs:862)
DaggerfallWorkshop.Game.PlayerActivate.ActivateStaticDoor (DaggerfallWorkshop.DaggerfallStaticDoors doors, RaycastHit hit, Boolean hitBuilding, StaticBuilding building, BuildingTypes buildingType, Boolean buildingUnlocked, Int32 buildingLockValue, UnityEngine.Transform doorOwner) (at Assets/Scripts/Game/PlayerActivate.cs:459)
DaggerfallWorkshop.Game.PlayerActivate.Update () (at Assets/Scripts/Game/PlayerActivate.cs:230)

Post Reply