Announcement

Collapse
No announcement yet.

Turn based strategy on a cube! How to properly rotate actor?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Everynone SkeetonYu Currently the goal is that once I get to the point in development where the base gameplay has a solid foundation I am going to start a devblog, social media, and get a little more involved with posting my progress. I just want to get to a point where I feel like the game is presentable before I try to generate a following. Hopefully that will come here in a month or so!
    I was making quite a bit of progress until I started working on multiplayer. It took me forever to get steam integration and online multiplayer working . I've hit my stride though and am making a lot of progress again. Ill let you guys know when I start posting progress so you guys can get a better look at what i'm making!

    Also, the fact that you guys are showing support with the smallest glimpse of my game is extremely encouraging. Thank you guys so much! ​​​​​​​

    Leave a comment:


  • replied
    Originally posted by Everynone View Post
    The idea of a cubical playfield like this really speaks to me. I've been playing Into the Breach recently and it's truly astonishing how much gameplay they managed to squeeze out of a simple 8x8 field.

    I'd like to see where you're going with this project.
    Exactly the same way I feel. Game looks very intriguing.

    Leave a comment:


  • replied
    The idea of a cubical playfield like this really speaks to me. I've been playing Into the Breach recently and it's truly astonishing how much gameplay they managed to squeeze out of a simple 8x8 field.

    I'd like to see where you're going with this project.

    Leave a comment:


  • replied
    Originally posted by Everynone View Post
    Needs more moustache.
    oh geez... you remember :O

    the game has come quite a long ways since you helped me a while back man!

    Leave a comment:


  • replied
    Needs more moustache.

    Leave a comment:


  • replied
    Eureka! https://i.gyazo.com/b5b84c866475d828...6e15d3ac23.gif

    as you can see in the GIF i got it to work! I started messing around with each of the "Make Rot from" nodes just to experiment with what happens.

    The Make Rot from Z like was used in Orkney's link (https://blueprintue.com/render/e4k6ss2e) provided really good results. With it i was able to get my unit's feet to always be on the space no matter which side of the cube it was on. At that point i knew i needed to make a Rot from Z so i started to experiment with "Make Rot from ZX" and "Make Rot from ZY".
    When experimenting with ZX I decided to get the Unit Direction Vector from the location of the character on the old space to the location of the new space. I plugged the normal of the line trace into Z and the unit direction vector into X and got my Rotation. It works perfectly!

    Here is the Blueprint for anyone else that may run into something similar later on.

    Click image for larger version

