Endless Runner Sample Game Q&A

This is the official thread for discussion, issues and Q&A for the Endless Runner Sample Game (Trash Dash)

Please use this thread if you have any questions, issues or feedback on this project.

This is a project we have released on the Asset Store

We also have a user guide in the Instructions of the project, as well as on our Learn Site

We have also released this full game on the Google Play & App Store with all the proceeds of the game going to Game Changer charity.

2 Likes

Thanks for this project, it will help many game developers to improve their skills on Unity

Thanks for the project. I’ve only had a quick look, but the way some of the assets work confuses me. There’s a red bin and a blue bin which share the same material and texture with no colour information. What is this voodoo?

Thanks for sharing this project, very interesting to see how a game like this is made.
One question though, if I change the name of the asset bundle (Cat) from Trash Cat to anything else, the game loads but without the cat and throws and tells the object I want to instantiate is null. Where is the reference in the code for the name Trash Cat and how can I avoid this?

Lots of objects in the project use vertex color (painted in the 3D software like maya/3ds/blender) to cut down on textures size (and because they all started as using only vertex color and some had textures added later when there was a need for more details).

If you find the mesh (e.g. search for WheelyBinBody) you can see on the preview at the bottom the inspector that the mesh have uv and colors information per vertex.

The shader (CurvedCode.cginc) then multiply the vertex color by the texture color (which is greyscale) allowing for varaition in tint across the mesh.

To keep thing relatively simple, the game use the character name as the key saved in the save file to know which character is owned & used (to be more robust we could build some kind of unique ID system per character so you can change the name and retain the character, but that is left as an exercise to the reader :p)

When the game create a savefile, it grant ownership of Trash Cat by default. So the game will try to instantiate the character called Trash Cat and will fail if it don’t find it.

To modify that, look for the PlayerData.cs script, and for the function NewSave() in that script. You will see there that we add to the character list Trash Cat (and to the theme list Day). You can change that to the name of your new character here so it work.

Note: after modifying the script, you will need to Clear the save file (either through the Trash Dash Debug menu in the editor or in game, in the settings popup with the Delete Data button) so that the game regenerate a new one with the proper character added to the player save.

4 Likes

Thank you for the reply!
That was easy enough, interesting to see how you handled that part of the game.

Also, I’m trying to find how the pickups are being distributed on the track, but I can’t seem to find where that’s being done in the code?

If you look in TrackManager.cs, there is a function called SpawnCoinAndPowerup() that take care of spawning the ā€œcoinsā€ (here the fishbones), premium currency and powerup. It will pick a purcentage of chance that a powerup will be spawn instead of a ā€œcoinā€ (that purcentage grow with time, so that after a while we are sure to spawn one).

Can I ask how long it took you to make this project and how many people were involved?

For the time it took, it is a bit hard to tell precisly because it was made in parallel with other thing, But I would reckon that combined, it was roughly 6 month of works from start of the project to release on store.

As for the team, ā€œfull timeā€ : one producer, one artist & one programmer.

We had an animator who worked a couple of week for the animations and a contractor for sounds/music.

Finally some ā€œexternalā€ QA (i.e. not done by the full time team :smile:) was done at the end of the project before submitting on the stores by an additional person.

1 Like

Thanks Guillaume, this type of information is always useful to me.

Thanks for the project.I want to change cat character.Can you help me ?

how add character?

Thankssssss brother :heart:

Very interesting project. I want to change my runner on its basis. There are ишп differences in it: several characters in the scene at the same time + they can move to the right and left, that is, the track has not 3 positions but rather a large area on which the characters can move. Where can I start the changes? Where can I change the parameters of the track? Characters are probably changing in PlayerData.cs?

Is it possible to add a different track segment with a different curved rotation (given the current global shader)? Can you get the feeling you are changing direction like in the minion rush?

Hi,
Can I use the music used in this project on my own project? Do I encounter a copyright issue?
Best regards…

Hi Guys i am converting this game in WebGl but when i play it on local server xampp the character is not loading
please help me
i need your help urgently

Hi. I have question regarding lighning used in Trash Dash. How it is implimented ? Even when I turn off directional light the game is lighted properly. So far as I saw, there is also no baked lightmaps. Can You tell me how it is implemented. I would also use proper mobile friendly lightning in my own endless runer, which also use pooling. Thank you for any answers. (Althought this thread seems inactive for long time :frowning: )

Everything in the project appears to be using the shader Unlit/CurverUnlit - I don’t think there’s any actual light being computed, the assets themselves were just created with bright-looking textures.

I really enjoy exploring Trash Dash and I am learning a lot from it concerning the game structure and the track generation and such. Thanks a lot for providing such example projects!
Also I find the curved shader very intersting. I am not very familiar with shaders (yet). I noticed that the curve is only intergrated in unlit shaders as far as I can see. Is it possible to apply the curve on shaders with lighting and / or combined with a Post Processing Profile e.g. Bloom, Depth of field etc.? And how? I fumbled a bit with putting ā€œ#include ā€œCurvedCode.cgincā€ā€ into a lit shader, but I get an error message like:
Shader error in ā€˜Standard_gs’: redefinition of ā€˜_MainTex’ at Assets/Shaders/CurvedCode.cginc(21) (on metal)

I don’t really have a clue. Could you please point me into the right direction? Thank you!