Different Characters For Different Worlds ( Tutorial)

Discussion in 'Buildbox General Discussion' started by volcank, Jan 13, 2017.

  1. volcank

    volcank Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    794
    Likes Received:
    391
    Hi everyone,

    I just wanted to share something I found out as a new Boxer so wanted to share. I always wanted to do this but couldn't figure it out how.

    So here is what we want to do. We have a bunch of characters and when we select them we want a different world with different themes for each character. Changing the order of the character in different worlds does not mean it will start with that character.

    So let's say you have a bird character as a second character.

    1-You create a navigation button to navigate to the level with a bird icon.

    2-Even The Bird icon is on the 3rd or 4th row of character it doesn't matter. Just create a character icon inside character properties.

    3-import the same bird icon inside bird character images.

    4-At the main menu create a single character unlock menu and set it to bird.

    4-Put Bird unlock icon and Bird Level start navigtaion button on top of each other so when you touch the bird icon it selects the character and also starts with that particular level.

    5-If you are having hard time putting images on top of each other just put one at the back and make it smaller so it is hidden so when you touch you still touch both of them.

    6-Also make sure you turn off the "block touch through" on both icons so when you touch you touch both.

    7-So this way we can make a game with different characters with different worlds. Maybe many of you know this but still wanted to share how it is done! Hope it is useful.
     
    ahmed, usman911, ClientUser and 9 others like this.
  2. MichKrane

    MichKrane Boxer

    Joined:
    Sep 19, 2016
    Messages:
    43
    Likes Received:
    49
    Nice one.
    Buildbox is all about tricks and twists, and learning how to use them can prove really useful in so many levels! Since I have seen this question a lot around here, let me also add my method for having a specific world/sets of worlds for a specific character. My method works for the MULTIPLE character unlock as well (please forgive me if someone else has discovered that first).

    Ok, here we go. I will explain it simply and only for two characters, but the same concept could be applied to as many characters as you like.

    So this is the basic structure of the game
    basicstructurecharacter-worldbound.png
    Now click on your first character, go on the "default animation" and move the image (or your image sequence) to an xyz distance. I moved it up by 80, nothing special about that, could be any number and any direction really.
    character1-80-up.png
    After that, click on your character's "collision shape" and fix it, because otherwise that previous move could have some bad consequences.
    collisionshapefix.png
    Then click on your second character and also move his animation and collision shape, but to a DIFFERENT direction than the other one
    char2-80lower.png
    Now go to the "character detector" world
    chardetectorselect.png
    Now, on this world, you only want to mess with the start scene. (for this tutorial).
    Now comes the tricky part. Place your character anywhere in the start scene. (any of your characters)
    For this example, we will use character 1.
    Now place a menu jump Exactly right on your character. Name the menu jump "character1", so you won't be confused later, especially if you have many characters.
    char1menujump.png
    Now, WITHOUT changing the character's position in the world, simply change the character from the "characters'" panel on the left
    charmenujumpchange.png
    You will immediately notice that the second character appears at a different position than the first one, despite the fact that they are both set in the same position (same x and y values for the world)
    This happens because we previously moved each character's position in their default animation by 80 in opposite directions. (so now they are virtually 160 pixels away)
    Now just create another menu jump like you did with the first character, but this time name it after your second character
    char2menujump.png
    And there you have it! Each character will hit a different menu jump every time you access the "character detector world", which you can direct to the worlds you want. The only thing you need to do now is go to each character's worlds and modify the character's starting position to the desired one. (basically you will need to neutralize the changes you did in the character's default animation)

    Oh and also turn "character's opacity" down to zero in the "character detector" world after you're done. That way, the screen will just be black for a split of a second. In iOS devices and most android devices it won't be noticeable at all, but sometimes some android devices may give you the feeling that it takes somewhat longer to access the world (not that much, but maybe noticeable). That is easily fixed/masked with any closing animation for the main menu and/or some "fading in" opening animation (maybe a black picture that takes the whole screen and becomes invisible in 15 frames) at the world's UI.

    I hope that was useful, if you have any further questions let me know!

    *EDIT*
    Please read my next post, there are details I left out here (my fault, sorry) that maybe will affect your game if you use THIS particular method. My next post explains a bit better what you could do to have the best result, depending on your game.
    Thank you
     
    Last edited: Jan 14, 2017
    Oeuvre, volcank, drew and 3 others like this.
  3. tanvir8955

    tanvir8955 Avid Boxer

    Joined:
    Apr 26, 2016
    Messages:
    140
    Likes Received:
    76
    @MichKrane Wow Man! Really awesome solution never thought of this!
     
    Shamrock likes this.
  4. andre_sprs

    andre_sprs Serious Boxer

    Joined:
    Sep 30, 2015
    Messages:
    844
    Likes Received:
    403
    Great Tutorial. I was wondering if this was possible
     
    volcank likes this.
  5. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,807
    Likes Received:
    2,309
    I would do this normally like @volcank. Which I think is a very clean solution to the problem.

    @MichKrane: how does a character 80 or whatever pixels away from the center point affect rotation properties? Or jump or bounce or others? Has it any impact at all? Because if there is no impact then it would be an awesome solution to use different characters for what the player thinks is the 'same world' but in reality it navigates to a different one with different behaviors. Cool out of the box thinking.
     
    MichKrane likes this.
  6. MichKrane

    MichKrane Boxer

    Joined:
    Sep 19, 2016
    Messages:
    43
    Likes Received:
    49
    Well, to be honest, I HAVE used this kind of method in one of my games, but NOT EXACTLY THIS ONE, meaning that in my game I didn't move the character's image from the middle (0,0). What I did was rotate each character at 3 degrees(0,3,6,9 etc...) and placed the menu jump right at the edge(forming something like a circle of menu jumps). Then I went to each world and "neutralized" each character's rotation by setting the opposite rotation.

    So I guess I am not totally sure if there are any side effects that can't be fixed. I checked a few minutes ago, and I think that as far as the jump, rotation and bounce it looks good. Mostly because those use the character's collision shape rather than its position. So when it comes to any physics effect it's gonna be fine (I think)

    HOWEVER, there is at least one problem I hadn't thought of earlier, which are the objects that have a "wake up" component set to a certain distance. Now the solution would be as simple as adjusting all of their distance values, since you know which world each character will be directed to. It could get tricky though, and it really depends on the complexity of the object setup (for example it may be moving around on a path before you even get close enough to activate it, which requires timing) and the direction of the game.

    Also you will have to adjust your frame because it also acts according to your 0.0 position.

    If you have a complex game with a lot of wake up objects, I would suggest NOT moving the character from the center of the default animation at all. There are plenty of ways to make this thing work. But it mainly depends on the kind of game you have and your characters.

    For example, if your characters have already different collision shapes, then the only thing you have to do is set the character scale to something big (in the world- detector) so that the differences are more apparent and then you can carefully place each menu jump where only one character's collision shape would interact.

    If your characters' collision shapes are the same, then you could use other methods like rotating the character's default animation and the collision shape a bit differently for each character and again work your way with the menu jumps in the "character-detector" world, and set the rotation for the character in the start scene of each world at the opposite value. Rotating the image of the character inside the default animation panel could cause some serious quality decrease (pixellation) , so I would suggest importing an already rotated image of each character. (Which would take more time, but will save you from having bad quality issues)

    You could also play with each character's scale. Like stretch the character in any way on both axis,(in the default animation panel and don't forget to adjust the collision shape) so that there is at least one spot for each character which can't be reached by the others. Then you can place your menu jumps. And then go to each world and correct the scale for each character.

    I can't really check for quality decrease with the last method, since all of my characters in my games are either square or completely minimal, in which case I see NO quality drop resulting from the deformation. However, you could import an already deformed picture for each character to prevent that from happening.

    OR, if you don't want to do that, and your game allows it, you can either use an action (duration>1000) which will replace the animation of your character, or set your character's opacity to zero, import an image of your character as an object, set it as a decoration and link the two together.

    That's ALL I can think for now, thanks for the questions christoph, keep them coming. I really do enjoy discovering things in Buildbox!
     
    Last edited: Jan 14, 2017
    Christoph likes this.
  7. playsgames6666

    playsgames6666 Miniboss Boxer

    Joined:
    Nov 13, 2015
    Messages:
    1,168
    Likes Received:
    745
    Wow some of these ideas are cool.
    But @volcank method is the easiest way to do it, and really the only way you should do it.
    You are all doing to much work for a simple process. you don't need to do so much, your over thinking.
     
    Christoph and MichKrane like this.
  8. MichKrane

    MichKrane Boxer

    Joined:
    Sep 19, 2016
    Messages:
    43
    Likes Received:
    49
    Thanks for the feedback and I agree to a certain extend...
    I guess it is the easiest and cleanest way, but there are games where people are forced to change their desired design in order to make things work. And even though I would always pick functionality over design, it's good to let people know that it is possible, even if it requires a bit more work to achieve. The result is all that matters. Also this could solve a few more issues, add some more possibilities. I needed to use this a couple of times (due to the nature of my game), and it took me some time to figure out. So I guessed it would be nice to share with the community!
    I don't know if I am overthinking about this, but for sure at this point you need to think a bit more to discover something new. But this is what I like about buildbox!
     
    Jaro, Christoph and playsgames6666 like this.
  9. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,807
    Likes Received:
    2,309
    I definitely can think of some situations this can be used and having the multiple character selector is great and can be for the player a cleaner solution depending on the game. Thanks for sharing your findings. :)
     
  10. volcank

    volcank Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    794
    Likes Received:
    391
    Thank You! Me Too! :) hehe
     
  11. volcank

    volcank Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    794
    Likes Received:
    391
    Thank you for sharing your techniques I will definetly try your way also!
     
  12. sharma.shivam

    sharma.shivam Avid Boxer

    Joined:
    Oct 23, 2016
    Messages:
    180
    Likes Received:
    10
    great tutorial
     
  13. karnak

    karnak Boxer

    Joined:
    Aug 12, 2017
    Messages:
    10
    Likes Received:
    0
    Does anybody maybe have sample project, because I really can not get this setup? :(
     
  14. Nephilim

    Nephilim Boxer

    Joined:
    Apr 19, 2017
    Messages:
    2
    Likes Received:
    0
    Hey,
    I know this is an old thread and what i'm asking is not very much relevant but i'm making this airplane shooter game and I needed to know if there was a way that the bullet firing from the plane ( Object attached to the plane and spawned on shooting ) and transform from 1 bullet to 2 and then 3 when a certain power up is taken in the game.

    Does anyone know how this can be achieved? Any logic piece that can be used? @Christoph
     
  15. karnak

    karnak Boxer

    Joined:
    Aug 12, 2017
    Messages:
    10
    Likes Received:
    0
    @volcank do you maybe have any example project of this trick?
     
  16. VectologyGames

    VectologyGames Serious Boxer

    Joined:
    Oct 5, 2015
    Messages:
    529
    Likes Received:
    473
    ooooor you can just place the single character select button under your start button.... :)
     
    Benfont likes this.
  17. volcank

    volcank Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    794
    Likes Received:
    391
    @karnak Hi Like @VectologyGames said very simple.

    Make a separate World and World Game Uı for that world.

    Ok your main title is the place you select your world but in that UI add the character's icons instead of saying world 1 or world 2. Direct that Navigation button to the world's Main UI where you will have your start game, share buttons etc everything. And in that UI, just beneath the start button replace your characters single unlock button there so when the player clicks the start button he will play that world with that character selected. So for each character you will need to have seperate Main Menu Us since there will be different character buttons underneath each start button. Hope I didn't make it complicated :)

    Check the game by Ketchapp called Around the world. try to watch it a couple of times.

     
  18. ibrahim1711

    ibrahim1711 Boxer

    Joined:
    Oct 15, 2017
    Messages:
    9
    Likes Received:
    1
    So, what is the best way now to have MULTIPLE character unlock, with a different world for each character? i tried @MichKrane way but it kind of annoying if I want to add character later. I do not want to use single unlock :(
     
  19. ClientUser

    ClientUser Boxer

    Joined:
    Jan 1, 2018
    Messages:
    4
    Likes Received:
    3
    Just followed this setup... but my problem is if i click on a chracter which is still locked it refers me to the Main Menu of the locked character but with character 1 which is already unlocked. Can someone help me ?
     
    volcank likes this.
  20. volcank

    volcank Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    794
    Likes Received:
    391
    Yes the thing is don't lock the characters they should be free to use and unlocked already! Lock the levels and unlock them with coins etc. and when the person unlocks and touches the level icon in the next scene he will play with that character as well. But make the level icon like the character icon so it will look as if the player unlocked the character but in result he/she will actually unlock the level.
     
    Jaro and ClientUser like this.

Share This Page