Search Unity

SpriteMan 3D Support Thread!

Discussion in 'Assets and Asset Store' started by glowe, Oct 23, 2015.

?

How important is having access to full source code?

Poll closed Apr 10, 2016.
  1. It's a must for me.

    1 vote(s)
    33.3%
  2. It would be nice.

    1 vote(s)
    33.3%
  3. I get along fine without it.

    1 vote(s)
    33.3%
  4. I'm indifferent.

    0 vote(s)
    0.0%
  1. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    And, (finally) starting a video tutorial series:
    I'll be linking them to better places once I complete the series.

    WOOHOO!

    Saturday: was very productive. 5 videos so far, and I've barely scratched the surface of this
    asset. (30 mins of quality tuts)
    Sunday: even more productive. 10 videos made, and I still haven't finished getting through all the features. (over 2 more hours of how-tos)
    Monday: 3 more videos. Finally DONE! (playtime 1 hour)

    I think I've covered all the features!

    I ended up with about 4 hours of SpriteMan 3D tutorials!

    Check out the entire playlist!

     
    Last edited: Apr 30, 2019
    KiddUniverse and HeadClot88 like this.
  2. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
  3. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    @Zebbi - spriteman doesn't handle multiple elevations. It only does one level of 360 degree roundabout view of sprite characters.

    It's not the first time I got this request. But it's mainly a matter of keeping the product features simple and intuitive as its complexity grows.

    I'm a little stuck on how I would show this feature in the tool options. It'll take some thought.
     
    Last edited: Apr 30, 2019
  4. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    As a suggestion, how many other projections would be required? As you say, at the moment you can do 16 fractions on the yaw axis, my request would cover the pitch axis of which you could have 16 fractions. I'm not sure a roll axis would be necessary, since sprites are only emulating 3d-space items with 2d, I can't quite imagine how a roll axis projection would be useful (feel free to correct me!)

    I would imagine it could be toggle-able to either use yaw or pitch (unless you wanted both simultaneously for some seriously over-engineered projectiles that have different viewing angles as it goes past you as well as above or below you!)
     
  5. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    Ok, I'm working on supporting multiple elevations. It's a pretty major change. So, I'm also overhauling the rest of the asset to make even more things configurable that aren't right now. Like, you'll be able to create any amount of directions you want. And that'll be configurable for each elevation. It'll all be a new set of controls and I'll be deprecating the old set. Of course, with fully custom capabilities, the Editor windows need to be overhauled too, to allow that. Lots to do...
     
    HeadClot88 likes this.
  6. jKessinger

    jKessinger

    Joined:
    Jan 21, 2016
    Posts:
    8
    I'd also like to see if there's any solution to the issue @lbonnage posted.
     
  7. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    The best solution I found for clipping is twofold:
    1. make the character's collider slightly bigger, like you're saying
    2. set sprite pivots to center instead of bottom of sprite
    These are mainly compromises dealing with sprites in 3d environments. Ex: centered pivots will change how rotating perspectives look. But I haven't found better solutions.
     
  8. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Sounds awesome, can't wait to try it!
     
  9. Navarth

    Navarth

    Joined:
    Dec 17, 2017
    Posts:
    21
    @glowe I've been looking into the issue of sprites clipping into geometry, but they're all pretty daunting for a beginner to implement. Maybe you'll have better luck?

    My topic on reddit here sums up the solutions I've found so far.
    There's also the closest thing to an explanation of the process here.

    See also this Gamasutra article for doing the same thing for a 2D game.
    And a blog post from the Starmancer team about similar issues.

    I'd happily buy any number of plugins if they could spare me from having to write custom shaders and projection matrices to avoid sprites clipping into walls behind them without sacrificing the ability for walls in front to still occlude them.

    As an aside: If I can get Spriteman working for my particular setup (4-directional NW/NE/SW/SE with all E flipped from W) I'd be ecstatic, which it sounds like is something coming in the next version. Awesome!
     
    Last edited: May 19, 2019
  10. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    Hi, yeah, sorry I can't help too much with the clipping issue. I took a look at the various resources you posted. I understand most of the things people are talking about. The matrix thing is making my head spin. It's nice to see people documented so well all the various types of sprite issues I've noticed in the past years.

    I'm currently revamping the spriteman asset. One main feature I'm adding is allowing different elevations, full 360 degree rotation, above and below. It kinda works, but I've been stuck on a few difficult angles.

    And I also got really sick this week. I'm finally feeling better.

    Anyway, I already have the fully customizable angle ranges working just fine. So, I can probably wrap up what I have so far and get it released. It sounds like it'll give you some of the features you're looking for. The 360 elevation thing will still be a bit wonky, but I'll just have to keep working on that as I have time.
     
  11. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Hope you're feeling better, and thanks so much for all the effort, I can't wait to try the vertical elevations!
     
  12. kastrateus

    kastrateus

    Joined:
    Jun 1, 2019
    Posts:
    1
    Helloo, love the plug-in. Is there any way to prevent the sprites that aren't the player's from changing as you approach them from an angle? I believe it is because the direction for each Sprite is chosen based on the forward vector of the camera, even if the camera is not directly pointed at the Sprite. In a third-person point of view this can cause the sprites to change direction even when they logically should not based on their transform's rotation. This effect causes a bit of confusion as to where my character'' are facing, is there any way to fix jt.?

    Thanks
     
  13. ncho

    ncho

    Joined:
    Feb 1, 2014
    Posts:
    99
    Just chiming in to say that I'll buy this once multiple elevation angles are possible!
     
  14. ncho

    ncho

    Joined:
    Feb 1, 2014
    Posts:
    99
    Went ahead and bought it anyway - works flawlessly so far so once elevation angles are in it'll be pretty awesome.

    I also wonder if one other thing is possible - for multi frame animations of a specific angle, instead of dragging in every animation frame one by one, could it maybe accept a folder with sequentially named files instead? Or automatically load in all other frames after the first? Otherwise with 8-16 Way mode that's a lot of time spent individually dragging frames into boxes...

    Another good option would be to be able to lock billboarding to specific axises only. (Edit - regarding this I just found billboardV in Billboarder.cs but setting it to false doesn't seem to do anything...)
     
    Last edited: Jun 14, 2019
  15. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    Did you remember to uncheck billboarding on the Sprite Manager component?
     
  16. ncho

    ncho

    Joined:
    Feb 1, 2014
    Posts:
    99
    Hmm, doing that has an effect, but just not the desired one. What I'd like is for billboarding to continue to happen around the vertical axis but prevent the horizontal warping you get when you stand close to a sprite and look up/down as it then billboards according to the perspective. What I mean by that is this effect: https://imgur.com/a/B2qdLYo

    But if I turn off the billboarding option and set billboardingV to true I get this now, which corrects the horizontal billboarding distortion up close but messes up everything on the other axis: https://imgur.com/a/o2KHzeZ

    Any clue how to correctly implement this?
     
  17. mufabil45

    mufabil45

    Joined:
    Jun 6, 2017
    Posts:
    1
    @glowe hello, I'm currently making 2D top down game. Your assets help me lot in animating sprite.

    My question is, is there's a way to change sprite cardinal direction from script?

    Here what I mean

    Code (CSharp):
    1. SpriteManager SM;
    2.  
    3. if(Input.GetKey(KeyCode.S){
    4. SM.//change the direction to south
    5. }
    I've read the documentation but I'm really confused, thx in advance.
     
    Last edited: Jun 25, 2019
  18. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    When’s the eta for multiple elevations? Can’t wait to try sprite elevators!
     
  19. ncho

    ncho

    Joined:
    Feb 1, 2014
    Posts:
    99
    Just wondering if this is still being developed?
     
  20. Gisstrio

    Gisstrio

    Joined:
    Apr 5, 2018
    Posts:
    4
    Hello,
    There's something I've been wondering I could achieve with this system. You see, my game plan is to have 4-Way facing sprites, but the sprites will always be at a 3/4 angle view, kinda like this:

    While I can rig it up to fit the system's natural 4-Way mode, it obviously wasn't made for this view in mind, thus, playing feels kinda awkward with this setup.

    I just wanted to inquire about whether it's possible to, say, modify the Cardinal Direction in the full source code to match these kind of sprites better and if it is, how I'd go about doing it.

    Thanks in advance!
     
  21. KiddUniverse

    KiddUniverse

    Joined:
    Oct 13, 2016
    Posts:
    115
    hey, the cardinal directions are entirely customizable as the source code is included. i think what you're looking to do is entirely possible.
     
  22. tripwynn

    tripwynn

    Joined:
    May 22, 2019
    Posts:
    1
    Hello! Noob question! Srry:) My Spriteman demos all have reversed up and down controls. Is there a way to alter this within the character? TY! and Srry if this is a dumb question.

    ***Edit*** More specifics. Characters control perfectly when imported into new project.

    when I import Spriteman into existing project using MoreMountains "TopDownEngine"
    the controlls are inversed. Is it the INPUT thats causing this?

    I will keep poking at it. ty for anyone with suggestions:)

    **Edit again**
    I'm Stupid. I created an additional input in Project Settings, inverted it and reassigned it in the character controller. That fixed it. Srry!:D
     
    Last edited: Sep 6, 2019
  23. Gisstrio

    Gisstrio

    Joined:
    Apr 5, 2018
    Posts:
    4
    Hi,
    Apologies in advance if I'm being pushy or unreasonable, but I've been fiddling around with the Cardinal Directions to try and achieve my desired effect as explained above, and with the front facing sprites, it's easy enough to set the directions at East and West respectively, but I have no idea how to handle North and South. It still makes a very jarring effect when I make the character move up or down as they awkwardly just suddenly change their direction to fit that one angle without bearing whether they're facing East or West in mind.
    The thing is, with the script's simple 0, 90, 180, 170, 360 degree system in mind, I have no idea if I can fix this issue I'm having without reworking the PersonPlayerController script from the ground up or cutting the upwards facing sprites entirely.

    Either that, or there's a really obvious solution to my problem that I'm dumbly overlooking.

    Thanks again for all the help anyhow! I appreciate it a lot as a bit of an amateur, once again, sorry if what I'm asking is unreasonable.
     
  24. KiddUniverse

    KiddUniverse

    Joined:
    Oct 13, 2016
    Posts:
    115
    go into your directioninventory script and find these lines
    Code (CSharp):
    1.     FourDirections = new List<AngleRange>
    2.             {
    3.                 new AngleRange(CardinalDirection.N, 315f, 360f),
    4.                 new AngleRange(CardinalDirection.N, 0f, 45f),
    5.                 new AngleRange(CardinalDirection.E, 45f, 135f),
    6.                 new AngleRange(CardinalDirection.S, 135f, 225f),
    7.                 new AngleRange(CardinalDirection.W, 225f, 315f)
    8.             };
    you're going to have to play around with these values until you get what you're looking for. keep a back up in case you don't like your desired result and have to start from scratch.

    your other option is to use 8 or 16 way and redundantly assign your sprites.

    glowe should be able to help you better than I can as he is the asset dev, but he hasn't been around in the last couple weeks. he usually pops in and out, but you could probably find his email address if you search around. he's usually pretty good about helping out.

    edit:

    you can try these values, and this should help you out a little bit to visualize how to assign your sprites.

    Code (CSharp):
    1.  FourDirections = new List<AngleRange>
    2.             {
    3.                 new AngleRange(CardinalDirection.N, 10f, 80f),
    4.                 new AngleRange(CardinalDirection.E, 80f, 190f),
    5.                 new AngleRange(CardinalDirection.S, 190f, 280f),
    6.                 new AngleRange(CardinalDirection.W, 280f, 360f),
    7.                 new AngleRange(CardinalDirection.W, 0f, 10f)
    8.             };
    so north would be sprites that are facing to the right and away from the camera, east would be facing towards the camera and to the right, south would be facing toward the camera and to the left, and west would be facing away from the camera and to the left. you're likely going to have to adjust these values slightly.

    notice that your western direction is broken down into two separate angle ranges, this is probably to prevent some kind of error, i'm not certain, and i didn't delve into why he did it this why, i just kept it consistent with how he scripted it previously, just adjusted to fit your needs. it may be that unity doesn't recognize when a range resets at 0, either way just that in mind when you're adjusting your values.

    the reason i set it this way is so that if you're holding up on a joystick, it won't stutter between left and right. either way if you hit the angle where it differentiates between which sprite it should render it's going to stutter no matter what just by design, but at least with it offset slightly to the left or right it's likely to occur much less.


    also, keep in mind that the player controlller that comes packaged with the asset is super bare bones and you're going to to most likely change nearly everything in it as make your game.
     

    Attached Files:

    Last edited: Sep 6, 2019
  25. Gisstrio

    Gisstrio

    Joined:
    Apr 5, 2018
    Posts:
    4
    Thank you so much!

    I decided to put in your suggested values, and as you said, there's still a bit of awkward stutter when turning North and South but eh, doesn't seem like that's something I can help, but regardless, this setup still works way better for my game plan then the default one.
    Maybe I'll play around with the settings and fix the Player Controller when I get better at scripting.

    Seriously, that helps me out a lot, I can't thank you enough for your guidance through all this!
     
    KiddUniverse likes this.
  26. KiddUniverse

    KiddUniverse

    Joined:
    Oct 13, 2016
    Posts:
    115
    if you're seeing too large of a stutter still there's a couple options you have. first you can define the pivot point of sprites upon import, so mess around with that and see what looks best for you, and also make sure when importing your sprites that they're aligned correctly. even one pixel off will show pretty dramatically.
     
  27. HandlebarOrionX

    HandlebarOrionX

    Joined:
    Jun 18, 2018
    Posts:
    5
    This looks like this is really what I needed
     
  28. MAXFORCE

    MAXFORCE

    Joined:
    Mar 4, 2014
    Posts:
    51
    How to customize sprite? How make sprite 3d with adding ability to hide and unhide weapons?
     
  29. HandlebarOrionX

    HandlebarOrionX

    Joined:
    Jun 18, 2018
    Posts:
    5
    Whenever I check the "Use Camera Movement" box, my player just stands in place and can only walk in place. Not actually going anywhere just using her walk animation in the cardinal direction she's facing if I push my left stick anywhere. But if I don't tick that box, she can move freely, but not relative to camera view. Meaning if I pivot my camera to the left of her, right is up and left is down. If I pivot my camera behind her, down is up and vise versa.

    Can you please tell me how to fix this?
     
  30. HandlebarOrionX

    HandlebarOrionX

    Joined:
    Jun 18, 2018
    Posts:
    5
    Now I have a new problem!

    So I still have the issue where if I check "Use Camera Movement" the player will just get stuck. Pushing W A S or D or pushing my left stick anywhere will just make the player walk in place facing south. But even using the Vector3 relativeMovement = Camera.main.transform.TransformVector(movement); variable will also make her stick in place.

    Can anybody help me fix this so that my player can move freely in all cardinal directions and move relative to the camera's view? Like in Shining Force III or even Grim Dragons?
     
  31. HandlebarOrionX

    HandlebarOrionX

    Joined:
    Jun 18, 2018
    Posts:
    5
    This is what I'm talking about
    https://twitter.com/QuestOfRaziya/status/1241320565266399232

    It should work especially since there is code to make movement relative to camera when I tick "Use Camera Movement!" But it just isn't working
    Code (CSharp):
    1.  
    2.         void HandleMove()
    3.         {
    4.             if (canMove)
    5.             {
    6.                 var speed = walkSpeed;
    7.  
    8.                 // detect input movement
    9.                 var moveHorizontal = Input.GetAxis("Horizontal");
    10.                 var moveVertical = Input.GetAxis("Vertical");
    11.                 IsMoving = moveHorizontal != 0 || moveVertical != 0;
    12.  
    13.                 IsRunning = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
    14.                 if (IsRunning)
    15.                 {
    16.                     speed = runSpeed;
    17.                 }
    18.  
    19.                 // rotate the character
    20.                 var movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
    21.  
    22.                 // forward is always direction of camera forward along x/z plane
    23.                 if (useCameraMovement)
    24.                 {
    25.                     var camForward = Camera.main.transform.forward;
    26.                     var camDir = new Vector3(camForward.x, 0.0f, camForward.z);
    27.  
    28.                     var angle = Mathf.Sign(camDir.x) * Vector3.Angle(camDir.normalized, Vector3.forward);
    29.                     var quat = Quaternion.Euler(0f, angle, 0f) * movement;
    30.  
    31.                     movement = quat;
    32.                 }
    33.  
    34.                 // rotate the character
    35.                 var rot = movement * (speed / 10);
    36.  
    37.                 if (attackTimer <= 0 && movement != Vector3.zero)
    38.                 {
    39.                     var newRotation = Quaternion.LookRotation(rot);
    40.                     rb.rotation = Quaternion.RotateTowards(transform.rotation, newRotation, 360f);
    41.                 }
    42.  
    43.                 // move the character
    44.                 if (IsMoving && offset.y != 0f)
    45.                 {
    46.                     movement.y = offset.normalized.y * movement.magnitude;
    47.                 }
    48.                 movement *= (speed / 10f);
    49.  
    50.                 var characterMovement = transform.position + movement;
    51.                 if (attackTimer <= 0 || !IsGrounded)
    52.                 {
    53.                     rb.MovePosition(characterMovement);
    54.                 }
    55.             }
    56.         }
     
  32. KiddUniverse

    KiddUniverse

    Joined:
    Oct 13, 2016
    Posts:
    115
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. namespace SpriteMan3D
    4. {
    5.     /// <summary>
    6.     /// A simple Input controller for detecting player actions.
    7.     /// </summary>
    8.     [RequireComponent(typeof(Rigidbody))]
    9.     [RequireComponent(typeof(Collider))]
    10.     public class PersonPlayerController : PersonController
    11.     {
    12.    
    13.         public float walkSpeed = 2f;
    14.                
    15.         public float groundDistanceOffset = 0.2f;
    16.    
    17.         public Collider attackCollider;
    18.    
    19.         public static bool canMove = true;
    20.        
    21.         private Rigidbody rb;
    22.  
    23.         private float distToGround;
    24.  
    25.         private Collider charCollider;
    26.  
    27.      
    28.        
    29.         void Start()
    30.         {
    31.             rb = transform.GetComponent<Rigidbody>();
    32.      
    33.             charCollider = GetComponent<Collider>();
    34.            
    35.             distToGround = charCollider.bounds.extents.y;
    36.         }
    37.  
    38.  
    39.         void Update()
    40.         {
    41.             IsGrounded = Physics.Raycast(transform.position, -Vector3.up, distToGround + groundDistanceOffset);
    42.    
    43.         }
    44.  
    45.         void FixedUpdate()
    46.         {
    47.             HandleMove();
    48.         }
    49.  
    50.  
    51.         void HandleMove()
    52.         {
    53.             if (canMove)
    54.  
    55.             {
    56.                 var speed = walkSpeed;
    57.  
    58.                 var moveHorizontal = Input.GetAxis("Horizontal");
    59.                 var moveVertical = Input.GetAxis("Vertical");
    60.                 IsMoving = moveHorizontal != 0 || moveVertical != 0;
    61.  
    62.                        
    63.  
    64.                 Vector3 movement = Input.GetAxis("Vertical") * Camera.main.transform.forward + Input.GetAxis("Horizontal") * Camera.main.transform.right;
    65.  
    66.                 movement.y = 0f;
    67.                      
    68.                 Vector3 rot = movement * (speed / 10);
    69.  
    70.                 if (movement != Vector3.zero)
    71.  
    72.                 {
    73.  
    74.                     var newRotation = Quaternion.LookRotation(rot);
    75.                     transform.rotation = Quaternion.RotateTowards(transform.rotation, newRotation, 10f);
    76.  
    77.                 }
    78.  
    79.                      
    80.                 movement *= (speed / 10);
    81.  
    82.                 Vector3 characterMovement = transform.position + movement;
    83.  
    84.            
    85.                     rb.MovePosition(characterMovement);
    86.                
    87.  
    88.             }
    89.         }
    90.  
    91.    }
    92.  
    93. }
    94.  
    bare bones, not written by me, old version of player controller packed with spriteman from like four years ago. stripped down to basic movement functionality. i'm not the dev.
     
  33. HandlebarOrionX

    HandlebarOrionX

    Joined:
    Jun 18, 2018
    Posts:
    5
    I FINALLY FIXED IT!

    All I had to do was just make a new scene and magically the script is working as it should have
     
  34. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Shame Spriteman died before we got a chance to see vertical multi-angle sprites :'(
     
  35. george_bacanu

    george_bacanu

    Joined:
    Oct 24, 2017
    Posts:
    16
    Hi, does the developer still provide support? Does anyone have any idea? I saw that he didn't answer for a long time on the forum.