YouGroove Posted February 21, 2015 Share Posted February 21, 2015 Hi , A road system for terrain, whatever is the system, from simple terrain flattening , to polygon terrain system, it would look lot better for people needing to make today roads ( it would help for game cars also). Without it , it's longer to make and not as good. 4 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted February 21, 2015 Share Posted February 21, 2015 The road system I implement is going to be awesome because the roads will get baked into the terrain clipmap renders. They will be part of the texture, and not a separate piece of geometry, like in Rage or Quake Wars: Enemy Territory. 4 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Olby Posted February 21, 2015 Share Posted February 21, 2015 You mean like this? Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
YouGroove Posted February 21, 2015 Author Share Posted February 21, 2015 The road system I implement is going to be awesome because the roads will get baked into the terrain clipmap renders. They will be part of the texture, and not a separate piece of geometry, like in Rage or Quake Wars: Enemy Territory. you mean like that ? Will it be possible to make a road crossing another or a road divinding in two roads or two roads joining another one ? I think about racing games shortcuts and alternative path. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted February 21, 2015 Share Posted February 21, 2015 You mean like this? Yes and yes. Although I don't know all the details yet, but it will be good. It's one of the benefits of the way I designed the terrain, although we haven't gotten to enjoy it yet. 7 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 21, 2015 Share Posted February 21, 2015 Yes and yes. Although I don't know all the details yet, but it will be good. It's one of the benefits of the way I designed the terrain, although we haven't gotten to enjoy it yet. excellent, josh Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
YouGroove Posted February 21, 2015 Author Share Posted February 21, 2015 although we haven't gotten to enjoy it yet. Make us enjoy then Quote Stop toying and make games Link to comment Share on other sites More sharing options...
nick.ace Posted May 9, 2015 Share Posted May 9, 2015 I found this software that can be used to make roads now if you really want to (not as good as the above links, but still should work with Leadwerks heightmaps fairly well): http://www.shapemagic.com/roadmaker/ 1 Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 10, 2015 Share Posted May 10, 2015 This will carve roads using pivot childs and splines. Second terrain layer will be road color. http://www.leadwerks.com/werkspace/page/viewitem_?fileid=404532791 function smooth( points, steps ) if #points < 3 then return points end local steps = steps or 500 local spline = {} local count = #points - 1 local p0, p1, p2, p3, x, y, h for i = 1, count do if i == 1 then p0, p1, p2, p3 = points[i], points[i], points[i + 1], points[i + 2] elseif i == count then p0, p1, p2, p3 = points[#points - 2], points[#points - 1], points[#points], points[#points] else p0, p1, p2, p3 = points[i - 1], points[i], points[i + 1], points[i + 2] end for t = 0, 1, 1 / steps do x = 0.5 * ( ( 2 * p1.x ) + ( p2.x - p0.x ) * t + ( 2 * p0.x - 5 * p1.x + 4 * p2.x - p3.x ) * t * t + ( 3 * p1.x - p0.x - 3 * p2.x + p3.x ) * t * t * t ) y = 0.5 * ( ( 2 * p1.y ) + ( p2.y - p0.y ) * t + ( 2 * p0.y - 5 * p1.y + 4 * p2.y - p3.y ) * t * t + ( 3 * p1.y - p0.y - 3 * p2.y + p3.y ) * t * t * t ) h = 0.5 * ( ( 2 * p1.h ) + ( p2.h - p0.h ) * t + ( 2 * p0.h - 5 * p1.h + 4 * p2.h - p3.h ) * t * t + ( 3 * p1.h - p0.h - 3 * p2.h + p3.h ) * t * t * t ) --prevent duplicate entries if not(#spline > 0 and spline[#spline].x == x and spline[#spline].y == y) then table.insert( spline , { x = x , y = y, h = h } ) end end end return spline end function Script:Start() --get world and terrain local world=World:GetCurrent() for i=0,world:CountEntities()-1 do if world:GetEntity(i):GetClass()==Object.TerrainClass then self.terrain=world:GetEntity(i) tolua.cast(self.terrain,"Terrain") break end end --## Adust this t terrain size local terrainsize=256 while self.terrain == nil do System:Print("....") end local points = { } for d=self.entity:CountChildren()-1,0,-1 do local e = self.entity:GetChild(d) System:Print( "Pivot Childs:"..e:GetKeyValue("name") ) if self.entity:GetChild(d)~=nil then x=terrainsize/2+self.entity:GetChild(d):GetPosition(true).x y=terrainsize/2+self.entity:GetChild(d):GetPosition(true).z h=self.terrain:GetHeight(x,y) table.insert( points, { x=x, y=y, h=h } ) end --System:Print(x.." "..y.." "..h) end local spline = smooth( points ) local colorspline = smooth( points,100 ) for x=1,#colorspline-1,1 do self.terrain:SetLayerAlpha(0,colorspline[x].x, colorspline[x].y,1) self.terrain:SetLayerAlpha(0,colorspline[x].x+1, colorspline[x].y,1) self.terrain:SetLayerAlpha(0,colorspline[x].x-1, colorspline[x].y,1) self.terrain:SetLayerAlpha(0,colorspline[x].x+2, colorspline[x].y,1) self.terrain:SetLayerAlpha(0,colorspline[x].x-2, colorspline[x].y,1) self.terrain:SetLayerAlpha(0,colorspline[x].x, colorspline[x].y+1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x+1, colorspline[x].y+1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x-1, colorspline[x].y+1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x+2, colorspline[x].y+1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x-2, colorspline[x].y+1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x, colorspline[x].y-1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x+1, colorspline[x].y-1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x-1, colorspline[x].y-1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x+2, colorspline[x].y-1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x-2, colorspline[x].y-1,1) self.terrain:SetLayerAlpha(0,colorspline[x].x, colorspline[x].y+2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x+1, colorspline[x].y+2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x-1, colorspline[x].y+2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x+2, colorspline[x].y+2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x-2, colorspline[x].y+2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x, colorspline[x].y-2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x+1, colorspline[x].y-2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x-1, colorspline[x].y-2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x+2, colorspline[x].y-2,.5) self.terrain:SetLayerAlpha(0,colorspline[x].x-2, colorspline[x].y-2,.5) end for x=1,#spline-1,1 do self.terrain:SetHeight(spline[x].x, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+1, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-1, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+2, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-2, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+3, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-3, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x+4, spline[x].y+4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y-1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y+1, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y-2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y+2, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y-3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y+3, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y-4, spline[x].h, false) self.terrain:SetHeight(spline[x].x-4, spline[x].y+4, spline[x].h, false) end end 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Marcousik Posted January 7, 2017 Share Posted January 7, 2017 Is there anything new with this ? Everything 2015... Road maker is mostly the only thing I miss in LE. Thx Quote Link to comment Share on other sites More sharing options...
Christian Clavet Posted July 13, 2017 Share Posted July 13, 2017 Wow. If this get fixed, with the proper shader, we could also use it for a a river tool by animating the UV texture (from what I see this is only possible by creating a shader for a material).. I'll try to bookmark this thread. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.