Very few houses for sale.

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
User avatar
Ferital
Posts: 282
Joined: Thu Apr 05, 2018 8:01 am

Re: Very few houses for sale.

Post by Ferital »

OK thanks for the information, I didn't know that :)

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Very few houses for sale.

Post by Interkarma »

Ferital wrote: Wed Sep 04, 2019 11:37 am Classic seems to mostly rely on map building data info rather than block one. From what I could understand, block buildings data is used as a base and more or less tweaked for each town, mostly regarding shop quality and building types. Also, many unknown and/or originally null fields are modified and used at runtime.
So true, and I didn't explain what I was doing in much detail sorry.

I still use the map building data, but it goes through a careful relinking process to ensure that it correlates onto block building data.

Map building data generally contains fewer and different buildings to block building data, but the various shops, guilds, etc. are almost always in the same order and quantity in both. The map building data contains the unique settings like shop quality and building name seeds. So what I do is combine the map and block information at load time, spreading the known-good records and discarding the bad ones. It took me several months to boil this down to a simple process that has been ticking away for years now. You'll find this relinking process in RMBLayout.GetLocationBuildingData().

I tried extensively to use the map building data as authoritative, but the two side just don't line up correctly. The map building data is fine to get a quick read on a location, but it's flat out wrong a lot of the time compared to the actual block layouts.

As this process ignores residences, we're pretty much free to grab whichever residences you like as offer them as buildings for sale. Once a building has been allocated ownership to player, all of Hazelnut's systems should evict the peasants and handle serialization, etc. quite nicely.

You don't want player buying up all the houses though, especially in small towns, or it becomes difficult to stage local quests in those towns. Roughly, a rate of around 1 house for sale per 4 blocks could work. So big cities like Daggerfall will have 16 houses available and small locations are capped at 1. Those are just some thoughts on the process, anyway. Reality of implementation will likely require some refinement.

User avatar
Ferital
Posts: 282
Joined: Thu Apr 05, 2018 8:01 am

Re: Very few houses for sale.

Post by Ferital »

Thanks for the detailed explanation :) Sorry I didn't understand that method at first, I only took a glance at it and thought it was used only for mods building replacement...

In fact, classic does more or less the same, except that it also includes random houses selected between House1 and House4 (but neither House5 nor House6) in the list using a seed which is given by adding one of the LocationRecordElement.Header unknown field and a counter which is incremented for each block and each building. For all these buildings, a unique sector id is generated, again using the combination of one the LocationRecordElement.Header field and the same counter. As the seed is always the same, we always end with the same building list which, normally, is exactly the same as the map building list.

This means map building data is comprised of all blocks shops, guilds, city walls and a bunch of random houses with the exception of House5 and House6. To be sure a block building matches a map building, classic checks that the above generated sector field is the same as one stored in map data. If not, classic crashes with the message ""Invalid map data."

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

Re: Very few houses for sale.

Post by Hazelnut »

Interkarma wrote: Thu Sep 05, 2019 12:33 am You don't want player buying up all the houses though, especially in small towns, or it becomes difficult to stage local quests in those towns. Roughly, a rate of around 1 house for sale per 4 blocks could work. So big cities like Daggerfall will have 16 houses available and small locations are capped at 1. Those are just some thoughts on the process, anyway. Reality of implementation will likely require some refinement.
To match classic, DFU only allows 1 house to be owned per region. So I think we should be okay.. :D
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Very few houses for sale.

Post by Interkarma »

Ha, I'd forgotten that. :)

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

Re: Very few houses for sale.

Post by Hazelnut »

Submitted a PR for this. Should ensure 20 houses are availiable unless the town is < 200 houses.

Also fixed the discovery integration. Currently in 0.10.7 houses are not marked on the map and players are basically in the dark as to where the hell their very expensive new purchase can actually be found.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Very few houses for sale.

Post by Interkarma »

Nice! Looking forward to playing with it.

Post Reply