Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

Discussion in 'Tools In Progress' started by raoul, Feb 19, 2014.

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Please be specific. How is it buggy? Which crossings are involved and after which step do thngs go wrong?

    Thanks,
    Raoul
     
  2. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Sorry. I have written this post in another forum.


    Hello

    I have a problem. I am making roads for Rally from real data of the WRC (world rally cars).

    When making a road, the data "min ident" automatically comes out at 6 but I need to alter the terrain 1 meter away for each side.

    When doing the lateral elevations, and re-execute "build roads", they disappear because the process smoothes them.

    I have tried to solve it by alternative means, but I think I have lost more time than if I ask it directly.

    Thank you very much.

    My English is very bad. In Spanish:

    Hola.

    Tengo un problema. Estoy haciendo carreteras para Rally a partir de datos reales del WRC (mundial de rallys).

    Al hacer una carretera, el dato "min ident" sale automáticamente en 6 pero necesito alterar el terreno a 1 metro de distancia por cada lateral

    Al hacer las elevaciones laterales, y volver a ejecutar "build roads", estas desaparecen porque el proceso las allana.

    He intentado solucionar por medios alternativos, pero creo que he perdido más tiempo que si lo pregunto directamente.

    Muchas gracias.
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Barritico,

    And I just responded the below on the other forum :)

    These Min indent values are locked to Min values based on your terrain specs, Size vs heightmap resolution. This is done to guarantee the best possible terrain deformation. Using lower values, the terrain may break through the road or the road will float above the terrain.

    What are you terrain specs?

    1 meter away is very close and requires an highly detailed terrain.

    Thanks,
    Raoul
     
  4. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    The rest of the error message just said where the function was being called, since it's a stack trace. Basically something like so:

    CreateTerrainData()
    TurnTileIntoAssetBundle()
    ect.​

    I figured it wasn't relevant as the important part, the last (top) function in the stack, was included. That is, the exception is shown to be thrown in DoBuildRoadNetwork(). Including the whole stack trace would not have provided useful information.

    This exception is not thrown for the first 7 tiles (area_lod4, 0_lod4, 00_lod3, 000_lod3, 000_lod2, 0000_lod1, 0000_lod0) but is first thrown for the tile after that (0001_lod1) as the roads from 0000 were destroyed and then for every tile efter that.

    In short, the exception is thrown when I call BuildRoadNetwork(), but only after I've destroyed some roads. Unfortunately, I haven't had much time to test what else in the code may affect this as I was asked to focus on something else.

    Oh, I'm not running this code in play mode, btw. I mentioned it before, but I don't know if that's important. I figure it might be since the Update() function won't be run on objects that may require it to clear old references. Does ERRoadNetwork have an Update() function and does it do any clean up when roads have been deleted?
     
    Last edited: Dec 8, 2017
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    For example all of the sudden its unconnected like here

    upload_2017-12-8_16-10-34.png

    Also see terrain bug in red circle
     
  6. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    without doing anything but building the terrain the unconnection as moved to the other side

    upload_2017-12-8_16-14-15.png
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Thank you,

    This is being looked into. It is related to T Crossings and "Activate Bending" in the crossings General Settings. What happens is that the crossing shape is not updated to prevent ending up in an infinite loop when roads are only connected to T crossings. That is why there is a gap sometimes. This can usually happen on short road sections and when doing a Road Network refresh.

    From your screenshots it looks like you don't need bending. You can switch it off, the gap should this appear. Otherwise moving the specific crossing should update it. The issue by itself will be fixed.

    The terrain glitch is a result of the gap, the terrain point is exactly where the gap is so it doesn't get updated like the other terrain points.

    What other bugs are you experiencing with crossings?

    Raoul
     
    Last edited: Dec 8, 2017
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    DoBuildRoadNetwork() by itself had one line of code that could possibly throw a MissingReferenceException but I can't see how that is causing the problem. That is why I asked for the full error message. But this line has been updated, I can send and update it you want.

    I have been testing this in the Unity editor as well hence why I used DestroyImmediate(road.gameObject). There are no errors when removing roads.

    It doesn't have an Update() function and as mentioned I do not get this error when the road is deleted by itself. Would it be possible to email me a simple example? I cannot see another way to recreate what you are doing without clear steps or full code?

    Thanks,
    Raoul
     
  9. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    The exception isn't necessarily thrown in the DoBuildRoadNetwork() function itself. It could be thrown in some underlying function, but I don't think the stack trace can tell since that code and interface is hidden.

    Unfortunately, I can't easily send a simple example as the process has many dependencies on large parts of our codebase, most of which I haven't written myself and is therefore unfamiliar with.

    I have some test code from before which I intend to expand on to try to do the same thing for testing purposes. I will test to see if I get the same error there. It is still dependent on our functionality for reading our data format as well as having data of said format for it to read, so it's not suitable to send as is either.
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    As mentioned I don't get MissingReferenceExceptions when removing a road but I will check the full process for BuildRoadNetwork for code that could possibly throw a MissingReferenceException. Do you already get this with the most basic version BuildRoadNetwork()?

    And what are your other build settings in the Inspector?

    Thanks,
    Raoul
     
  11. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    BuildRoadNetwork() is the one that I call. It in turn calls DoBuildRoadNetwork(), at least according to the stack trace. I don't call DoBuildRoadNetwork() on my own.

    I don't think I've changed any EasyRoads settings. I change the minIndent before building the roads for each tile so that it is suitable to the tile's resolution, but that's it.
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, that makes it easier. This is what I meant with the build settings:



    Especially the last three which are not covered by BuildRoadNetwork(): Road Tangents, Lightmap UVs, LOD Groups. Are these all switched off?

    Thanks,
    Raoul
     
  13. painkiller_93

    painkiller_93

    Joined:
    May 4, 2014
    Posts:
    14
    Can sidewalks be "smoothly ended" on I connections? For example on this case:



    The central sidewalk ends correctly as I'm using a side-object for it, but the lateral sidewalks end with no "ending curb" and you can see though them. I know in X or T connections you can end curbs so they end smoothly but is this possible on I connections?
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I Connectors cannot do that at the moment. They will be expanded with this sort of options including crosswalks, etc.

    What you can do is level them with the ground. The new demo project includes an example of that as part of custom road shape tutorials:

    1. With focus on the Scene View window press the N key to activate road shape node position changes. After selecting the corresponding marker you will see handles at all road shape nodes.
    2. Holding the Shift key you can select all sidewalk nodes.
    3. In the Inspector near the bottom of the markers section you will see the Road Shape Node controls. Enter 0 for the Y value.

    At this point the sidewalk height will gradually move to 0 over the full marker section. In the Inspector you will see "Ease In" Min Max values. You can play with these Min Max values to control the distance over which the sidewalk will level with the ground. In the tutorial we used 1 for both the Min Max values on the last marker.

    If you want a cap like on the middle piece in your image then I would create a custom prefab for that.

    Thanks,
    Raoul
     
  15. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Its a very sensitive creature :D If you dont do stuff teh right way you end up with a broken road netwoprk. For example the featyre with draging the point from the crossing to create a new road does not work. It will create half working roads that behave strange. What I do is create a new road and connect this one to the crossing instead.

    Another bug I have noticed is when marking a marker for example the end of one side and press I to create a new one. It will instead create the marker in the other end completely mess up the layout :D ANd sometimes it will create multiple markers etc. The workflow around markers over all needs some polish before it leaves the beta
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Please try to look at it from the perspective of what you are experiencing based on what you do and that these things perhaps are supposed to work differently or have different results in general.

    For example:

    I assume that this is related to a crossing in the scene. You move the mouse to a connection handle, you hold down the left mouse button, you drag a new road out, and you release the mouse button where you want the second marker to appear.

    There a zero issues known related to this. Could you provide exact information what happens on your end when you follow these steps? If you didn't follow these steps, then could you provide more info of what you did and what the end result of that was?

    If an essential part of the system like this would be completely broken, it would indeed not be ready for release. But if an essential part like this would be broken entirely then wouldn't more people complaint about it?

    Regarding pressing I, how can I reproduce that?

    [edit] Actually you already described it yourself. Hitting I inserts a marker. And indeed it is inserted before the first marker when the position is not within existing markers. Basically when it is positioned after the last marker, what you described. So, Shift + click should be used to add markers. But even if you accidentally hit the I key, how does that completely mess up the layout? Shift + R or Undo removes it, select the last marker and Shift + click to add the next marker after the last marker.

    How can I reproduce adding multiple marker without doing Shift + Click again? No known issue with this either :)

    I fully understand that some how you are experiencing all this. But please consider the situation that this tool is in beta for quite some time. What you mention are elementary processes during road network creation that would have been dealt with if they are clear bugs. So, considering that, please also include full steps on how to reproduce an issue. That is also what Unity requires when submitting a bug report.

    What can we do without this information?

    Yesterday you wrote that crossings are very buggy. You mentioned one thing. In what other way is it buggy for you and not yet mentioned on the Known issues and Troubleshooting pages:

    http://unityterraintools.com/EasyRoads3D/v3/html/known_issues.html
    http://unityterraintools.com/EasyRoads3D/v3/html/troubleshooting.html

    Don't get me wrong, we always ask to report bugs, it is very much appreciated, but please do this in a constructive way including full details.

    Thanks,
    Raoul
     
    Last edited: Dec 9, 2017
  17. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I'm sorry I can't give very detailed reproducing descriptions, our game is a realesed game in early access on steam and the customers want result so I'm on a very tight schedule. I will se if I can make a YouTube video while I work
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    If the core functionality is that buggy, wouldn't it make that very easy to reproduce the issue and post the steps here :)

    Or how about quick feedback on what I posted in my response? I edited the I key part because you already mentioned yourself that you were doing this to add a marker at the end of the road which is Shift + click, not I (insert marker).

    Anyway, good luck with your project!

    Thanks,
    Raoul
     
  19. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I didnt get long before I got a bug. The second marker did not wanted to be placed after I created a road by using the crossing

     
  20. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    One big problem is focus management when dealign with objects close toeach other..

     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Thank you for the video, these are always very helpful!

    What happened in the video is that you moved the mouse outside the View Scene Window at 0.31 and then released the mouse button, is that right? This event is not triggered in Unity's OnSceneGUI(). This breaks the functionality of completing the road creation. The way this is currently dealt with is, move back to the connection handle and click. This will undo the new road creation so you can restart it.

    If you would move back into scene view without releasing the mouse button there is no issue. You can release the mouse anywhere and creating the new road is completed.

    Raoul
     
    Last edited: Dec 10, 2017
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    It is not always clear what is a problem and what triggered that. So I will comment on what I saw.

    The first part is mainly about adding markers. To me it comes across as if the way markers are added are a result of two things:

    1. You are adding markers with the I key. This has been explained in my previous post. The I key is intended to insert markers between other markers, not to add markers at the end of the road. When doing that it will be inserted before the first markers resulting in what you see in the video at for example: 0.53, 1.23, 1.34

    On other occasions you hit I instead of Shift + click with the intention to add a marker at the end of the road and it gets inserted instead between two other markers: 1.08 and 1.16. But I don’t know without additional info, perhaps adding the marker that way was intentional?

    2. I am not entirely sure about this but perhaps on some occasions you want to move a marker but instead a new marker is moved? Is that what happened and perhaps unexpectedly? And in that case, did you hold the Shift key when that happened?

    With a marker selected and then pressing shift, a new marker is created which can be dragged away preserving the direction of the road at that position. This is useful for, for example, bridge segments when markers float above the ground. Shift + click snaps a marker to the ground. This is not ideally what you want for bridge segments. The above, select marker, press shift and drag makes it much easier to create bridge segments.

    2.33 is strange. It goes really quick, you have the marker of the long road selected. The arrow covers the crossing. Straight afterwards the other road is selected by I assume clicking that marker connected to the crossing. What happens afterwards goes fast and is strange, some how other markers got stored as being selected, like when using Shift + click when selecting multiple markers involving more then one road. I cannot recreate it. What exactly did you do there? How can this be reproduced?

    This seems related to 3.19 The roads are very close to the new crossing. Crossing connection selection currently has priority above road markers in a way that checking for closest. This is on the list to change because in the situation it is very easy to end up pulling out a new road unintentionally and connecting the road is not possible. For now make sure there is enough space, in the sitution in the videoy you can simply temporraily move the crossing just a little bit in the direction of the crossing connection with no road nearby. You can now select all three markers wihout the connection handle interfering and snap them to the crossing. After that, move the crossing back.

    4.51 When crossing connections turn red it means the road shape and the crossing connection shape do not match. This is not a problem when the road is not connected yet, it will simply inherit the shape of the crossing connection. In this case however it is already connected on the other end, no sidewalks. The crossing does have sidewalks. To solve this, indeed select the crossing and disable the sidewalk by clicking the green handles matching the connection to which the road will be connected. This is what you did at 4.51

    Also at the start and at 4.16, you are pulling out a new road from a crossing. In a previous post you mentioned that this does not work. I gave feedback on it. I guess this is resolved now? Or not? If not, can you give an example in a video when this doesn’t work for you?

    Something that might be useful just in case, I see you move the marker a lot using the arrows. We usually select the yellow rectangle at the center, that way you can move in all x,z directions, we find this works significantly faster. Optionally this can be combined with holding the ctrl key, which will snap the marker to the ground.

    To summarize, the thing at 2.33 looks like a bug. Can you provide more feedback on that? And did I miss anything?

    Thank you for the videos! And I hope the feedback is helpful

    Raoul
     
    Last edited: Dec 10, 2017
  23. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hey raul.. Yeah, first problem must have been like you described. Btw, I can use the middle button to place the road in this state. Maybe some clever way to hack around it so the it feels snappy for the user? Or if its truly a bug get Unity on the case., I have reported several bugs and they do fix them, some times it takes 6 months to a year though :D

    I will respond to your second post a little later, need to spend some time with the kids today :D I found another problem which I can reproduce every time.



    Create a crossing, then a marker by pressing I after you have selected a marker on the crossing. Then delete the marker, the marker is not deleted, but the road is.
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Andres,

    Yes, that will work but depending on where you click it will also change the scene view cam focus which some people may find annoying. That's why the other fix of moving back to the crossing connection and restart the pocess was added.

    This too seems related to still using the I key to add a marker after the last marker. Please use Shift + click to add markers.

    In this new scenario the marker is inserted before the first marker which is actually connected to a crossing. This will indeed mess up things.

    Yesterday I made a note regarding what you are doing, using the I key to Add markers at the end. This will be changed so when the insert index is still 0 after searching for the nearest markers, it will check which marker is closer, the first or the last. Rather then inserting the marker (the I key), the new marker will be added accordingly after the last or before the first unless this nearest marker is connected to a crossing.

    You are still constistently using words like "another bug".

    Also in an attempt to get more feedback from you on my posts :), would you mind going through all your recent posts and summarize which you still think truly are bugs?

    What I can recollect:

    1. Potentially a terrain artifact at the start of a road on very high resolution terrains when the road is raised above the ground and Preserve Terrain Contours is used.

    2. Potential gaps between T crossings with Activate Bending on, this is also mentioned on the Known Issues page

    3. Your second video near 2.30. This looks like a bug but perhaps there is a logical explanation. Having more feedback on what you exactly did would be helpful here.

    Is the above list accurate?

    Have fun with the kids!

    Thanks,
    Raoul
     
  25. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I was going to resume work tonight, but I have a problem.

    One of the roads does not respond to my marker actions. See below

     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Andres,

    Are you going to provide feedback on what I respond. Because at the moment there is a lot of noise. Can you please provide feedback and more info.

    The black surfaces that should be white, can you check the material used on thes surfaces:

    /Assets/EasyRoads3D/Resources/Materials/surfaceMaterial

    Is what you see related to previous videos? You were doing all sorts of things with the I key? Did that break something? Can you email me this scene?

    Thanks,
    Raoul
     
    Last edited: Dec 10, 2017
  27. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I was about to, but when I fired up my scene I saw that the roads was broken now my road system is pretty in a useless state. So im more worried about that :/

    About the I key, either remove it or make it work always. From a users perspective you cant have a hotkey that works sometimes and sometimes makes a complete mess of the roads. Its make no sense.

    I'll send you the scene
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    This is exactly what I mean, I have explained the behaviour of the I key several times. There has not been any clear feedback on that. Were you indeed using the I key on those occasions I guessed you were? And was that indeed intended to add markers at the end?

    Let's try to get this sorted out for once and for all. The I key can be used to insert markers between markers at the mouse position. How / when does that not work for you?

    Please use Shift + click to add markers after the last marker, the situation in your video. I already mentioned in a previous post that some code will be added to the Insert marker process in order to treat it as "Add marker" when someone does what you were doing.

    Does the behaviour of the I key still make no sense to you?

    About the black surfaces and that specific material. Is that resolved?

    Thank you for the scene, I will have a look at it.

    Thanks,
    Raoul
     
  29. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    No that the I hotkey creates a point at the mouse is not userfriendly at all since the mouse is not participating in the action at all. To me hitting I between two markers should create a new marker rigth in the center of the two others. The shift+click is working nice though and is user friendly since teh mouse is indeed involved here.

    I removed the black / white part from my post because it was irrelvant :D It was because I test baked the scene for performance draw call tests, and without light probes dynamic items such as your guides get wrong light. Maybe use a shader that does not lit itself using GI? Just a side note.
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    So far no one has ever complaint about the I key functionality for inserting a marker between two existing markers. If it doesn't work well then I will be happy to change it but so far no one has complaint about it.

    But this the whole I key discussion started because of the second video. Could you please answer the following question:

    In that video there were several occasions where a marker was added that connected to the marker further away instead of the closer marker where it seemed that you wanted to add a marker after the last marker. Were you hitting the I key? If so, then please use Shift + Click in those ocassions.

    Thanks,
    Raoul
     
    Last edited: Dec 10, 2017
  31. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Yeah, it does works as designed, though a bad design in my eyes. Anyways, lets not focus on that. Its more important to fix my issue with my road that just stopped to respond to marker changes. Or the crossings that do not work that well (Which seems to be a focus problem mostly).
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I will look at your scene tomorrow and get back to you :)

    Thanks,
    Raoul
     
    AndersMalmgren likes this.
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    The code that updates the mesh was never reached for that road. I just sent a short script that will refresh the selected road.

    In the case anyone else has ever experienced this, this auto refresh will be added to the package as well.

    Thanks,
    Raoul
     
    AndersMalmgren likes this.
  34. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks will have a look tonight: I also sent you some error log detaiils, that might help get to the bottom why it broke.
     
    raoul likes this.
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    New v3 demo project

    I have been in touch with the asset store. Approving new packages take a little bit longer nowadays, 2 to 3 weeks. So hopefully it will be approved soon.

    Meanwhile we have renewed our website. You can register your asset store copy and download from our server. All should be fine, but let me know if you are experiencing issues with the registration or the download.

    The new demo project is intended to showcast all the features with links to short tutorials on the website covering beginner, intermediate and more advanced features.



    More demo project images have been added to the first post of this thread.

    It is recommended to import the package in a new project. If there are assets you like to use in your projects, you can use the export / import options.

    The website also includes a survey. You can participate and let us know what you would like to see added next after v3 is fully released in the next weeks.

    Thanks,
    Raoul
     
    Last edited: Dec 11, 2017
    hopeful, sjm-tech and AndersMalmgren like this.
  36. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    The refresh code worked! Thanks!
     
    raoul likes this.
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Regarding the new demo,

    It also includes a new small utility to create simple crossings based on road types:

    For now this will create a road mesh which can be added to the system through the Custom Prefab system. But this will be integrated as a crossing option in the tool itself as part of dynamic crossings.

    Let me know if you have questions or like to see something added to this utility or improved.

    Thanks,
    Raoul
     
  38. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    Allow me to get back to you on that later. I've been running some test code in a test scene to see if I can do the thing I was trying to do without all the extra stuff around it. Turns out there was some errors in some of the roads (I don't know yet if they were the cause of my original problem). Some road markers had 1.#QNAN0 as Y, but I've corrected that now. An issue I haven't been able to correct though is an ArgumentOutOfRangeException thrown in the InsertIConnector() function.

    IOOR.png

    This happens in a road that is 49 nodes long after inserting a new marker at index 1.
    IIC.png
    I haven't listed all the nodes, but I don't think that's relevant. After all the nodes are listed comes the ArgumentOutOfRangeException above. The only thing done to the road at this point is the following:

    road.InsertMarkerAt(aNode, i - cut);
    road.SetSplineStrength(i - cut, GetCurveStrength(ref prevNode, ref aNode, ref aNextNode));
    road = road.InsertIConnector(i - cut, road.GetName() + "_split", out connection);​

    In other words, a new marker (aNode) is being inserted between markers 0 and 1 (this is where the road crosses the edge of the tile). The spline strength is set according to the distances on either side. And then that marker is turned into an IConnector in order to split the road at that point.

    I suspect that EasyRoads doesn't like when you split a road at index 1, but considering that this happened in tile 3111_lod0 I wouldn't think that it's the first road to do so, though I'm not sure.
    Another cause could be that node 0 is very close to where the split is made (approx. 2 metre).

    I'm testing right now to see if moving the splitting point further away will make it not throw the exception. If the exception persists I can send you the code if you want to test it yourself.

    Edit: It seems that the distance was the problem in this case. I check if the distance to the node before or after is less than 10 metre and if so put the new node in the middle instead. The rest of the test goes through without problems, so I will go back to try the asset bundle creation code again and see if the problem I had persists.
     
    Last edited: Dec 12, 2017
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi NordstroemSAAB,

    I just did a simple test:
    Code (csharp):
    1.  ERRoad road = EREditor.GetSelectedRoad();
    2. road.InsertMarkerAt(new Vector3(450, -20, 430), 1);
    3. road.InsertIConnector(1);
    With marker distances of 10. The marker and the I Connector were indeed inserted succesfully. I will see if I can recreate the error with markers closer to each other.

    Yes, I think it is indeed not a bad idea to check distances first and simply move a point if it is already close to a terrain tile edge instead of inserting a new marker.

    Thanks,
    Raoul
     
  40. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Hey Raoul,

    Haven't used v3 yet, but will do when i next need roads in my project which will be soon.

    Just wondering though if you can add Wet Road textures too in v.3 if you haven't already? So roads with different sized puddles would be great! Would be even better if we could control the amount of puddles with a slider in the material editor!

    Thanks
     
  41. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    The roads work now so I tried the asset bundle creation again, but I'm still getting the original error with a gameobject having been deleted but still being referenced.

    You were asking for this, right?
    BuildSettings.png

    Next I will try commenting code that are unrelated to the roads in order to pin down if there's some code in the rest of the asset bundle creation process that could cause the problem.
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi KillerNads,

    Do you mean if we will provide wet road textures or if it is in general possible in v3?

    As this is material shader related, it all can be done. At the moment releasing v3 has priority. After that the idea is to expand the new demo project, mentioned a few posts above, with more examples. But there are many things on the list, you may want to participate in the survey , more materials / shaders is mentioned :)

    On the geometry aspect, if you are requesting that as well, yesterday we received an email about importing road geometry (one step further then what can be done with the custom prefab system). This has been asked before and usually the question is if crossings are involved. If not, then this can be by generating the road as a procedural side object.

    But you could also try to set up a road type with a specific width/shape and create the procedural side object with the start and end matching that road type shape. In theory it should match the road at the start and end and there fore also connect well to crossings. That way the puddles can also be modeled in the road. It is something to try out, and an example of this will be added to the demo project if that works.

    Thanks,
    Raoul
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    That simplifies things as it cancels out issues with calculating lightmap UVs and generating LOD levels. But the question still is, how to reproduce this? Your set up is quite complex. Could you email me a simple test scene using this set up so I can look at it?

    Thanks,
    Raoul
     
  44. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    Sadly, it's too complex to simplify and send. It's not even scene specific code. I did make a test scene just to test the road specific part of the code, but even that required input from our own generated data format and the complex code needed to read it. However, that test code worked without errors, so I don't think it's anything inherent in the road building that is causing the error.

    I will be trying to pinpoint the cause in the surrounding code now and I will come back and tell you when I think I've found something that interferes with EasyRoads.
     
    raoul likes this.
  45. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hey @raoul

    Quick question about terrain deformation

    I get results like these that look pretty bad

    upload_2017-12-13_0-43-4.png

    But in other places it looks much better. Like here
    upload_2017-12-13_0-43-40.png

    I guess the difference is that one is adding height and the other one is lowering. Any tips on getting that first one to look a littel better? Thanks for all the help
     
  46. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Hi
    I have a question. Can we add a road without modifying the terrain? I basically want a road to follow the existing terrain without changing it in any way. So it should detect the height and follow it as closely as possible.
    Also, can we do the same but with terrain meshes? I have all my terrains converted to meshes already.
     
  47. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    Can't you adjust to have a marker at the crest of that downslope and push the last one down to follow the terrain at the end so it blends out? Also maybe change the indent (I think) for that last marker so it spreads the terrain adjustment over a larger area at the end so it's less abrupt?
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Anders,

    In both images the terrain is deformed in a similar way, but the first image, that is the start or end of the road which is clearly raised above the ground resulting in the specific terrain deformation. I think you will see a similar effect when you would lower it to further below the ground at a similar height difference. How would you like this being handled in a different way? By being able to control the level distance, similar to the Surrounding values? Or random noise?

    Also consider your super high terrain heightmap resolution which allows much more detail and there for you might expect more detail. At the end of the day, what the tool does is level the terrain with the road. I will check if Preserve Terrain Contours can be improved here. But if the terrain in that area already is reasonably flat that will not really make any difference to the end result either. The only other way would be using some random stamp. But in what way? Will that always result in what the user wants? Perhaps this is one of those situations for some final manual editing?


    Thanks,
    Raoul
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi creat327,

    You can switch of modifying the terrain. But I think you also want the road to snap to the terrain?

    That is not possible through the editor at the moment. But through the scripting API you can do this.

    ERRoad.SnapToTerrain(bool value)
    ERRoad.SnapToTerrain(bool value, float offset)

    Will that work or do you need a full code example?

    Thanks,
    Raoul
     
  50. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Maybe a way to control the degree of the slope? I know that increasing the surrounding in some sense does this but it also increases the flat area by the road. In this particular case its probably best with adding a Gaia stamp beneath the road. But there are other places that also look strange. I do not know, a bit more organic look somehow would be nice? maybe a little less aggressive transition between the existing terrain and the roadembankment?