Description
This mod adds roads and tracks to the world of Daggerfall, connecting towns and cities. Roads ring locations they intersect, since the roads don't line up with city gates. This is because the implementation is simple so that it adds very little overhead to the DFU terrain generation and should run on any system that can run the base game. Someone may create a fancy roads mod in the future I expect, which will require higher spec systems, but Basic Roads will always be available.
The roads are integrated with my other mod Travel Options allowing time accelerated travel along paths by pressing a configurable key to start and stop path following. The roads that encircle locations can be circumnavigated as well, and following will stop when a junction is reached. Following roads give all the benefits of cautious travel but without any speed penalty. Dirt tracks are not visible in winter when the ground is covered by snow, which is realistic, but not very user friendly so I plan to add a download with some textures to make them visible for anyone who wants that.
See the WIP forum thread for more details about how this works, as well as progress on adding roads and tracks to the various regions: viewtopic.php?p=46530
Other Mods - accessing path data
Other mods can access the path data for roads and tracks using these messages. Either request a copy of the entire byte array for the path type required, or query specific map pixel coordinates. Use the former if your mod needs constant access to the data, and the latter if you simply need to find out what paths are in a specific map pixel. (or a few) Path types and directions are defined as follows. The direction constants have the binary format in comments because it was not compatible with the MCS compiler. Zero means no paths in that map pixel.
Code: Select all
public const int path_roads = 0;
public const int path_tracks = 1;
public const byte N = 128;//0b_1000_0000;
public const byte NE = 64; //0b_0100_0000;
public const byte E = 32; //0b_0010_0000;
public const byte SE = 16; //0b_0001_0000;
public const byte S = 8; //0b_0000_1000;
public const byte SW = 4; //0b_0000_0100;
public const byte W = 2; //0b_0000_0010;
public const byte NW = 1; //0b_0000_0001;
Code: Select all
ModManager.Instance.SendModMessage("BasicRoads", "getPathData", path_tracks, callBack);
Code: Select all
ModManager.Instance.SendModMessage("BasicRoads", "getRoadPoint", coords, callBack);
ModManager.Instance.SendModMessage("BasicRoads", "getTrackPoint", coords, callBack);
ModManager.Instance.SendModMessage("BasicRoads", "getPathsPoint", coords, callBack);
Code: Select all
Vector2Int coords = new Vector2Int(204, 204);
ModManager.Instance.SendModMessage("BasicRoads", "getRoadPoint", coords,
(string message, object data) => { Debug.LogFormat("Road point for ({0},{1}) is {2}", coords.x, coords.y, data); });
To schedule the road painting job from your mod if you're replacing the TerrainTexturing class, call "scheduleRoadsJob" passing MapPixelData, tileData, and the jobs already scheduled. The road painting job has to run after the terrain tile data has been generated but before it's been assigned to the tilemapData. In other words after GenerateTileDataJob and before AssignTilesJob.
Code: Select all
ModManager.Instance.SendModMessage("BasicRoads", "scheduleRoadsJob", object[] {mapData,tileData,dependencies}, callBack);
Code: Select all
// Schedule the paint roads jobs if basic roads mod is enabled
JobHandle preAssignTilesHandle = tileDataHandle;
if (basicRoadsEnabled)
{
ModManager.Instance.SendModMessage("BasicRoads", "scheduleRoadsJob", new object[] { mapData, tileData, tileDataHandle },
(string message, object data) =>
{
if (message == "error")
Debug.LogError(data as string);
else
preAssignTilesHandle = (JobHandle)data;
});
}
Screenshots
Releases
For DFU v0.13.5+ get v1.2 here: https://www.nexusmods.com/daggerfallunity/mods/134