Adding coastal locations using world data system (difficult)

Discuss modding questions and implementation details.
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 8:22 pm I tried different pixels around the one I want to use (to get different location IDs), but always have the same exception.
I used my form to create the test location and that one works. I attached the file so you can check it out. It's getting awfully crowded there near Daggerfall city though :D

The LocationID is something that you have to change manually, I used 54000 and that works fine. Yours is still 21690 and that's the same as Ripwych Commons.
Attachments
locationnew-test-17.zip
(1020 Bytes) Downloaded 105 times
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 10:13 pm I used my form to create the test location and that one works. I attached the file so you can check it out. It's getting awfully crowded there near Daggerfall city though :D

The LocationID is something that you have to change manually, I used 54000 and that works fine. Yours is still 21690 and that's the same as Ripwych Commons.
IC. I changed LocationID and now everything's all right. I think, such thing should be mentioned in manual.

Now I can add a town on the map, but it seems, not in any pixel. 207,215 is a beach, and it seems no location can be placed there right now. If I add my location to this pixel, then once I enter it, I have an exception in PlayerGPS.UpdateWorldInfo(int x, int y) at this line:

Code: Select all

currentLocationType = currentRegion.MapTable[mapSummary.MapIndex].LocationType;
currentRegion.MapTable has only 3 items, but mapSummary.MapIndex is 1332.

Is it possible, to do something about it, to allow place locations at beaches?

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

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Yagiza wrote: Sun Nov 10, 2019 9:18 am IC. I changed LocationID and now everything's all right. I think, such thing should be mentioned in manual.

Now I can add a town on the map, but it seems, not in any pixel. 207,215 is a beach, and it seems no location can be placed there right now. If I add my location to this pixel, then once I enter it, I have an exception in PlayerGPS.UpdateWorldInfo(int x, int y) at this line:

Code: Select all

currentLocationType = currentRegion.MapTable[mapSummary.MapIndex].LocationType;
currentRegion.MapTable has only 3 items, but mapSummary.MapIndex is 1332.

Is it possible, to do something about it, to allow place locations at beaches?
Hazelnut's images do mention that you need a new Location ID for new locations, documentation will get better when we test more and find out what is possible. I think the 'beach' area is outside of the Daggerfall region as far as the game is concerned so it can't handle that. I've attached a location that is as close to the beach as I could get it.
Attachments
locationnew-test-17.zip
(1021 Bytes) Downloaded 94 times
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: Sun Nov 10, 2019 9:35 am Hazelnut's images do mention that you need a new Location ID for new locations, documentation will get better when we test more and find out what is possible. I think the 'beach' area is outside of the Daggerfall region as far as the game is concerned so it can't handle that.
Yes, you're right. Once I changed region ID to 31, my new location appeared in the world. There is no dot on the map of Daggerfall region, but the pixel is still clickable, so can fast travel to it. When my pointer is over the pixel, I see a location name, but it is wrong: it's Hearthfield Manor.

So, there are two questions left:
  1. How can I add a pixel to a region? I don't think it's a big deal to add an ability to override region map by specifiyng different regions for pixels.
  2. How can I dump a block (or just find out block name) for a pixel without location? I need to place new location over an existing block, not to a block it was over originally.

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

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Yagiza wrote: Sun Nov 10, 2019 11:10 am Yes, you're right. Once I changed region ID to 31, my new location appeared in the world. There is no dot on the map of Daggerfall region, but the pixel is still clickable, so can fast travel to it. When my pointer is over the pixel, I see a location name, but it is wrong: it's Hearthfield Manor.

So, there are two questions left:
  1. How can I add a pixel to a region? I don't think it's a big deal to add an ability to override region map by specifiyng different regions for pixels.
  2. How can I dump a block (or just find out block name) for a pixel without location? I need to place new location over an existing block, not to a block it was over originally.
Could you share the JSON? That way I can have a look and see if I can figure it out.

Also, have you tried using the HTML form in the Github repository I PM-ed you? I get the feeling you're still doing this manually and that way it's very easy to make mistakes and forget certain things. We're still in the process of figuring out what can and can't be done with this stuff so we don't have an answer for everything yet.

As for your questions:

I'm not sure what you mean by 'add a pixel to a region'. If you succesfully create a new location, it shows up on the map just like existing locations, the locations I shared show up fine on the map. I suspect the dot not appearing has to do with changing the region ID but I can't say for sure until I try the location myself.

I'm also not sure what you mean by 'I don't think it's a big deal to add an ability to override region map by specifiyng different regions for pixels.'
Does this mean you want to be able to set a different regionID for a location then the actual region it's in? Because that's not going to be possible.

And a pixel without location has no blocks associated with it, that's just Daggerfall terrain. Only when you create a new location for that pixel can you specify the RMB block(s). You can use Daggerfall Modeling to view the available exterior blocks.
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 »

Yagiza,

Your questions indicate that you've not yet understood the Daggerfall world data structures. What I've done it allow selective overrides of the data from the classic game, but unless you understand the way DF works at a basic level, nothing is going to make much sense unfortunately. I do touch on this in the intro of this guide, but maybe I should add some more detail there. This stuff is now possible, not easy - it's still very difficult. Maybe in time as helpful people like Burt create tools and tutorials it will become easier. UESP pages about the data files and the structs in the DFU code are the best places to learn, but there's a lot of having to put these pieces together in your head to make it all make sense.

