PR Roads and .mesh files

Making or wanting help making your own asset? Check in here
Post Reply
Aleon
PR:BF2 Contributor
Posts: 98
Joined: 2009-11-14 18:25

PR Roads and .mesh files

Post by Aleon »

I'm working on a tool to automatically generate more functional maps for PR based on the map files. One thing that's difficult to tackle is the roads system.

From what I managed to gather, it seems that once the roads are compiled they end up as height data, and some other representation that I'm trying to figure out. The question is, what exactly is stored in the client/road directory as .mesh files? The structure and name of thing implies that there are actual generated meshes that appear in-game, and the whole thing is not just a texture. My hopes are that it's possible to use said meshes to create 2d masks and paint the roads on the map.

If so, does anyone know the exact way .mesh files are generated? After my searches I didn't really find much on the internet. There are tools to view them, but I'm looking for a simple level description of how the files are structured so I can export stuff with c++ code automatically.


I've created maps by hand for the last PRT, the goal would be a program that can create something similar from any map file:
Image
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Post by Mineral »

For most PR maps we could provide the editor roads. I think those are just lists of coordinate s so that should work. Although for a lot of old maps that data isn't available anymore. Also not that 'automated' as it involves providing those files every release.

Although if it was build in into our prbuild tools and scripts thats more possible :p but for that you need to ask our programmers
Image
Aleon
PR:BF2 Contributor
Posts: 98
Joined: 2009-11-14 18:25

Re: PR Roads and .mesh files

Post by Aleon »

Well, that's still a solution. If I can't get it working otherwise, this could be a welcome alternative.
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: PR Roads and .mesh files

Post by Rhino »

[R-DEV]Mineral wrote:For most PR maps we could provide the editor roads. I think those are just lists of coordinate s so that should work.
Na, they are just a list of the actual settings for the roads, on which mesh templates they should use then other basic settings like so:

Code: Select all

rem ** [Road] - street8**
Road.CreateInstance "street8" 49 "Muttrah_street" 1189594323
Road.SetTextureScaleOffset 0/0
Road.SetPersistance 0.2
Road.SetRange -0.15/0.15
Road.SetOctaves 0
Road.Prio 0
Road.FadeDistAtStartLeft 0/3
Road.FadeDistAtStartRight 0/3
Road.FadeDistAtEndLeft 0/3
Road.FadeDistAtEndRight 0/3
I also can't see any way of importing the Road Meshes into 3DsMax. Haven't tried every format but I've tried the most obvious ones (.obj, .3ds, .dfx, .ai etc) and doubt any will work.

As such, the only real way I know of being able to do roads is to disable all of the terrain, water, statics, sky etc from drawing, then render a minimap with effectively on the roads being visible. From that you can then easily select only the roads from the generated minimap and overlay that over your minimap.

Small problem with this method, other than it takes quite a bit of effort to do, is that it requires you to have the editor files for the map (mainly the Roads.con file) and also it wont render road intersections in it so you will have to fill in those gaps manually.
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: PR Roads and .mesh files

Post by Mineral »

There is splines.con though, which is a list of coordinates. Just see no way to know what belongs to what road :)
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: PR Roads and .mesh files

Post by Rhino »

[R-DEV]Mineral wrote:There is splines.con though, which is a list of coordinates. Just see no way to know what belongs to what road :)
lol my bad, your right :p

Code: Select all

rem ** [Spline] - 1 **
SplineManager.CreateInstance
SplineManager.SetId 1
SplineManager.SetControlPointSnapModes 1
SplineManager.setLineWidth 0.3
SplineManager.setStepSize 1
SplineManager.AddControlPoint 541.249/6.14043/-349.274
SplineManager.AddControlPoint 535.555/6.83594/-341.423
SplineManager.AddControlPoint 501.16/6.74044/-306.331
SplineManager.AddControlPoint 475.258/6.94733/-293.974
SplineManager.AddControlPoint 424.16/6.94733/-292.703
SplineManager.AddControlPoint 405.322/6.94733/-293.055
SplineManager.AddControlPoint 391.675/6.94733/-291.916
SplineManager.End
And ye, you could probably code up something to make roads from them pretty easily, if you know c++ etc :p
Image
Post Reply

Return to “PR:BF2 Community Modding”