Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Games Midnight Streets - Racing Game

Discussion in 'Works In Progress' started by Stephen_O, Nov 10, 2019.

  1. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,140
    This week's major goal was to create a traffic pooling system to reduce cpu usage by not processing cars that are out of player range.

    result = success;

     
    Peter77 and cs747 like this.
  2. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    704
    The game is coming along nicely, and glad your now at around 100 FPS, at least now you have some CPU headroom to work with. I remember you saying a while back that you couldnt wait to get to the point your at, so you can work on environment. :)
     
    Stephen_O likes this.
  3. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,140
    Getting the pooling in place allows me to scale up the environment size without scaling up the amount of active vehicle being processes. This also allows me the to start building races. It puts my project in a really good place.

    I'm a little bummed out right now because I just bought a car pack for $80 on the store for the game, to use for player and ai racers, but the geometry on the cars is very poor and has gaps all over the place, I'm not a 3d artist so fixing it would require paying someone or me spending a lot of time working through the models to fix issues, it's basically unusable unless I want to accept that. I don't have a big budget right now so I have to wait until it's hopefully resolved, which I doubt the publisher will fix all the models in the pack since it's a few years old.. I'm not even sure how models like that are allowed to be sold on the store. I might take a break for a while, this really frustrated me.
     
  4. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    704
    I can understand the frustration... been there. Take a break for a few, it really helps. Now as far as the cars, you have alot of options. You can buy a pack of cars (like you have), or you can buy say 3-4 different models, and mod them visually so you have like 8 cars.

    Know how ya feel when ya buy something and it doesnt pan out.
    Either way, its only time right?. Take a break, we will see you soon :)
     
    Stephen_O likes this.
  5. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    191
    Sorry to hear about the car pack. Is there any chance automated tools e.g. in blender might be able to fill the gaps? Maybe post a screenshot of the kind of gap you are talking about?
     
    Stephen_O likes this.
  6. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,140
    Thanks guys, just want to take some time to refresh before I jump back in. I don't like working while upset or not thinking clearly..

    I attached a few shots of the prefabs, every one of them I looked at has geo issues where you can see through seams, some have larger gaps, the cheap mobile cars I'm using for traffic look way better. Tinting the windows also tints the tail lights, who would want that.. these were not game ready and would take a lot of work to meet my expectations and usage needs. I'm sure I could fix with enough time and patience, but main goal is to make the game, not buy sub-par models, try to fix them and to make them work, then use for my game.

    it just sucks when you get blindsided and think you're buying something well made only to find out it's not. There were no close up images of the cars I bought, I guess that should be the tell sign that something might not be right. The pack did not show interiors close up either, so the quality level there was extremely shocking once I opened the pack and took a look. I think my new rule is no sketchfab preview or close up shots, don't buy.

    I've found some pro quality models to use instead, ironically they are cheaper too, have 3 LODs, and all emission objects professionally setup and ready to use, go figure..

    NewCar.png
     

    Attached Files:

  7. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    704
    Nice bro! Glad you found some "useable" cars. The quality of your assets determines the quality of your game. Know you will set em up nicely :)
     
    Stephen_O likes this.
  8. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    4,774
    I noticed in this video all street-lamps seem to be missing. Perhaps it's another reason why this build runs faster and it's not entirely based of the traffic optimizations?

    Do you also spawn cars behind the player?
     
    Stephen_O likes this.
  9. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    191
    I agree best to concentrate on making the game than fixing broken assets. That said, they might still be useful as "background" in a garage or street racing scene. If you did want to try and fix them up then you could try out scripting some mesh tweaks:

    1) very small expansion of window material vertices from object centre
    2) average the position of all car body vertices within a small radius

    Obviously, no idea how effective these would be.

    Another quick suggestion which maybe you have done already (or have a better approach). You could consider implementing hue shift in a custom fragment shader. This would be a way to get lots of different coloured cars with the same material and hence GPU instancing if you can use this. A mask texture can be used to selectively apply or even to allow several different hue shifts. Just a thought.
     
    Stephen_O likes this.
  10. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,140
    Exactly, these new models I found are a dream. Still need to get more from the publisher, but at least I found the quality I need.
     
    warthos3399 likes this.
  11. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,140
    I was wondering if anyone would catch the missing lights.. I disable them while working since they get in the way, forgot to turn them back on for video.

    With street lights on I'm at 85 fps for starting area, compared to the 100 fps from the video. It's still about an 80% improvement with pooling enabled, so I'll likely do a bit more optimization soon to get back to 100 with them on.

    I do spawn behind the player, was thinking about adding rules. One would be to check direction of spawn point, if behind player and player is over a speed threshold they would only spawn in forward, left, right directions.

    I'm also thinking about adding some trigger areas to adjust traffic density and spawn zone sizes based on player location.

    In the end I predict the pooling rules will change dynamically and often depending on player location and what player is doing.
     
    Peter77 likes this.
  12. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,140
    As background cars they might be ok without camera close ups.

    The traffic cars are designed for mobile and highly optimized, use a single material with texture atlas, GPU Instancing enabled, there's 18 models using a single material. I duplicated the prefabs, material and texture, then adjust the atlas body colors to get more variety. This give me 56 different car prefabs using 3 materials.

    I'll look into the hue shift on shader idea, sounds like it could be useful, thanks for the suggestion.

    Player and AI racer cars will all be higher detailed models, not part of an atlas, or any special shader optimizations; at least initially. Once everything's in place I can determine if and what optimizations those assets will need.
     
    jamespaterson likes this.
  13. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,140
    This week I was sick and juggled multiple projects, I started a new project collaborating with an artist friend. For Midnight Streets, I worked on various systems including a music player, engine sound system, first car model, avatar driver, audio and graphics options menus.

     
    joyater, Antypodish and Peter77 like this.
  14. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    704
    Good to see ya "back in the saddle" :)
     
    Stephen_O likes this.
unityunity