playMaker

Author Topic: FSMs should not be interacting with each other, but they are. [SOLVED]  (Read 3042 times)

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Hi, I recently started using Playmaker, and I recently obtained two rather strange issues.
I have two FSMs on my player character: Move, and Jump. They both operate separately and have no actions changing variables or sending events from one FSM to the other.

The first problem is when I Jump, (holding nothing but the jump key), and press the move key at any point during my ascent, the Jump is cut short as if I let go of the jump key. If I am holding down the Left or Right keys, and moving as such, and then press the Jump key, Jump works perfectly normal.

The second problem has to do with my Movement FSM. I have a "wall push" state that activates when the player collides with the side of the terrain. As it happens, I calculated if a "wall push" was happening by taking the direction I was going ("Left" or "Right" State) and then then looking at my velocity. If I was actively moving right, but had a velocity of 0, then I must be pushing against a wall. If I playtest this while my "Movement" FSM is on the screen, it works perfectly. If I playtest this while looking at a different FSM, or at something else entirely, it prematurely switches to the "Wall Push" state. I am currently working here(http://hutonggames.com/playmakerforum/index.php?topic=16300.msg76138#msg76138)  to find a different way to do this, so I just want to know why it's happening. I think it has something to do with how the FSMs update, but I do not know.
« Last Edit: December 21, 2017, 12:45:50 PM by djaydino »
Inexperience is just the beginning of greatness.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: FSMs should not be interacting with each other, but they are.
« Reply #1 on: December 17, 2017, 07:58:53 AM »
Hi,
Can you show your fsm/states/actions?

There are some tutorials on the User tutorial wiki page that maybe can help (look in the 'Tutorial Series' section)

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Re: FSMs should not be interacting with each other, but they are.
« Reply #2 on: December 17, 2017, 06:41:30 PM »
Currently I cannot. Unity keeps crashing. I submitted a bug report and whatnot, but I cannot get you a picture of the FSMs right now. I apologize. In the meantime, if you could tell me if you have any theories about why the FSMs are acting the way they are, I would appreciate it. If it's too specific of a subject to theorize upon, I understand. I'll post the images here as soon as I am able.
Inexperience is just the beginning of greatness.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: FSMs should not be interacting with each other, but they are.
« Reply #3 on: December 18, 2017, 04:45:51 AM »
Hi.
Are you getting errors?
If so what error do you get?

Without this info it is hard to tell whats wrong.

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Re: FSMs should not be interacting with each other, but they are.
« Reply #4 on: December 18, 2017, 11:24:12 AM »
You mean for Unity crashing?
It had an exception code of "mono.dll caused an Access Violation (0xc0000005)
  in module mono.dll at 0033:ba76e3fc."
And the context was
"Context:
RDI:    0x09fb0fa0  RSI: 0x00000000  RAX:   0x00000001
RBX:    0x005fd708  RCX: 0x00000001  RDX:   0x00000001
RIP:    0xba76e3fc  RBP: 0x00000000  SegCs: 0x00000033
EFlags: 0x00010206  RSP: 0x005fd688  SegSs: 0x0000002b
R8:    0x056ff070  R9: 0x42fe7da8  R10:   0x00000019
R11:    0x42fe48e8  R12: 0x00000000  R13:   0x352d6aa0
R14:    0x00000000  R15: 0x00000000"

Unity support got back to me and said they have already received multiple of these reports and were working on it.
Inexperience is just the beginning of greatness.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: FSMs should not be interacting with each other, but they are.
« Reply #5 on: December 18, 2017, 05:07:58 PM »
Hi.
ah, ok.
Just wanted to know if it maybe was a playmaker issue :)

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Re: FSMs should not be interacting with each other, but they are.
« Reply #6 on: December 19, 2017, 01:41:03 PM »
Okay, so I did some quick prototyping in a temp project, and was able to recreate some of issues. I also have images now (yay). So what happens when I jump is the character pops up into the air, slows down, falls, and then eventually rest on the ground (it all takes maybe 2-3 seconds). If I press move, the upwards acceleration stops completely, and the deceleration is greatly reduced (if I jump, and start moving side-to-side at the height of my jump, the decent takes about 15 seconds. If I jump and press move almost immediately after, the character takes about 3-5 seconds to hit the floor, while barely hovering over it, never reaching the zenith of the jump, cause it was interrupted). Maybe my "setting velocity" in Run is doing it? If I change it to apply force instead, the same thing happens.
« Last Edit: December 19, 2017, 01:44:58 PM by MadboyJames »
Inexperience is just the beginning of greatness.

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Re: FSMs should not be interacting with each other, but they are.
« Reply #7 on: December 19, 2017, 01:42:07 PM »
Here's some more images of the FSMs.
Inexperience is just the beginning of greatness.

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Re: FSMs should not be interacting with each other, but they are.
« Reply #8 on: December 19, 2017, 01:42:33 PM »
And here's the last image.
Inexperience is just the beginning of greatness.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FSMs should not be interacting with each other, but they are.
« Reply #9 on: December 20, 2017, 01:47:02 AM »
Hi,

 it's likely a logical clash with the way you handle your 2d velocity. Of course they will interact with each other if both control the velocity 2d, right?

Maybe you could share this repro scene with me and I'll check it out maybe there is something else indeed.

also, in order for you to progress, I would consider making the jump and run fsm aware of the current state, so in the run maybe you should be aware that you are jumping and adjust the behavior accordingly or vice versa.


Bye,

 Jean

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Re: FSMs should not be interacting with each other, but they are.
« Reply #10 on: December 20, 2017, 11:19:34 PM »
Okay, I'll look up how to make the FSMs state aware. I didn't think of that. How do you want me to share the scene? I know how to add people via "collaborate". If you mean anything other than that, I think i'll need you teach me what it is. :)
Inexperience is just the beginning of greatness.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FSMs should not be interacting with each other, but they are.
« Reply #11 on: December 21, 2017, 01:11:34 AM »
Hi,

 Collaborate is fine. Just let me know where to look in the project and I'll check it out.

 Bye,

 Jean

MadboyJames

  • Playmaker Newbie
  • *
  • Posts: 18
  • Str: 9/ Dex:11/ Con:10/ Int:13/ Wis: 12/ Cha: 12
Re: FSMs should not be interacting with each other, but they are.
« Reply #12 on: December 21, 2017, 12:23:52 PM »
Okay, so my previous post was wrong. Even when I removed having the objects speed being set by Set Velocity 2D, I still had an action normalizing the speed when it switched from left-to-right or vice versa using Set Velocity 2D. If I removed that, leaving just the Add Force 2D, it works as expected. Move and Jump do not effect each other. So I guess this means I need to find a way that is not Set Velocity 2D to set the x speed of an object.

Jean, You can still look at it if you want (i'm sure I am not doing some critical best practices), but I think I have isolated the current issue. I'll do some research into how to fix it, play around with it a bit, and if I can't figure it out I'll open a new thread.

Thank you!


Erm... how do I close a topic? Is that a thing I can do, or do I lack the POWER to do such a thing?
« Last Edit: December 21, 2017, 12:30:35 PM by MadboyJames »
Inexperience is just the beginning of greatness.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: FSMs should not be interacting with each other, but they are.
« Reply #13 on: December 21, 2017, 12:45:30 PM »
Hi.
You can edit (click modify on your 1st post) your Subject: and add [SOLVED] in front or behind.
I will do it for you now :)