Search Unity

[RELEASED] 2D+3D Infinite Runner Engine - new v1.6 : Downhill!

Discussion in 'Assets and Asset Store' started by reuno, Dec 31, 2015.

  1. neapolitanstudios

    neapolitanstudios

    Joined:
    Feb 17, 2011
    Posts:
    75
    Hi Reuno,

    I'm trying to create an infinite jumper (like doodle jump). The vertical example is most similar to a doodle jump style game; however there are a few issues I am having with it:

    I need the camera to move with the player. I can't seem to do that properly as the the recycle/death bounds in the level manager are fixed to the location in the world. Is there a way to have these move with the camera? I've tried parenting the level manager to the camera, but with no luck.

    Do you think this toolkit will work for a doodlejump style game? Or is it limited to infinite runners that stay fairly stationary.

    Thanks!
     
  2. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Pretty sure Doodle Jump is a stationary camera too - it just scrolls objects down every time you land on one. You might try setting to level speed to 0 and then using an event or similar to move all objects down by a fixed distance each time you land on them.
     
    reuno likes this.
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @neapolitanstudios > Boom_Shaka's answer above is correct. And yes, you can absolutely use spawners to build a doodle jump like game.
     
  4. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    @reuno Hi, was wondering if you have any tips for extending the Spawner to handle spawning SECTIONS of a level instead of individual platforms? For example some infinite runners (like jetpack joyride I think?) have pre-designed sections made up of many platforms/obstacles that are then spawned one after another, instead of just spawning one platform at a time. All your Demos and documentation only showcase spawning individual platforms randomly, but I'm pretty sure it's possible to extend your Spawner class to handle my use case.

    One of the things I'm unsure of is each spawned object needs a box collider on it to detect when they should be recycled when they hit the recycle bounds. However I obviously wouldn't want that. I possibly could change it to a trigger but might involve further code changes? Haven't had time to dig that far. Was just wondering if you had any other advice for such a use case. Thanks and hope my question was clear enough.
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @spvn > No need to extend anything, that's already doable. That's what the SkyTheory demo does, for example.
     
  6. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    @reuno sorry I missed out that demo. I've managed to get it working. However I have another question, does the engine not work with Tilemap + Composite colliders? When I setup my ground as a tilemap, the character goes through the walls of the tilemap. It's able to land on the ground perfectly fine, but if it gets pushed into a wall it will go through the wall, and get pushed out at the other end. I've drawn a red arrow to show the path the character gets pushed along.

    upload_2021-6-21_16-21-19.png

    This doesn't happen if I use a custom platform with a Box Collider 2D... Not sure if I'm doing something wrong.

    EDIT: In fact after reading deeper into the code, I'm confused how collisions with the platforms are working at all as I noticed
    Transform.Translate()
    is being used to move platforms, which if I'm not wrong ignores collisions?

    EDIT 2: Think I figured it out. I think "Geometry Type" on the Composite Collider 2D needs to be switched to "Polygons" instead of "Outlines". Will need to do more testing to see if this completely solves the problem. Still not sure how collisions are working when Transform.Translate() is being used though... I thought that function would ignore physics collisions...
     

    Attached Files:

    Last edited: Jun 21, 2021
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @spvn > Yes, the engine will "work" with tilemaps. What's important to understand is that it's completely unrelated. The engine is responsible for spawning things. It can be anything, prefabs of individual platforms, entire chunks of levels, tilemaps, audio sources, it doesn't matter. What you do with what gets spawned is then up to you :)
     
  8. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    Yes I understand that. My point was that tilemap + composite colliders DON'T work properly with the way the platforms are moved (i.e. with Transform.Translate()). The character gets pushed INTO the colliders, which doesn't happen with box colliders. It seems like changing the Composite collider setting to "Polygons" instead of "Outlines" makes it work properly, though I have no idea why it doesn't work with "Outlines". Also in general I'm surprised collisions with platforms (with Box Collider 2D) are working at all because I thought Transform.Translate() will ignore collisions...

    EDIT: After further testing I've found that using "Polygon" mode doesn't fully solve the problem. The character still gets pushed INSIDE the Tilemap/Composite collider at high speeds, even with "Continuous" detection mode. For some reason, only Box Collider 2D works reliably.

    upload_2021-6-22_14-1-17.png

    EDIT 2: I take back whatever I said about this only affecting tilemap colliders. This problem happens with box collider 2D as well. This pic is taken from the demo JellyForest at slightly high speeds (but within the range of the default settings that came with the original demo).

    upload_2021-6-22_14-10-48.png

    The problem here is slightly less pronounced due to the slightly larger character box collider compared to my own example... but I'm surprised nobody pointed out this issue before.
     

    Attached Files:

    Last edited: Jun 22, 2021
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @spvn > Again, the engine only spawns things. That's what it does. What you do with them afterwards is up to you. You can absolutely spawn tilemaps as long as your controller works with them. There's no demo of that in the engine, mostly because tilemap performance is terrible so not something I'd encourage people to put in an infinite runner, but technically it's doable. And you can translate them, that's not an issue. You'll just need a controller that fits with your design.

    As for your last point, the controller in the jelly forest demo is just a super simple example of a base jumper controller. You can of course improve on it for your own game (or use your own). If you're worried about collisions, you could work with more aggressive physics settings, or add extra raycasts to prevent overlaps for example.
     
  10. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Hi @reuno ,

    Hope you are well. Another great engine, thank you. I'm expanding on the scenario manager to work for me, how do i trigger an event without having it pop on the screen ? Currently each event/ game object suddenly turns on, and rather smoothly pooling objects off screen and then sliding into the frame. Please let me know if more information is needed to clarify.



    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using MoreMountains.Tools;
    4. using UnityEngine.UI;
    5.  
    6. namespace MoreMountains.InfiniteRunnerEngine
    7. {
    8.     public class ExampleScenario : ScenarioManager
    9.     {
    10.  
    11.         public DistanceSpawner MushroomSpawner;
    12.         public DistanceSpawner HillsSpawner;
    13.         protected override void Scenario()
    14.         {
    15.             //AddTimeEvent("00:00:01:000",()=> TestMethod("this event will occur after one second"));
    16.             //AddTimeEvent("00:00:05:000",()=> TestMethod("this event will occur after five seconds "));
    17.             //AddTimeEvent("00:00:10:000",()=> TestMethod("this event will occur after ten seconds"));
    18.  
    19.             AddScoreEvent(100f,() => SwitchToMushroomSpawner());
    20.             AddScoreEvent(500f,() => SwitchToHillsSpawner());
    21.             AddScoreEvent(700f,() => SwitchToMushroomSpawner());
    22.         }
    23.         protected virtual void SwitchToMushroomSpawner()
    24.         {
    25.             MushroomSpawner.gameObject.SetActive(true);
    26.             HillsSpawner.gameObject.SetActive(false);
    27.         }
    28.  
    29.         protected virtual void SwitchToHillsSpawner()
    30.         {
    31.             MushroomSpawner.gameObject.SetActive(false);
    32.             HillsSpawner.gameObject.SetActive(true);
    33.         }
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Aprn > I'm not sure what you mean by "pop on screen". An event is a data structure used to communicate between classes, it doesn't "turn on", and doesn't appear on screen, you'll have to be more specific. And as I've asked you multiple times now, please use the support form for support questions, thanks.
     
    TheAPGames likes this.
  12. gaeoh

    gaeoh

    Joined:
    Sep 23, 2021
    Posts:
    2
    What is the preferred method of extending / editing the singleton managers? Is it for example possible to override for instance the LevelManager and make the rest of the code get the instance from my child class? Or should I use a different approach?

    Many thanks for a great asset!
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
  14. gaeoh

    gaeoh

    Joined:
    Sep 23, 2021
    Posts:
    2
    reuno likes this.
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @gaeoh > You're right, I've fixed it, thanks for spotting this typo!
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    Good news everyone, there's a new version of the Infinite Runner Engine available on the store.
    v1.9 updates MMTools and MMFeedbacks to their latest versions, ensures compatibility with Unity's latest API changes and releases, and adds options to the GUIManager to bind heart prefabs directly, instead of loading them from resources. I hope you'll like this new version!
     
  17. GoToTop

    GoToTop

    Joined:
    Sep 22, 2020
    Posts:
    4
    It is a pity that there are no tutorials that show the creation of Demos step by step.
    Can you write an algorithm of actions to create a LaneRunner (3D) from scratch? Only actions, without explanation
    I'm trying to do something similar, but it doesn't work and I don't understand what step the error is in
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @GoToTop > "write an algorithm of actions"? What exactly do you mean by that? Have you tried comparing your scene with the demos? They're super simple scenes, with only a handful of components, you can probably just find your error by looking at the reference, if you're trying to achieve the same result?
     
  19. GoToTop

    GoToTop

    Joined:
    Sep 22, 2020
    Posts:
    4
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
  21. GoToTop

    GoToTop

    Joined:
    Sep 22, 2020
    Posts:
    4
    SpikeSpawners respawn Spikes :)
    I am asking what creates Clones and respawns platforms (ground and sides - ParallaxGround, SkyLeft, SkyRight)
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @GoToTop > Oh my bad, you mentioned pools so I thought you meant the spikes, as there are no pooled platforms in that demo (as opposed to, for example, the minimal demo scene or the one in the tutorial you mentioned).
    The SkyLeft, SkyRight and ParallaxGround use their Parallax component to move infinitely.
     
  23. GoToTop

    GoToTop

    Joined:
    Sep 22, 2020
    Posts:
    4
    Thank you! I understood, it works, although as it turned out, this is not what I need in the future xD
    I think LinkedSpawner is more suitable for me if it works with 3D
     
  24. Fufurata1234

    Fufurata1234

    Joined:
    Jun 6, 2009
    Posts:
    47
    Hi,
    Can you make player TURN in this plugin? How about curved platforms? Or curved paths in top-down runners?
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Fufurata1234 > The engine focuses on the spawning mechanics, what you decide to spawn is up to you. There's nothing preventing you from spawning curved objects if you'd like. There are no examples of any of the features you mention in the demos, if that was your question. You can see a full list of features, as well as a list of all the demos on the asset's website.
     
  26. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    I asked for this type of feature a long time ago. I don't think this is the Infinite Runner Kit you want if you want TUrns, unfortunately.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    Turns have only received a handful of requests, they're super low in the votes compared to most other features. If you're into turns, don't hesitate to use the support form to request them, the more people do, the sooner they'll make it into a release.