playMaker

Author Topic: Get Current State as enum, not string  (Read 3049 times)

imtrobin

  • Playmaker Newbie
  • *
  • Posts: 28
Get Current State as enum, not string
« on: July 04, 2014, 05:35:20 AM »
Hi

Currently, there is a ActiveStateName to get current state. Can I request for a index based into the FSMState. This way, I can build the names via at runtime if I need, and I don't suffer the penalty of string slowness.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Current State as enum, not string
« Reply #1 on: August 18, 2014, 04:19:48 AM »
Hi,

 Have you noticed performances because of the use of strings? If you do, it's important to pin point exactly the problem as it may not be because of string themselves. If you already profiled, can you share your findings? maybe there are things to improve in custom actions.

 Bye,

 Jean

imtrobin

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Get Current State as enum, not string
« Reply #2 on: August 18, 2014, 02:21:03 PM »
Not profiled yet on current game, but on previous games. strings in c# generate garbage, and of course is a lot slower in comparision. When I have a lot of characters calling GetCurrentState every update, it will be slow, especially on mobile. If I can optimize it now with enum, I would do so.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Current State as enum, not string
« Reply #3 on: September 08, 2014, 08:03:53 AM »
Hi,

 with the coming up new release of PlayMaker and its support for enum, this will be possible then yes :)

 Bye,

 Jean