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

Adding coastal locations using world data system (difficult)

Post by Yagiza »

Hazelnut wrote: Mon Oct 14, 2019 2:46 pm Towns

The RMB blocks used for overworld locations like towns cannot currently be overridden, only individual buildings in an RMB block can be altered. This is because the serializer doesn't handle the 2D array used for the ground data. I'm sure it can be extended to do so if there's enough demand for this feature.

UESP has a useful set of pages showing the existing blocks of the game here: https://en.uesp.net/wiki/Daggerfall:Blo ... apPItem.29

Altering an existing town building
Is it possible to add a new town on the world map? I tried and failed.
I just dumped Ripwych Commons of Daggerfall and modified the file, following the manual above. When I try to use the file I got, the game just hangs on startup. When I run it in Unity Editor, I see that System.NullReferenceException trown in ExteriorAutomap.OnMapPixelChanged(), 'cause ContentReader is null.

I attached the file I try to use.
Attachments
locationnew-test-17.zip
(1022 Bytes) Downloaded 111 times
Last edited by Yagiza on Sat Nov 09, 2019 6:52 pm, edited 1 time in total.

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

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Yagiza wrote: Sat Nov 09, 2019 3:19 pm Is it possible to add a new town on the world map? I tried and failed.
I just dumped Ripwych Commons of Daggerfall and modified the file, following the manual above. When I try to use the file I got, the game just hangs on startup. When I run it in Unity Editor, I see that System.NullReferenceException trown in ExteriorAutomap.OnMapPixelChanged(), 'cause ContentReader is null.

I attached the file I try to use.
It's possible but it doesn't work as expected, the new town will be a clone of the old town. Changing the NameSeeds will give you different building names but the interiors link back to the original town.

I don't know about running it from the editor, I just have a build of Hazelnut's branch and that seems to work fine. I tried loading in your location and didn't get any errors but since I don't know where it is located, I couldn't go there. Tried search for 'Test' but that sent me to Coppersfield Manor, not your location.

I've put one of my own experiments on Pastebin: https://pastebin.com/11sKjtqN. You can try loading that one, just name it locationnew-burtbury-17.json or something. It's a copy of Midbury in Daggerfall.

The only way to get a unique location going is if you make your custom RMB blocks which is in the works but not documented at all.
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
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Modding Tutorials: World Data Overrides

Post by Hazelnut »

I will need more info about what you did to be able to help. Where did you place the file? When did the error occur? What version of the DFU codebase are you using, the worldDataDev test branch?
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: Sat Nov 09, 2019 3:50 pm I will need more info about what you did to be able to help. Where did you place the file?
When I tried it with release 0.10.9, I put it into DaggerfallUnity_Data\StreamingAssets\WorldData.
When I try it with Unity Editor+VS2017 debugger, I put it into daggerfall-unity\Assets\StreamingAssets\WorldData.
When did the error occur?
When the game starting after I press Start button on DaggerfallUnityStartup screen.
What version of the DFU codebase are you using, the worldDataDev test branch?
No. I'm using master branch.

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

Re: Modding Tutorials: World Data Overrides

Post by Yagiza »

BadLuckBurt wrote: Sat Nov 09, 2019 3:42 pm
Yagiza wrote: Sat Nov 09, 2019 3:19 pm Is it possible to add a new town on the world map? I tried and failed.
I just dumped Ripwych Commons of Daggerfall and modified the file, following the manual above. When I try to use the file I got, the game just hangs on startup. When I run it in Unity Editor, I see that System.NullReferenceException trown in ExteriorAutomap.OnMapPixelChanged(), 'cause ContentReader is null.

I attached the file I try to use.
It's possible but it doesn't work as expected, the new town will be a clone of the old town. Changing the NameSeeds will give you different building names but the interiors link back to the original town.
That's not a problem right now. Making a clone of town in a different location is all right for me for the moment.
I don't know about running it from the editor, I just have a build of Hazelnut's branch and that seems to work fine. I tried loading in your location and didn't get any errors but since I don't know where it is located, I couldn't go there. Tried search for 'Test' but that sent me to Coppersfield Manor, not your location.
Sorry, there was a bug in my file. The position of my "Test" location was 207,214 (the same Copperfield manor has). The coppect location should be 207,215 (one pixel to the North from
Copperfield manor). I fixed the bug, but nothing changed: the game still crashes during startup. I also updated the archive in my original message, so you may try to download it to try again and see, if new location will appear.
I've put one of my own experiments on Pastebin: https://pastebin.com/11sKjtqN. You can try loading that one, just name it locationnew-burtbury-17.json or something. It's a copy of Midbury in Daggerfall.

The only way to get a unique location going is if you make your custom RMB blocks which is in the works but not documented at all.
Thank you, I'll try it.
Last edited by Yagiza on Sat Nov 09, 2019 6:53 pm, edited 1 time in total.

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

Re: Modding Tutorials: World Data Overrides