I'm happy to help when you have a specific issue, but you really need to read and figure out how regions relate to blocks, and what a block actually is and can be used for etc. Until then, your questions are not going to make sense and be answerable I'm afraid.

It does seem like you've encountered a region boundary issue with the placement here, not sure why - I can't recall off the top of my head how regions are detected and I'm not looking at code right now so can't figure it out. But Burt is correct you have to place it within the region or things break.
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 »

BadLuckBurt wrote: Sun Nov 10, 2019 11:50 am Could you share the JSON? That way I can have a look and see if I can figure it out.
Ok. I attached the file. Just click one pixel South and one pixel East from Copperfield Manor. You'll travel to Test location.
Also, have you tried using the HTML form in the Github repository I PM-ed you? I get the feeling you're still doing this manually and that way it's very easy to make mistakes and forget certain things. We're still in the process of figuring out what can and can't be done with this stuff so we don't have an answer for everything yet.
Not yet. I'll try it today.
As for your questions:

I'm not sure what you mean by 'add a pixel to a region'. If you succesfully create a new location, it shows up on the map just like existing locations, the locations I shared show up fine on the map. I suspect the dot not appearing has to do with changing the region ID but I can't say for sure until I try the location myself.

I'm also not sure what you mean by 'I don't think it's a big deal to add an ability to override region map by specifiyng different regions for pixels.'
Does this mean you want to be able to set a different regionID for a location then the actual region it's in? Because that's not going to be possible.
By "adding a pixel to a region" I mean declaring a pixel to belong to a different region. I need a way to tell DFU, that pixel at 208,215 belongs to Daggerfall (region id 17) instead of default High Rock sea coast (region id 31).
And a pixel without location has no blocks associated with it, that's just Daggerfall terrain. Only when you create a new location for that pixel can you specify the RMB block(s). You can use Daggerfall Modeling to view the available exterior blocks.
Ok. Does that mean, that placing a location to a pixel will override terrain with an associated RMB block?
Attachments
locationnew-test-31.zip
(1.01 KiB) Downloaded 99 times

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

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Yagiza wrote: Sun Nov 10, 2019 12:42 pm Ok. I attached the file. Just click one pixel South and one pixel East from Copperfield Manor. You'll travel to Test location.
Please attach the files directly to your replies. I went back to the second page of this thread and grabbed it but the location file there uses 207,212 as coordinates? It's directly north of Daggerfall city.

Scratch that, I see the attachment now :o
Yagiza wrote: Sun Nov 10, 2019 12:42 pm Not yet. I'll try it today.

Yagiza wrote: Sun Nov 10, 2019 12:42 pm By "adding a pixel to a region" I mean declaring a pixel to belong to a different region. I need a way to tell DFU, that pixel at 208,215 belongs to Daggerfall (region id 17) instead of default High Rock sea coast (region id 31).
Could you post a step-by-step of what you're doing? From dumping the original location to creating the new one?

Hazelnut probably has a point about not understanding the world data structures. Using the form should make things go smoother too.
Yagiza wrote: Sun Nov 10, 2019 12:42 pm Ok. Does that mean, that placing a location to a pixel will override terrain with an associated RMB block?
Yes, Daggerfall Unity checks if there's a location at a map pixel. If there is, it smooths out the terrain and loads the RMB blocks associated with that location.
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
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Modding Tutorials: World Data Overrides

Post by BadLuckBurt »

Yagiza wrote: Sun Nov 10, 2019 12:42 pm Ok. I attached the file. Just click one pixel South and one pixel East from Copperfield Manor. You'll travel to Test location.
What program are you using to edit the JSON? I tried loading it into my form and it threw an error. On line 27 you have a closing } that shouldn't be there.

Code: Select all

    "Exterior": {
        "RecordElement": {
            "Header": {
                "X": 6764544,
                "Y": 9416705,
                "IsExterior": 32768,
                "Unknown2": 1217,
                "LocationId": 55771,
                "IsInterior": 0,
                "ExteriorLocationId": 55771,
                "LocationName": "Test"
            }
       >> } << this one shouldn't be there
        },
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: Sun Nov 10, 2019 1:23 pm
Yagiza wrote: Sun Nov 10, 2019 12:42 pm Ok. I attached the file. Just click one pixel South and one pixel East from Copperfield Manor. You'll travel to Test location.
What program are you using to edit the JSON? I tried loading it into my form and it threw an error. On line 27 you have a closing } that shouldn't be there.

Code: Select all

    "Exterior": {
        "RecordElement": {
            "Header": {
                "X": 6764544,
                "Y": 9416705,
                "IsExterior": 32768,
                "Unknown2": 1217,
                "LocationId": 55771,
                "IsInterior": 0,
                "ExteriorLocationId": 55771,
                "LocationName": "Test"
            }
       >> } << this one shouldn't be there
        },
Yes. That extra brace accidentally appeared during final preparations. Please, remove it.

Post Reply