PLEASE increase sequence file pixel constraints

Post your suggestions here
Post Reply
Jakob Hubbard
Posts: 1152
Joined: Fri Nov 24, 2017 3:16 am
Team: Phil's
Location: Cold
Contact:

PLEASE increase sequence file pixel constraints

Post by Jakob Hubbard »

It would be really nice if sequence files weren't limited to such poor quality. According to JLV, the reason that they were limited in the first place was because people were using 4k images in a sequence file which would cause frame lag. As of right now sequence files are limited to 65,536 pixels (256x256px, 128x512, etc). It would nice if it was raised to at least something like 1,048,576 pixels (1024x1024px, 512x2048px, etc). It's really frustrating to get anything to not horrible when drawing text, even when the space I'm drawing the text to takes up majority of the UV map.

Maybe some sort of optimization where if the sequence file has more images it limits the pixels per image based on the length of the animation. So an animation that just has a 1 or 2 frames and doesn't loop can have much higher quality than an animation that has 30 frames on loop. For me I think it doesn't look horrible at 256x256 for actual animated things that move, but things that stay mostly stationary like text drawing just looks absolutely horrendous.

Anyways thanks for coming to my TED Talk
Image
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: PLEASE increase sequence file pixel constraints

Post by jlv »

It's not the number of images. It's sending a lot of data in a single frame that will cause a single frame hitch. I could probably do something like only partially update the texture on each frame but I don't want to go down that rabbit hole right now.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Jakob Hubbard
Posts: 1152
Joined: Fri Nov 24, 2017 3:16 am
Team: Phil's
Location: Cold
Contact:

Re: PLEASE increase sequence file pixel constraints

Post by Jakob Hubbard »

jlv wrote: Wed Sep 13, 2023 12:18 am It's not the number of images. It's sending a lot of data in a single frame that will cause a single frame hitch. I could probably do something like only partially update the texture on each frame but I don't want to go down that rabbit hole right now.
Gotcha, I was hoping there would be some easy optimization/fix for this (very naive of me). It feels like I'm really limited by what I can do with the scripting in terms of drawing. Triggering animations is great but I would really like to push the boundaries of race data being posted to a texture more than I currently can.

I think that increasing the pixel area that a texture can be drawn to would also increase the accuracy of pasting right? As of right now, it seems like the paste_custom_frame() function struggles with precision/accuracy a little bit. Sometimes I'll have a character 'a' and another character 'b' and the spacings between each other will be inconsistent throughout the string "abababab". Maybe that's a completely separate issue but my thought was more pixels = better pasting estimation.
Image
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: PLEASE increase sequence file pixel constraints

Post by jlv »

Jakob Hubbard wrote: Wed Sep 13, 2023 4:10 am Gotcha, I was hoping there would be some easy optimization/fix for this (very naive of me). It feels like I'm really limited by what I can do with the scripting in terms of drawing. Triggering animations is great but I would really like to push the boundaries of race data being posted to a texture more than I currently can.

I think that increasing the pixel area that a texture can be drawn to would also increase the accuracy of pasting right? As of right now, it seems like the paste_custom_frame() function struggles with precision/accuracy a little bit. Sometimes I'll have a character 'a' and another character 'b' and the spacings between each other will be inconsistent throughout the string "abababab". Maybe that's a completely separate issue but my thought was more pixels = better pasting estimation.
I was looking at the bandwidth specs for pcie and I think I'll bump it to 512*512. That'll still be pretty conservative.

The position is accurate when you paste but it is limited to resolution of the image. How are you making the font that has spacing problems? Are you making sure the font cells are all exact integer widths in the target resolution?
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Jakob Hubbard
Posts: 1152
Joined: Fri Nov 24, 2017 3:16 am
Team: Phil's
Location: Cold
Contact:

Re: PLEASE increase sequence file pixel constraints

Post by Jakob Hubbard »

jlv wrote: Thu Sep 14, 2023 1:39 am I was looking at the bandwidth specs for pcie and I think I'll bump it to 512*512. That'll still be pretty conservative.
Even this would be awesome, thanks.
jlv wrote: Thu Sep 14, 2023 1:39 am The position is accurate when you paste but it is limited to resolution of the image. How are you making the font that has spacing problems? Are you making sure the font cells are all exact integer widths in the target resolution?
The font cell coords are all integer widths, I'm using your draw_text() function and all the helper functions you used with motoball just with different font and cell coordinates. Here's my cell coords:

Code: Select all