Post by Hazelnut »

It's most likely to be either you're placing it at the same map pixel as an existing location, or you've not got all of the different coordinate calculations correct. Burt is working on tools to assist with this but currently it's error prone manual calculation only.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Hazelnut wrote: Sat Nov 09, 2019 6:52 pm It's most likely to be either you're placing it at the same map pixel as an existing location, or you've not got all of the different coordinate calculations correct. Burt is working on tools to assist with this but currently it's error prone manual calculation only.
I PM-ed Yagiza a link to my repo to help out. When I was doing it by hand I found it was easier to start over at times, the form is stable enough to make copies of locations and rename the buildings and I can use the feedback, still need to start on documentation :/
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: Sat Nov 09, 2019 3:42 pm I've put one of my own experiments on Pastebin: https://pastebin.com/11sKjtqN. You can try loading that one, just name it locationnew-burtbury-17.json or something. It's a copy of Midbury in Daggerfall.
Just tried it. The game do not crash during startup with your file. Now game Startup screen appears, but my Unity console filled with the following message:
NullReferenceException: Object reference not set to an instance of an object
DaggerfallWorkshop.Utility.AssetInjection.WorldDataReplacement.AssignBlockIndices (DFLocation dfLocation) (at Assets/Scripts/Utility/AssetInjection/WorldDataReplacement.cs:401)
DaggerfallWorkshop.Utility.AssetInjection.WorldDataReplacement.AddLocationToRegion (Int32 regionIndex, DaggerfallConnect.DFRegion& dfRegion, System.Collections.Generic.List`1& mapNames, System.Collections.Generic.List`1& mapTable, DFLocation dfLocation) (at Assets/Scripts/Utility/AssetInjection/WorldDataReplacement.cs:381)
DaggerfallWorkshop.Utility.AssetInjection.WorldDataReplacement.GetDFRegionAdditionalLocationData (Int32 regionIndex, DaggerfallConnect.DFRegion& dfRegion) (at Assets/Scripts/Utility/AssetInjection/WorldDataReplacement.cs:133)
DaggerfallConnect.Arena2.MapsFile.ReadRegion (Int32 region) (at Assets/Scripts/API/MapsFile.cs:871)
DaggerfallConnect.Arena2.MapsFile.LoadRegion (Int32 region) (at Assets/Scripts/API/MapsFile.cs:612)
DaggerfallConnect.Arena2.MapsFile.GetLocation (Int32 region, Int32 location) (at Assets/Scripts/API/MapsFile.cs:691)
DaggerfallWorkshop.Game.ExteriorAutomap.LoadAndCreateLocationExteriorAutomap () (at Assets/Scripts/Game/ExteriorAutomap.cs:1522)
DaggerfallWorkshop.Game.ExteriorAutomap.OnMapPixelChanged (DaggerfallConnect.Utility.DFPosition mapPixel) (at Assets/Scripts/Game/ExteriorAutomap.cs:1694)
DaggerfallWorkshop.PlayerGPS.RaiseOnMapPixelChangedEvent (DaggerfallConnect.Utility.DFPosition mapPixel) (at Assets/Scripts/Internal/PlayerGPS.cs:1242)
DaggerfallWorkshop.PlayerGPS.Update () (at Assets/Scripts/Internal/PlayerGPS.cs:293)
This message appears a few times per second.
When I try to load my saved game, the game freezes.

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

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Yagiza wrote: Sat Nov 09, 2019 6:19 pm
Hazelnut wrote: Sat Nov 09, 2019 3:50 pm I will need more info about what you did to be able to help. Where did you place the file?
When I tried it with release 0.10.9, I put it into DaggerfallUnity_Data\StreamingAssets\WorldData.
When I try it with Unity Editor+VS2017 debugger, I put it into daggerfall-unity\Assets\StreamingAssets\WorldData.
When did the error occur?
When the game starting after I press Start button on DaggerfallUnityStartup screen.
What version of the DFU codebase are you using, the worldDataDev test branch?
No. I'm using master branch.
That's the wrong version of DFU to use for this stuff. It's on a separate branch: https://github.com/ajrb/daggerfall-unit ... rldDataDev. I'll try your file in a little bit.
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: Sat Nov 09, 2019 7:43 pm
Yagiza wrote: Sat Nov 09, 2019 6:19 pm No. I'm using master branch.
That's the wrong version of DFU to use for this stuff. It's on a separate branch: https://github.com/ajrb/daggerfall-unit ... rldDataDev. I'll try your file in a little bit.
Thank you! With this branch your file works all right. And with my file this exception caught in ContentReader.EnumerateMaps():

Code: Select all

catch (ArgumentException)
{
   Debug.LogErrorFormat("Colliding location for MapId:{0} found when enumerating maps! Unable to initialise content reader. ", summary.ID);
}
I tried different pixels around the one I want to use (to get different location IDs), but always have the same exception.

Post Reply