How to : Dynamic Player Name and Number in a sport game ?

Hi,

I’m currently working on a sport game using UE4 and blueprints.
I would like to have the name and number of the player added to the jersey material.
So far I have not found a way to do it so if anymone can give me any direction that would be gold.

Idealy, I would like to have a character editor menu similar to what you can find in UE4 games like Supercross the game or MXGP.

Cheers guys !

Still searching for a way to do this. Any help would be appreciated. Thanks

Make flipbook texture with all digits.
Then make material that display given number. Make this with texture scaling and shifting it.
First make for single digit, then combine 3 such sections into one 3 digit string.
Names would be bit complicated to do this way.

When you have material that displays numbers, use again UV scalling and shifting to place that number material in right spot.

This all can be done with just materials.

However for that right look of number (various sizes depends on digit etc), you should consider just making name with number and storing that as texture per player.

And yes in text based shaders i could just copy paste code after googling some.

1 Like

Ok i have some time, i will try to make such material for you in some stages (just like i am creating it), hard to get to last stage without creating simple versions:

This is simplest material that can potentially create what you need.
You need texture with numbers 0 to 9, in 4x4 grid yes not all slots will be used.
I googled such texture, and i am not sure if its copyright free, so you get only material.

Now working on second step: material that will display number from that texture using only 0…9 integet (combine x and y inputs)

1 Like

Now second material calculates Position X and Position Y from number you give it:

And now hard part for me: creating proper 4x4 flipbook texture with numbers :smiley:

1 Like

Little next step:

I created two textures:

This should be inverted, but that can be fixed with “one-minus” node:

This is mask to cut out unecessary digits

As result you should get single digit in upper left corner of material.

1 Like

Now move all inside material function:

And I messed up something :wink:

Will post more if i find bug tomorrow.

1 Like

Hi Nawrot,

Amazing, thanks a lot for your time I really appreciate.
I kept searching for the best solution and one guy on a discord channel told me without any more precisions that he did it using a render target with 2 text layers and saving the result as new material.
He told me that it also allows using different font etc.

I’m yet not sure how to set this up and need to learn more about render targets.
But I will for sure try your solution too.

Yes render target would work,
However my solution is not finished (done half way trough)
I could not modify UV coordiates for digits to properly display, there is some error in cvalculations.
And i cannot find where.

This also can have different fonts, you just need to make textures.
However for digits and alpha, they will be quite big if you want any decent looks.

This can work for displaying logo, emblems etc, where you have to display single picture out of 16 :smiley:

Yeah I saw you were not finished but it still gives me a good starting point to learn from, thanks for that.

Hello Nawrot, I am member of one editing team who is working at one new Football Game. I need to add dynamic fonts(numbers,names) for each player that I will import from my data table. I saw your answers above, that’s why I am asking you, your progress was good but unfinished!! Could you help me??
Best Regards
Xaris

Look into UI Material Lab, example from marketplace. There are great functions that may solve all problems.

Oh and there are DEBUG functions in material editor now, some display numbers (I think i seen numbers there, not 100% sure)