Request: Mesh road type zoning tool for tunnels and caves

Discussion in 'World Editor' started by ltntai, Sep 26, 2021.

  1. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    Would it be possible? Instead of placing many zone blocks and tricky portals between them, twisty underground paths could be zoned with one bendy area with portals just on each end.
     
  2. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    My tunnel project seems to hit some kind of limit with the number of portals. It's a 5 km long cave between a backdrop mesh and a ditched terrain block underneath it. Cave zones in this case should follow the the backdrop's shape as close as possible or there will be camera cutting issues. Overlapping zones and dual purple portals between them works best (like in West Coast highway tunnels).

    But after placing about 15 zones in line and driving in it there is a sudden drop in fps from 100+ to single digits. GPU usage stalls to 0-1 % and task manager must be used to end the freeze.

    This cave needs about 40 zones and and 84 portals. If I hide 2/3 of the of the tunnel portals the rest of it works fine.
    If this kind of tunnel could be made with one mesh road type snaking tunnel zone and just a few portals it might work without problems.
    I studied many maps and tried many things. Different zone overlaps, fat and slim portals, upright and canted portals to match the zones. Raising the terrain so that less portals can be seen through at once. The freeze is inevitable.
    screenshot_2021-10-06_23-46-13.jpg screenshot_2021-10-06_23-46-17.jpg screenshot_2021-10-06_23-46-34.jpg screenshot_2021-10-06_23-48-11.jpg screenshot_2021-10-06_23-48-29.jpg screenshot_2021-10-06_23-44-17.jpg screenshot_2021-10-06_23-32-13.jpg screenshot_2021-10-06_23-33-34.jpg screenshot_2021-10-06_23-35-09.jpg
     
  3. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    I rearranged the tunnel and used just 15 zones with 31 portals without sacrificing the whole concept. Good performance and no noticeable lag points anymore. I still don't know the logic behind the unaligned zone-portal connections. Every single one had to be fine tuned and test driven both ways.
    At one point when moving through the zones the editor/game kept crashing to desktop with a notice window saying:

    D:\jenkins\workspace\gameengine\build\gameengine\Engine\source\math\mPlane.cpp(170): Fatal-ISV
    SGUtil::clipToPlane: error in polygon clipper

    followed by BeamNG.drive 0.23.5.2 0x00000001 crash notice

    There are still some lighting issues to fight, but this feels like a fairly good way to make huge underground system without 3D tunnel models or the need to place millions of rocks to form a tube.
     
    #3 ltntai, Oct 10, 2021
    Last edited: Oct 11, 2021
  4. Artistterrymartin

    Artistterrymartin
    Expand Collapse

    Joined:
    May 5, 2019
    Messages:
    426
    What I am going to say sounds bat crap nuts... Fake it. Make a model of the ground using screen shots taken in game with no hud stuff on screen. Give Meshroom the pictures to make a 3dmodel. about 15- 20 going around the area that the model will be of. (be sure to decimate it to reduce poly count ) than import it into Blender and export as a DAE.
    This is an example of what I mean to make but you would be making the cave exterior or ground a tunnel is in. When in reality there is no terrain block there over your roads, just a DAE. But it will look just like the terrain. Turn grass off. Instead add mesh grass to the DAE. Forest tool will apply anything to a DAE model.
    Just how I do it :) maybe a pain in the rear to do, but not too bad. I did the same technique to simulate blender water where a river will be on a map. Even though we cant have animated morphing without bones, the still frame of the moving water looked pretty good.
     

    Attached Files:

    • s-l500.jpg
  5. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    That would be a fancy way to camouflage a cave in the middle of the map while having the benefits of the terrain block inside it. But I don't mind the ugliness of the backdrops. Map has to end somewhere and the average player knows when they are off the driving area. Might as well use those transition boundaries for driving rather than trying to hide them.

    Anyway that still leaves the problem of zoning the underground to get it dark day and night and echoing without using SFXSpaces. If the tunnel roof is close to the ground it's hard to get it right with zone blocks and portals. And there seems to a limit for them, unless it's just an issue on my map and hardware.
     
    • Like Like x 1
  6. Artistterrymartin

    Artistterrymartin
    Expand Collapse

    Joined:
    May 5, 2019
    Messages:
    426
    I just learned something new reading that from you. That was something I never messed with. I seen them but had no idea what they did. Thanks ! You will have to share that map got me curious how it turns out when you get done with it.
     
    • Like Like x 2
  7. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    Oh man I found at least one more laggy crash zone in the cave. Here's a pre-alpha bug hunt version of the map:
    https://drive.google.com/file/d/1a_s-NhgqkKCn3tUXyfqMwEvunf2Sq-Q1/view?usp=sharing

    I left some notes in the readme.txt. Cave is on the east side, entrance is down in the ravine near the south spawn point. Any pointers or fix suggestions are welcome, but I really wouldn't want to delete more zones.

    https://www.beamng.com/threads/help-zone-vs-portal.60209/
    https://www.beamng.com/threads/zones-and-occlusion.41815/
     
  8. Artistterrymartin

    Artistterrymartin
    Expand Collapse

    Joined:
    May 5, 2019
    Messages:
    426
    I love what you are doing with this map. Its a huge map ! Was looking for entrance to cave and gave up. Teleported to a zone and spawned car inside. I see now how they work. Somewhat. Looking at the links where someone explained the house with windows makes more sense now. Have not tried to make caves yet or really any ideas for creating content to go in them. Other than stalagmites, crystals, water drips, lava or pools of water and lava. Dark comes to mind. Maybe if I did one I would put some of the particle flames for torches on the walls. To be honest I have not even messed with lights yet in the world editor. Maybe a bunch of bones are in caves or rusty cars where people could not get out and was lost inside :)
     
    • Like Like x 1
  9. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    Do you have any lag or crashes between zones 6 and 7 or anywhere else in cave? I have a feeling my computer is starting to die. Today it had a sudden crash in the cave saying it was 0x80000003 - STATUS_BREAKPOINT.
     
  10. Artistterrymartin

    Artistterrymartin
    Expand Collapse

    Joined:
    May 5, 2019
    Messages:
    426
    Update... I recorded my performance in the zone I think you are talking about. It also shows the minor glitch at the end of the video I mentioned below. Them water hazards got me :)
    (1) Testing part of a track from creator ltntai - YouTube

    I did not have any problems but did not completely go through it. I will see if I can spawn to that spot. Only thing I saw was the car vanishing from view from camera outside follow mode not sure of location exactly. I did not really know what was going on until I read the example of a house with windows and stuff being occluded depending on camera location to a zone in or outside of. Think thats how I understand it.
    I never saw that error in my life :) I get a lot of 0000001 errors when I am experimenting, sometimes stack overflow or whatever thats called.
     
    #10 Artistterrymartin, Oct 13, 2021
    Last edited: Oct 13, 2021
  11. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    Thanks for taking your time to test it. I made a quick redesign with two entry zones and one deep main cave zone, 8 portals total. No crashes or severe lag points, but overall that high walled design cut the performance about 20%. And it looked awful. Went back to the original and reduced the zones to 10. After a few test runs it feels steady, well above 75 fps without sudden drops.

    I think (and hope) my lags and crashes were game engine related.
     
    #11 ltntai, Oct 13, 2021
    Last edited: Oct 13, 2021
    • Like Like x 1
  12. Artistterrymartin

    Artistterrymartin
    Expand Collapse

    Joined:
    May 5, 2019
    Messages:
    426
    I want to make a simple track based on the arcade game Outrun from the 80s. Low poly cardboard cutouts for the track side scenery. Something I started a long time ago but never finished it. Something that would run great on any hardware. Good thing about your caves is its dark. If you reduced the poly count on anything it would not be very noticeable. If you decided to tweak it more. I know the one time I cut a hole in a map to make a tunnel I saw an immediate drop in performance. Not sure how then engine is affecting other than its now drawing a lot more stuff. I recall thinking it was crazy the performance hit. I also saw a 8% performance hit by simply adding a ground plane for extended scenery. Its why my one track uploaded has no extended ground or background models beyond the terrain block. I saw a huge dip one time using a 16 texture on a model of a broke road. Knew it was that causing problem cause I scaled it to 8k and it was butter smooth. I wander if you have performance problems on maps you did not make. Like run game in safe mode and check one. Then hit the ~ key after reloading your map so see if you have errors. I had performance drops when a ground model was missing and the game kept searching over and over "there is no ground model for MUD2, using Asphalt instead" (repeat 30 something times) That was causing serious performance hit but no idea why at first.
     
  13. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    Just read about Torque3D's zone groups and how they are supposed to connect the zones without portals. I put all my zones from default group 0 to group 1. Removed the mid portals between the zones, left only the entry ones. Works beautifully and makes my zone tool request unnecessary. Unless there's some catch I should know.
    Why are the official tunnels and mines zoned so complicatedly and differently between maps?
    And what is the point of placing additional SFX spaces for soundAmbiance inside the zones when the zones already have that option?
     
  14. DoritoMan113

    DoritoMan113
    Expand Collapse

    Joined:
    Dec 29, 2016
    Messages:
    42
    WARNING: DO NOT USE MESHROOM. It has destroyed two of my friend's GPUs and I think it also broke a friend of his' GPU as well.
     
    • Like Like x 1
  15. Artistterrymartin

    Artistterrymartin
    Expand Collapse

    Joined:
    May 5, 2019
    Messages:
    426
    I would not have believed that had Amazons game not killed a few GPU's. Guess anything is possible. I know it gives the CPU's a heck of a workout. I turned AVX instruction set to -2 in the bios to keep them cool. Thanks for that information. Hopefully the little I do on there will be okay. I seen where some people give it hundreds of photos for one object, Most I gave it was about 56, that was last night of my head. Guess I was too ugly for it to work well enough for the typical 13-17 pics I give it for something. It does support certain features I am not sure my 2080s has. Think those are for the production cards like the volta's but not sure.
     
  16. ltntai

    ltntai
    Expand Collapse

    Joined:
    Mar 18, 2017
    Messages:
    354
    Cave's ambient lighting could use some improvement. At daytime the cave should be dim at the entrances and get gradually darker when traveling towards the middle (not a total darkness for casual game play reasons). This turns into a problem at night when the star lit outer area is darker than the cave. Transition looks stupid and is unnatural. So at night time all the cave zones should be pitch black (also for increased game play hardness).

    I don't want to brighten the map at night to even it out, so maybe a lighting lua script could help. In the Vapor map remaster I used @Occam's Razer's lua that hides the the unlit day lamps at night to reveal the night lights. Now the opposite is needed so that darkness wins in the cave at nights. I tried to edit the code, but couldn't make it work. Hiding a zone is also buggy, when a zone is unhidden its ambient lighting won't "activate" unless it is edited/moved a bit.

    Code:
    local M = {}
    
    local function setAllLightsEnabled(group, value)
        for i = 0, group.obj:getCount(), 1 do
            local id = group.obj:idAt(i)
            local obj = scenetree.findObjectById(id)
            if obj and obj.obj:isSubClassOf('LightBase') then
                obj.obj:setLightEnabled( value )
            else
                obj.obj:setHidden( value )
            end
        end
    end
    
    local lastValue = nil
    
    local function onUpdate()
        local tod = scenetree.tod
        if not tod then return end
    
        local value = false
        if tod.time > 0.24 and tod.time < 0.77 then
            value = true
        end
    
        if lastValue == value then return end
        lastValue = value
    
        if scenetree.DynamicLights then
          setAllLightsEnabled(scenetree.DynamicLights, value )
        end
    end
    
    M.onUpdate = onUpdate
    
    return M

    Is it possible to link a zone group to time of day so its ambientLightColor changes to R:0 G:0 B:0 A:255 at night?
     
  17. Artistterrymartin

    Artistterrymartin
    Expand Collapse

    Joined:
    May 5, 2019
    Messages:
    426
    If there was a way to turn off the underwater sound when in a water block, its possible to drive in the water. With turning off the waters settings that act on the car. Many light settings for underwater can be controlled with the fog color, depth darkening, color gradient underwater length and map colors for it. Also the clarity can be made crystal clear for no underwater distortions. Aside from the underwater reverb trying to remember if there is other sounds that would make it unfavorable. Aside from a performance hit with a waterblock.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice