GTA 3 Liberty City [Removed]

Discussion in 'Terrains, Levels, Maps' started by swift502, Jun 14, 2019.

  1. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Roughly each city block can be merged (or cut) into one mesh, with LOD's for each. If you do it on a per-building basis, you could essentially re-use buildings (which will reduce draw-calls city-wide if it's used more than once, and shown in the same LOD phase as others - different levels of LOD's won't batch together like identical ones will). This will however be less-optimal to create a direct port or a city that does NOT repeat stuff. I try not to repeat too much in mine, but make use of like-model-like-LOD batching where I can.
    Roads/streets/terrain. Honestly, it may be best to keep this in large (several blocks by several blocks) chunks because it's mostly the same texture here. You want to have as much connected concrete and asphalt as possible.
    It's possible to copy and paste UV data in most modeling software, do this for roofs and other buildings where-possible (common doors, roofs, if used more than once in a model, it will batch VS be a new draw call).
    Draw calls are best kept light, obviously, so if you have 'empty space' (inside buildings, under the map etc) not visible to the player, you can connect various parts of the building UV's (invisibly to the player) in the void-space inside the building with an extra poly-surface or two (or five). When the CPU does a draw call, in that time, the GPU can render THOUSANDS if not TENS OF THOUSANDS (or more!) triangles (everything is made of triangles, they're usually half or less of a four-or-more-sided surface unless it's a triangular surface). It doesn't matter if the draw call is to render 10,000 connected faces of concrete, or ONE connected face. It's still pulling the same amount of the budget. While you don't want too much copy-paste going on to where it's evident to the player, it can very well help draw calls. I use the void-space connected surfaces trick in some of my objects to save draw calls here or there (such as connecting window overlays, or connecting the brick walls elevator 'house' at the top of the building to the rest of the building's brick).
    Telephone poles, mail boxes, power wires, street striping and road/sidewalk textures can all be bulk-rendered like I mentioned.
    Mosaics can be useful on small objects where lower-resolution textures won't detract from immersion (small objects, mailboxes, interiors, garage doors & overhead housing for automatic garage doors, LOD's - even tree stumps can be mosaic. I even used a screenshot of my model in the editor as an LOD in more than one instance (this can really save you!) - that saved ten or even DOZENS of draw calls per-object when you have lots of complicated stuff. Do not overlook the usefulness of LOD mosaic textures, they will solve most of the performance issues related to draw calls in your map. Low enough resolution will enable you to not use too much more VRAM (Video card RAM), but keep an eye on your usage. Too much on the textures and you will lose folks due to high VRAM requirements. Going over 4gb (not likely here on an old game port!) would alienate lots of users. Mosaic textures only help if you connect all the UV's it uses (or at-least almost all of them). If you take in one thing today - know that disconnected UV faces and faces using a different texture both generate a new draw calls. You likely won't have normal / specular map textures in a game this old (as GTA3, not BeamNG!), but those also call additional draw calls when invoked.
    Strip textures off furthest LOD's. You may wish to assign a single texture to the model before deleting the UV's from the lowest LOD. This is very drastic and is last-case resort ONLY, but for smaller objects that you still want visible, or land-mark buildings across the map, this can work.
    Usually a billboard texture (works for buildings, props like poles and trees, but NOT for roads/sidewalks!) will drop the render to about one draw call per building. This is where it can be handy to have buildings separate from one another. Billboard props don't look good from very high or low angles, but they really can save you.
    Use BB_Autobillboard_50 will invoke an object's game-engine produced (at run-time / map-load) billboard sprite when it fills 50 pixels or less on the screen. this is an empty class.
    Null rendering will make the object disappear at the set amount. Use Nulldetail12 to cause the game engine not to render this at 12 pixels of screen fill. For this and the above, set the numbers as desired, but it's useful for immersion not to go higher. The higher the number, the closer it is. Obviously a huge skyscraper at a block away might fill more than a tiny 1000 sq/ft house up close will. Highest detail levels get set around 600~800 or so for single-family or twin homes. Use ECA or Italy objects as your guide.
    For collision objects, avoid narrow long faces such as curbs, stairs, eves of roofs and so-forth. These will eat the car. Signs are a big culprit, too. For curb-faces, extend them down through the road level, sloping them a bit as curb-faces normally are in the process (obviously, not changing the visible model, but the collision model). While my curbing is normal height (6~8 inches) in the map, the collision for them extends down another foot or two, without breaking at the road surface, to enable wider triangles on it for proper collision, otherwise touching the curbing eats the tires/rips the car apart. This is also a very good reason to make stairs into ramps, and removing any unneeded vertices / face splits from your model. Use the collision debug in the BeamNG game to view how objects are broken up. This is especially useful if the floor / ground eats the car near pillars, poles, or anything else that breaks up a large surface. Triangulate collision meshes that prove problematic manually before finishing your object for the best result.
    Baking textures is something you could try, but with that comes extreme increase in space used on the user's drive, user's RAM and VRAM (models are stored in video ram too, to my best knowledge). You will have to test this out. This is exacerbated when lots of models share textures - it gets repeated in each model then. Weigh draw call impacts with baked model texture weight (in MB/GB size) and see what works best for you, for someone with an old computer, and for someone with a new computer. You can make a city that still runs 60FPS or close on a 3ghz first-generation i7 without too much trouble, if you don't exceed draw call limits or video RAM.

    I hope some of this is helpful!
     
    • Like Like x 2
    • Informative Informative x 1
  2. swift502

    swift502
    Expand Collapse

    Joined:
    Oct 30, 2018
    Messages:
    103
    Wow that's a lot of text.
    Sure, thanks a lot, but I believe I'm familiar with most of these things already.

    I could spend a year on optimizing the map, but then I wouldn't be able to release it for a year.
    I really want to release it, considering I'm getting stable 60 fps, and way less cpu and gpu utilization than I do when playing Italy, then gather the lowest reported fps and go from there.

    Btw "disconnected UV faces generate a new draw call". That's interesting to hear. Are you sure that's the way it works? I was pretty sure it doesn't matter how your UVs look. Textures get mapped in the fragment shader, where they don't really care what the UV looks like, so I don't see why you couldn't batch materials with disconnected UVs into a single draw call.
     
    #62 swift502, Jul 5, 2019
    Last edited: Jul 5, 2019
  3. falefee

    falefee
    Expand Collapse

    Joined:
    Mar 15, 2014
    Messages:
    403
    Gotta love Bob. It's GTA 3, so it's gonna be really easy to run. Nice port, I still wanna mess with GTA 5 :p
     
    • Agree Agree x 1
  4. STICH666

    STICH666
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    216
    This is going to be amazing. I can't wait!
     
  5. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Yes, unless there's some new engine optimizations I am not aware of (doubtful, but could happen), that is how it works with DirectX. Disconnected UV faces will certainly generate a new draw call if they're not a duplicate (exactly) of another face on the same model. Multiple identical faces will batch. Multiple identical faces across different levels of LOD's shown will not batch however, they will only batch with the same LOD level.
    The proof is in the pudding on my city map. Each time I connect more faces on existing models, the fps goes up a little until I hit the GPU saturation limit (where it's not CPU bottle-necked). Took months of figuring stuff out and trial and error, so I wished to save you some.
    @falefee Surely GTA3 is easy to run from a video card standpoint, however, there's lots of optimizations you don't get just ripping the models out. I don't want him to have the same issues you did when you have 10,000+ draw calls on your port of Burnout and it went 10FPS. I could port any old game and if it has thousands of disconnected faces it's going to lose FPS from what it could be. GTA 3 also didn't have super-snazzy physics to compute on the same processor as draw calls were run on. Just some AI stuff and very very simple arcade-class physics of vehicles & only the player vehicle / vehicles interacting with the player.

    Regardless, you only have to optimize if a moderately powerful system (say a 2600k @ 3.5~4ghz with a GTX 970 4gb video card and 8gb of 1600mhz ram) cannot run the map at 55~60fps. If you're fine until then, I wouldn't worry too much.

    You'll have to use directional way-points to make this map's AI. That will be best. Those get scripted into map.json after placement outside of the editor.
     
    • Like Like x 2
  6. falefee

    falefee
    Expand Collapse

    Joined:
    Mar 15, 2014
    Messages:
    403
    Definitely. I finally got LODs on all my models and they aren't tweaked well but I'm already able to hit 60. The new mesh optimizations really push that too, seems like it'll get better from here. Still gotta sort out AI on my map, but ports are really fun to make once you get to that good spot :D
     
    • Agree Agree x 4
  7. swift502

    swift502
    Expand Collapse

    Joined:
    Oct 30, 2018
    Messages:
    103


    Sorry for the teasing. This is hopefully the last update video before Beta release.
    Still left to do:
    • Little more optimization. There's an unfortunate area around the COCKS stadium, where the game's currently rendering 2,000,000+ triangles, because of the current LOD segmentation. I want to keep the triangle count below 500,000 at all times.
    • Water
    • Remaining small texture and object glitches
    Bus routes and traffic AI can probably wait until out-of-Beta release. I could also use some help with that.
     
    #67 swift502, Jul 7, 2019
    Last edited: Jul 8, 2019
    • Like Like x 6
  8. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Send your problematic model over (and most of it's textures, so I don't bugger them up), if you can't get that down reasonably.
    Consider stripping the concrete and grass 'texture' off and using flat-shaded polys, that can help. That being said, while 2 million is a lot of triangles, it really genuinely isn't an issue except for integrated graphics - a D-GPU (Nvidia or AMD) of any modern iteration shouldn't have much of an issue with it. You should be able to have it render 1/100th~1/1000th of those triangles and still look golden, however. So I do agree, 2 million triangles is quite a bit high - but not impossible - but yes high for an LOD for sure.
    If all else fails, put a domed white roof over it (while still being able to enter it from ground level)!
     
    #68 bob.blunderton, Jul 8, 2019
    Last edited: Jul 8, 2019
    • Agree Agree x 2
  9. swift502

    swift502
    Expand Collapse

    Joined:
    Oct 30, 2018
    Messages:
    103
    Thanks for the offer.
    Over ~2,3 million is where I get fps drops with my GTX 1060. So getting it down to around 500 000 seems a reasonable start to me. (Then Beta test it to see if people have issues) Again I think it has to do with the fact that there's overall 5300+ materials, which brings the performance down.

    Domed white roof... in Liberty City... what? :D
     
  10. Confused_Deer43

    Confused_Deer43
    Expand Collapse

    Joined:
    Jun 8, 2013
    Messages:
    400
    This is awesome! the gta 3 liberty city is super nostalgic for me, so it'll be nice to see it from a totally new perspective too, can't wait!
     
    • Agree Agree x 4
  11. BeamCarHomeTrade

    BeamCarHomeTrade
    Expand Collapse

    Joined:
    Sep 30, 2017
    Messages:
    808
    Please tell me that it will include Francis Intl.

    reee can't wait honestly
     
    • Like Like x 1
    • Informative Informative x 1
  12. JeffTesta

    JeffTesta
    Expand Collapse

    Joined:
    Dec 6, 2017
    Messages:
    75
    So ready to travel back to 2001. We need a Manana, Sentinal, Blista, and so on now :)
     
    • Like Like x 2
    • Agree Agree x 1
  13. BeamCarHomeTrade

    BeamCarHomeTrade
    Expand Collapse

    Joined:
    Sep 30, 2017
    Messages:
    808
    Very Nice! not bad for an 18 year old model! except that Ryanair Landing...
     
    • Like Like x 2
  14. BeamCarHomeTrade

    BeamCarHomeTrade
    Expand Collapse

    Joined:
    Sep 30, 2017
    Messages:
    808
     
    • Like Like x 5
    • Informative Informative x 1
  15. henryjhost

    henryjhost
    Expand Collapse

    Joined:
    Jan 1, 2018
    Messages:
    1,058
    Is that scaled correctly? If so that's awesome!
     
  16. BeamCarHomeTrade

    BeamCarHomeTrade
    Expand Collapse

    Joined:
    Sep 30, 2017
    Messages:
    808
    it is,and it was a miracle when it run 8 fps! typical RAGE engine polyflow!
     
    • Like Like x 1
  17. loba04

    loba04
    Expand Collapse

    Joined:
    Jan 1, 2018
    Messages:
    373
    but mainly a blue kuruma, speeding away from an exploded bridge with 2 despicable people in it
     
    • Like Like x 3
  18. swift502

    swift502
    Expand Collapse

    Joined:
    Oct 30, 2018
    Messages:
    103
    Released Beta!
    Enjoy!

    Btw is there any way to put a link on an image? I wanted a nice download button, but the forum forcibly wraps the BBCode image in an <a> link that points to that image.

    Code:
    [URL='https://www.google.com/'][IMG]https://i.imgur.com/dCOC94x.png[/IMG][/URL]
    Results in:



    which links to the image, and not Google. Any way to correct this? Thanks.
     
    • Like Like x 4
  19. crashmaster

    crashmaster
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,811
    Wow this is amazing stuff.
    Ive started to port the gta vice city map a long time ago. i gave up because one island was enough to make beamng crash.
    I dont wanna bug you with this, but are you planning on porting another map?
    it would be awesome getting help with vice city. im still stuck getting the damn collisions to work without crashing the game..
    i dont think id be able to make it as nice as this map tho. but i could give you what ive got started.

    Anyways.
    This is great work. thank you a lot for this map. such nostalgia.
    Cant wait to get home and try this map.
     
    • Like Like x 3
  20. Projekt535

    Projekt535
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    189
    This is an awesome trip down nostalgia lane hahaha. It has the potential for a great base though, hopefully you or someone with map making skills can recreate it with Beam assets and have a more updated feel in the future. For now I'm enjoying it a lot, thank you!
     
    • Like Like x 1
  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