const textFontCoords = [
    [ 0, 0, 120 ], [ 120, 0, 110 ], [ 228, 0, 108 ], [ 336, 0, 112 ], // a b c d
    [ 448, 0, 111 ], [ 559, 0, 76 ], [ 635, 0, 109 ], [ 744, 0, 108 ], // e f g h
    [ 852, 0, 56 ], [ 908, 0, 64 ], [ 972, 0, 106 ], [ 1080, 0, 46 ], // i j k l
    [ 1126, 0, 164 ], [ 1290, 0, 107 ], [ 1397, 0, 114 ], [ 1511, 0, 111 ], // m n o p
    [ 1622, 0, 112 ], [ 1734, 0, 79 ], [ 1813, 0, 98 ], [ 0, 196, 88 ], // q r s t
    [ 88, 196, 98 ], [ 186, 196, 103 ], [ 289, 196, 149 ],[ 438, 196, 103 ], // u v w x
    [ 541, 196, 101 ], [ 642, 196, 91 ], [ 740, 196, 127 ], [ 860, 196, 118 ], // y z A B
    [ 978, 196, 135 ], [ 1113, 196, 130 ], [ 1243, 196, 122 ], [ 1365, 196, 103 ], // C D E F
    [ 1469, 196, 128 ], [ 1606, 196, 130 ], [ 1730, 196, 65 ], [ 1795, 196, 110 ], // G H I J
    [ 1907, 196, 126 ], [ 0, 392, 118 ], [ 118, 392, 157 ], [ 275, 392, 135 ], // K L M N
    [ 410, 392, 140 ], [ 550, 392, 130 ], [ 680, 392, 132 ], [ 818, 392, 127 ], // O P Q R
    [ 945, 392, 110 ], [ 1057, 392, 115 ], [ 1172, 392, 119 ], [ 1291, 392, 117 ], // S T U V
    [ 1408, 392, 164 ], [ 1572, 392, 123 ], [ 1695, 392, 116 ], [ 1811, 392, 114 ], // W X Y Z
    [ 1925, 392, 61 ], [ 0, 588, 152 ], [ 152, 588, 118 ], [ 270, 588, 117 ], // ! @ # $
    [ 387, 588, 161 ], [ 548, 588, 82 ], [ 630, 588, 129 ], [ 759, 588, 80 ], // % ^ & *
    [ 839, 588, 77 ], [ 916, 588, 74 ], [ 990, 588, 80 ], [ 1070, 588, 122 ], // ( ) - =
    [ 1192, 588, 116 ], [ 1308, 588, 97 ], [ 1405, 588, 66 ], [ 1471, 588, 72 ], // + _ [ ]
    [ 1543, 588, 102 ], [ 1645, 588, 65 ], [ 1710, 588, 85 ], [ 1795, 588, 65 ], // \ | : ;
    [ 1860, 588, 100 ], [ 0, 784, 80 ], [ 80, 784, 116 ], [ 196, 784, 111 ], // " ' < >
    [ 307, 784, 90 ], [ 397, 784, 97 ], [ 494, 784, 73 ], [ 570, 784, 70 ],  // / ? , .
    [ 637, 784, 115 ], [ 752, 784, 62 ], [ 816, 784, 117 ], [ 931, 784, 88 ], // ~ ` 0 1
    [ 1019, 784, 112 ], [ 1131, 784, 112 ], [ 1246, 784, 115 ], [ 1358, 784, 113 ], // 2 3 4 5
    [ 1474, 784, 111 ], [ 1582, 784, 115 ], [ 1697, 784, 113 ], [ 1812, 784, 126 ] // 6 7 8 9
];
Here's what it looks like in game with the string "abababababa" as my last name:

Image
Image
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: PLEASE increase sequence file pixel constraints

Post by jlv »

Jakob Hubbard wrote: Thu Sep 14, 2023 10:42 am The font cell coords are all integer widths, I'm using your draw_text() function and all the helper functions you used with motoball just with different font and cell coordinates. Here's my cell coords:

Code: Select all

