Search Unity

Should i use DOTS for rendering a lot of sprites?

Discussion in 'Graphics for ECS' started by justtime, May 19, 2020.

  1. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    Hi there! I'am trying to make picross/nonogram game and i faced with lack of performance in generating textures for display saved user games. On the image below you can see one field with black area. It's cells, selected by user. Average crossword can be 50*50 size. So if you do it with sprites every game will be 2500+lines+frame image. I am using single sprites for lines but for saved cell make textures. And for many crossword it takes a lot of time and generate a lot of garbage. What is the proper way to do this and this kind of grids at all? Should i use dots?
    Thanks.
     
    Last edited: May 19, 2020
  2. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
  3. Ahlundra

    Ahlundra

    Joined:
    Apr 13, 2017
    Posts:
    47
    you're displaying a single tile for every dot to make up the image of these save files?

    why dont you just create an image file and paint it pixel by pixel then save the image along with the save file? you can do thar through code

    you would just need to load the image and display it on the loading screen, no need for milions of sprites. Unless that's not an option for some reason?
     
  4. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    I'am doing colored parts in the way, you described. Also with jobs system in performs 2 times faster. But it still takes some time. And if user has a lot of saves, which not cached yet, he will have to wait. Or another idea do this job "on the fly",i.e. when save becomes visible (lazy loading).
    What would you do for grid (lines)?
     
  5. Ahlundra

    Ahlundra

    Joined:
    Apr 13, 2017
    Posts:
    47
    you mean the little borders dividing the image into squares?

    If I had to keep the number of dots for each square and add those borders without changing them, I would calculate how many lines/columns I need and add that number of pixels to the final image size, then I would simple fill the lines while making the image