Page 1 of 1

[MOD] Basic Roads

Posted: Sun Sep 27, 2020 7:40 pm
by Hazelnut
Basic Roads, by Hazelnut

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;
To get a copy of the path data byte array, specifying the path type. This example requests the track data, and the Travel Options mod map window class gets both road and track data if you want more examples. The callBack receives a byte array of 500,000 bytes.

Code: Select all

ModManager.Instance.SendModMessage("BasicRoads", "getPathData", path_tracks, callBack);
To query a specific map pixel use one of the following three messages, supplying the pixel coordinates. The third message gets both road and track data or'ed together. The callback receives a byte of the path data point for that pixel.

Code: Select all

ModManager.Instance.SendModMessage("BasicRoads", "getRoadPoint", coords, callBack);
ModManager.Instance.SendModMessage("BasicRoads", "getTrackPoint", coords, callBack);
ModManager.Instance.SendModMessage("BasicRoads", "getPathsPoint", coords, callBack);
Example usage:

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); });
This prints "Road point for (204,204) is 9" and 9 means road leads North West and South.


Screenshots
RoadCity2.JPG
RoadCity2.JPG (252.74 KiB) Viewed 2150 times
RoadsMap.PNG
RoadsMap.PNG (342.25 KiB) Viewed 2150 times

Releases

For DFU v0.10.26+ get v0.6 here: https://www.nexusmods.com/daggerfallunity/mods/134

Re: [MOD] Basic Roads

Posted: Sun Sep 27, 2020 8:44 pm
by Baler
Super stoked to see a formal release! This will definitely make navigating the over-world a more enjoyable experience.
Thank you Hazelnut!

ps. thanks for releasing it on nexus

Re: [MOD] Basic Roads

Posted: Mon Sep 28, 2020 5:20 am
by emmathepony
Do I need this if I already have Travel Options installed?

Re: [MOD] Basic Roads

Posted: Mon Sep 28, 2020 5:59 am
by Ralzar
emmathepony wrote: Mon Sep 28, 2020 5:20 am Do I need this if I already have Travel Options installed?
Yes. Travel Options is the travel controls for widlerness and road travel.
This is to get actual roads ingame.

Re: [MOD] Basic Roads

Posted: Mon Sep 28, 2020 8:39 am
by Hazelnut
emmathepony wrote: Mon Sep 28, 2020 5:20 am Do I need this if I already have Travel Options installed?
If you want roads, yes. But you can use TO fine without roads.

Re: [MOD] Basic Roads

Posted: Mon Sep 28, 2020 4:06 pm
by emmathepony
Well I definitely want the roads because they look so good!

Re: [MOD] Basic Roads

Posted: Thu Oct 01, 2020 11:30 am
by Hazelnut
There's an issue with the mod causing player to teleport under the sea rather than onto the ship when selecting ship option from travel popup menu. No idea what's happening, but I will investigate. For now if you use the ship a lot, I suggest disabling roads until I can fix this.

Re: [MOD] Basic Roads

Posted: Mon Oct 12, 2020 6:33 pm
by Hazelnut
I've fixed the ship issues and several others. Also updated the first post with details of how to access the path data from other mods.

Re: [MOD] Basic Roads

Posted: Wed Oct 28, 2020 10:28 am
by Ferital
Combining this mod with Distant Terrain can lead to interesting paths :)
Screenshot.jpg
Screenshot.jpg (248.06 KiB) Viewed 1167 times

Re: [MOD] Basic Roads

Posted: Wed Oct 28, 2020 11:05 am
by Ralzar
Yeah, at the moment I stick to Mountains&Hills. It's a bit boring combined to Distant or Interesting Terrain, but it works much smoother with Basic Roads and Travel Options.