const textFontCoords = [
    [ 0, 0, 120 ], [ 120, 0, 110 ], [ 228, 0, 108 ], [ 336, 0, 112 ], // a b c d
    [ 448, 0, 111 ], [ 559, 0, 76 ], [ 635, 0, 109 ], [ 744, 0, 108 ], // e f g h
    [ 852, 0, 56 ], [ 908, 0, 64 ], [ 972, 0, 106 ], [ 1080, 0, 46 ], // i j k l
    [ 1126, 0, 164 ], [ 1290, 0, 107 ], [ 1397, 0, 114 ], [ 1511, 0, 111 ], // m n o p
    [ 1622, 0, 112 ], [ 1734, 0, 79 ], [ 1813, 0, 98 ], [ 0, 196, 88 ], // q r s t
    [ 88, 196, 98 ], [ 186, 196, 103 ], [ 289, 196, 149 ],[ 438, 196, 103 ], // u v w x
    [ 541, 196, 101 ], [ 642, 196, 91 ], [ 740, 196, 127 ], [ 860, 196, 118 ], // y z A B
    [ 978, 196, 135 ], [ 1113, 196, 130 ], [ 1243, 196, 122 ], [ 1365, 196, 103 ], // C D E F
    [ 1469, 196, 128 ], [ 1606, 196, 130 ], [ 1730, 196, 65 ], [ 1795, 196, 110 ], // G H I J
    [ 1907, 196, 126 ], [ 0, 392, 118 ], [ 118, 392, 157 ], [ 275, 392, 135 ], // K L M N
    [ 410, 392, 140 ], [ 550, 392, 130 ], [ 680, 392, 132 ], [ 818, 392, 127 ], // O P Q R
    [ 945, 392, 110 ], [ 1057, 392, 115 ], [ 1172, 392, 119 ], [ 1291, 392, 117 ], // S T U V
    [ 1408, 392, 164 ], [ 1572, 392, 123 ], [ 1695, 392, 116 ], [ 1811, 392, 114 ], // W X Y Z
    [ 1925, 392, 61 ], [ 0, 588, 152 ], [ 152, 588, 118 ], [ 270, 588, 117 ], // ! @ # $
    [ 387, 588, 161 ], [ 548, 588, 82 ], [ 630, 588, 129 ], [ 759, 588, 80 ], // % ^ & *
    [ 839, 588, 77 ], [ 916, 588, 74 ], [ 990, 588, 80 ], [ 1070, 588, 122 ], // ( ) - =
    [ 1192, 588, 116 ], [ 1308, 588, 97 ], [ 1405, 588, 66 ], [ 1471, 588, 72 ], // + _ [ ]
    [ 1543, 588, 102 ], [ 1645, 588, 65 ], [ 1710, 588, 85 ], [ 1795, 588, 65 ], // \ | : ;
    [ 1860, 588, 100 ], [ 0, 784, 80 ], [ 80, 784, 116 ], [ 196, 784, 111 ], // " ' < >
    [ 307, 784, 90 ], [ 397, 784, 97 ], [ 494, 784, 73 ], [ 570, 784, 70 ],  // / ? , .
    [ 637, 784, 115 ], [ 752, 784, 62 ], [ 816, 784, 117 ], [ 931, 784, 88 ], // ~ ` 0 1
    [ 1019, 784, 112 ], [ 1131, 784, 112 ], [ 1246, 784, 115 ], [ 1358, 784, 113 ], // 2 3 4 5
    [ 1474, 784, 111 ], [ 1582, 784, 115 ], [ 1697, 784, 113 ], [ 1812, 784, 126 ] // 6 7 8 9
];
Here's what it looks like in game with the string "abababababa" as my last name:

Image
They need to be integer in the target resolution. So if you're starting with a 2048 image and targeting 256, they have to be evenly divisible by 8. Otherwise the cell's edges won't land on exact pixel edges.

Did I give you the bash script I used for my fonts? It has a --gran option that does that automatically.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Jakob Hubbard
Posts: 1152
Joined: Fri Nov 24, 2017 3:16 am
Team: Phil's
Location: Cold
Contact:

Re: PLEASE increase sequence file pixel constraints

Post by Jakob Hubbard »

jlv wrote: Fri Sep 15, 2023 12:31 am They need to be integer in the target resolution. So if you're starting with a 2048 image and targeting 256, they have to be evenly divisible by 8. Otherwise the cell's edges won't land on exact pixel edges.

Did I give you the bash script I used for my fonts? It has a --gran option that does that automatically.
Ohhh I see, so if and when you raise the limit if I had a 2048 image drawing to 512 it would need to be divisible by 4. I see. You did send me the script, but I haven't tested it yet. I grabbed all those coordinates manually. So all the coordinates cells, widths, and heights need to be divisible by 8? If so I'll either have to completely redo the font or figure out the script and at that point I'm just gonna say screw it and figure out the script sometime later.
Image
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: PLEASE increase sequence file pixel constraints

Post by jlv »

Jakob Hubbard wrote: Fri Sep 15, 2023 1:20 am Ohhh I see, so if and when you raise the limit if I had a 2048 image drawing to 512 it would need to be divisible by 4. I see. You did send me the script, but I haven't tested it yet. I grabbed all those coordinates manually. So all the coordinates cells, widths, and heights need to be divisible by 8? If so I'll either have to completely redo the font or figure out the script and at that point I'm just gonna say screw it and figure out the script sometime later.
The script automatically pads the font cells to the required multiple and outputs the new font and the cell coordinates. I'd go mad saving all those coordinates by hand!
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Post Reply