Name:	GetNewRot.png
Views:	32
Size:	172.7 KB
ID:	1468683

    Thank you Orkney and SkeetonYu for helping me with this!

    Leave a comment:


  • replied
    So I dont know if this will work...

    https://blueprintue.com/render/e4k6ss2e

    The get all actors of class node has the surface actor (the cube) , I would suggest not using that node as it fires every frame, just store a reference as a variable. I put it in the construction script here just for this demo but this function does not need to be set every frame, only when the character is moved.

    heres a video of it
    https://youtu.be/Sn9nLLxV_qg

    Leave a comment:


  • replied
    Let me finish this game onfortnite then ill do a mock up exmaple

    Leave a comment:


  • replied
    Originally posted by Orkney View Post
    When you place the character in the correct place above the surface, Fire a LineTrace towards the cube, get the hit location of the hit on the cube surface.


    use FindLookAtRotation from the centre of your character to the location supplied from the Line Trace.

    Failing that get the Hit Normal of the line trace and use that instead.

    This would not need to be hardcoded and would work on surfaces that were not 90 degree

    ok so ive got the look at rotation from the location my character would be to the hit location. its not exactly working...

    Click image for larger version  Name:	Untitled.png Views:	1 Size:	276.0 KB ID:	1468354
    im still not entirely sure what you are wanting me to do withe the normal you mentioned. i tried to figure out how i could use the rotation from the normal but never could get anytthing to work.


    the following is my current blueprint for getting the new rotation. (marker is where the character center location would be.)

    Click image for larger version  Name:	Untitled.png Views:	1 Size:	151.3 KB ID:	1468353


    I might honestly need a "explain it like i'm 5" short course from someone who understands vectors and rotations better than I do. Orkney SkeetonYu
    Last edited by beanswaggle; 04-29-2018, 02:31 AM.

    Leave a comment:


  • replied
    Originally posted by Orkney View Post
    When you place the character in the correct place above the surface, Fire a LineTrace towards the cube, get the hit location of the hit on the cube surface.


    use FindLookAtRotation from the centre of your character to the location supplied from the Line Trace.

    Failing that get the Hit Normal of the line trace and use that instead.

    This would not need to be hardcoded and would work on surfaces that were not 90 degree
    I knew it shouldn't be as difficult as I made it to be. Using this method will allow for dynamic levels.

    Leave a comment:


  • replied
    Sorry, make sure to use Normal and not Impact Normal. The Normal from the hitresult is basically the Direction the cube face is facing in. For example if your character was on top of the cube the Normal result would be 0,0,1, if on a side it could be 1,0,0.

    I am at work so I cant go into detail but I know Ramas tool can hepl you. other wise

    https://answers.unrealengine.com/que...acter-wit.html

    Leave a comment:


  • replied
    Originally posted by beanswaggle View Post



    Im not very knowledgeable when it comes to vector and rotator math. so what you are describing is kind of going over my head. How does having a direction help me determine which axis to use?


    Just thinking about it out loud, all of the spaces on a rotation axis should have the exact same rotation on at least 2 of pitch, yaw, and roll. So in reality as long as I know what the rotation for each axis is I can just preform a check to see which rotation-axis rotator the space rotator matches. It is going to be slightly hard-coded, but that shouldn't matter since I know for a fact there will only ever be 6 axes.

    At least in my head that makes sense. This might have been what you were trying to get me to try from the beginning. I am just having trouble wrapping my mind around all of this, but i am putting it together slowly.
    Well, you just need the X axis and Y axis of the square and find the direction they pointing. There's a pattern you can see with my gif. The square on the side has its X axis pointing toward the same direction as world X. But the Y axis of it is facing down. So with that information we can determine that it'll be used with XZ axis.

    I'm not on my PC but hoping this can help you in some way.

    I said Foward Vector as that gives the X direction and Right Vector as it gives the Y direction. But you probably can find that just by getting it's rotation.

    This is all a theory I haven't test anything. But using the square patterns you should be able to determined something.
    Last edited by SkeetonYu; 04-27-2018, 10:48 AM.

    Leave a comment:


  • replied
    Originally posted by Orkney View Post
    When you place the character in the correct place above the surface, Fire a LineTrace towards the cube, get the hit location of the hit on the cube surface.


    use FindLookAtRotation from the centre of your character to the location supplied from the Line Trace.

    Failing that get the Hit Normal of the line trace and use that instead.

    This would not need to be hardcoded and would work on surfaces that were not 90 degree
    what do I do with the normal I would get from the line trace?

    Leave a comment:


  • replied
    When you place the character in the correct place above the surface, Fire a LineTrace towards the cube, get the hit location of the hit on the cube surface.


    use FindLookAtRotation from the centre of your character to the location supplied from the Line Trace.

    Failing that get the Hit Normal of the line trace and use that instead.

    This would not need to be hardcoded and would work on surfaces that were not 90 degree

    Leave a comment:


  • replied


    Originally posted by SkeetonYu View Post

    I think you can if you find the rotation using forward vector and right vector. That should give you the direction of each square and use that to determine which axis to use.
    Im not very knowledgeable when it comes to vector and rotator math. so what you are describing is kind of going over my head. How does having a direction help me determine which axis to use?


    Just thinking about it out loud, all of the spaces on a rotation axis should have the exact same rotation on at least 2 of pitch, yaw, and roll. So in reality as long as I know what the rotation for each axis is I can just preform a check to see which rotation-axis rotator the space rotator matches. It is going to be slightly hard-coded, but that shouldn't matter since I know for a fact there will only ever be 6 axes.

    At least in my head that makes sense. This might have been what you were trying to get me to try from the beginning. I am just having trouble wrapping my mind around all of this, but i am putting it together slowly.
    Last edited by beanswaggle; 04-27-2018, 03:05 AM.

    Leave a comment:

Working...
X