Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    Originally posted by BoredEngineer View Post
    Upgraded to 4.18 both Plugin and Content, new version is already on GitHub.
    Доброго времени суток Виктор!
    Большое спасибо за ваши труды, мне они нравятся и я использую их в своем проекте.
    В частности реализация MMTSuspensionStack, я учусь программировать на С++, путем изменения вашего кода, добавления своих алгоритмов, вроде вполне неплохо получается.
    В основном я взял за основу функцию CalculateAndApplySuspensionForce, что бы переделать и оптимизировать под свой проект, получилось то что нужно, хороший "Антиграв".

    Меня интересует этот алгоритм из той-же функции, я все никак не могу понять принцип его работы в деталях, вроде-бы напоминает ПИД-контроллер, только без Интегрирующей и Дифференциальной составляющих, только Пропорциональный и какой-то свой алгоритм затухания.
    Проблема в том, что я хотел обобщить этот алгоритм и вынести в библиотеку как независимую функцию выполняющую роль "Стабилизатора", чтобы ее можно было применить и для "Антиграва" и для стабилизации поворотов, удержания нужного угла.
    Обобщить и вынести отдельно получилось, в Антиграве прекрасно работает, но, для стабилизации поворотов путем удержания нужного угла, работает только в одну сторону, я так понимаю что этот алгоритм не хочет воспринимать отрицательные значения на входе, в итоге он либо рассчитывает не правильную силу, либо вообще не работает.

    П.С. Не знал как назвать этот эффект удержание объекта в воздухе над землей, но в моей игре эту функцию выполняет "Антиграв", в случае вашего плагина это Suspension Stack.



    Kind time of the day Victor!
    Thank you very much for your work, I like your work and I use them in my project.
    In particular, the implementation of MMTSuspensionStack, I'm learning to program in C ++, by changing your code, adding your algorithms, it seems to be quite good.
    Basically, I took as a basis the function CalculateAndApplySuspensionForce, which would be redesigned and optimized for my project, it turned out that what is needed is a good "Antigrave".

    I'm interested in this algorithm from the same function, I still can not understand the principle of its operation in detail, sort of like a PID controller, only without an Integral and Differential component, only Proportional and some kind of its own damping algorithm.
    The problem is that I wanted to generalize this algorithm and put it in the library as an independent function that plays the role of "Stabilizer", so that it can be used both for "Antigrava" and for stabilizing the turns, keeping the right angle.
    Generalize and render separately, it works fine, but in Antigrave works fine, but to stabilize the turns by holding the right angle, it works only in one direction, so I understand that this algorithm does not want to take negative values ​​at the input, in the end it either calculates not the correct strength, or does not work at all.

    P.S. I did not know how to call this effect an object holding in the air above the ground, but in my game this function is performed by "Anti-Gravity", in the case of your plug-in this is Suspension Stack.
    Last edited by Yakim; 11-30-2017, 11:36 AM.

    Comment


      This post explains idea behind suspension stack:
      https://forums.unrealengine.com/comm...155#post926155

      It works as a spring not as controller. The main difference from a Hooke's law spring, is that here, spring force raises rapidly from 0 to desired suspension force value and then raises more smoothly to a maximum value. This is done to get a better spring response on suspension with short distance travel and sets "zero" of suspension as a desired "default" position instead of a point where suspension is weakest.
      Youtube Channel

      Comment


        Originally posted by BoredEngineer View Post
        This post explains idea behind suspension stack:
        https://forums.unrealengine.com/comm...155#post926155

        It works as a spring not as controller. The main difference from a Hooke's law spring, is that here, spring force raises rapidly from 0 to desired suspension force value and then raises more smoothly to a maximum value. This is done to get a better spring response on suspension with short distance travel and sets "zero" of suspension as a desired "default" position instead of a point where suspension is weakest.
        Ааа ага вспомнил, я уже видел это, спасибо.
        Может быть подскажите, недорогой по производительности и эффективный как пружина, алгоритм для стабилизации поворота?
        Что бы силу/ускорение применял и стремился к заданному углу поворота.
        ПИД-контроллер в принципе подходит, но не будет ли дорогим по производительности?

        Aaa aga remembered, I already saw it, thank you.
        Can you tell me, inexpensive in performance and effective as a spring, an algorithm for stabilizing the rotation?
        What would force / acceleration apply and aim at a given angle of rotation.
        The PID controller is in principle suitable, but will not it be expensive in performance?

        Comment


          Originally posted by Yakim View Post

          Ааа ага вспомнил, я уже видел это, спасибо.
          Может быть подскажите, недорогой по производительности и эффективный как пружина, алгоритм для стабилизации поворота?
          Что бы силу/ускорение применял и стремился к заданному углу поворота.
          ПИД-контроллер в принципе подходит, но не будет ли дорогим по производительности?

          Aaa aga remembered, I already saw it, thank you.
          Can you tell me, inexpensive in performance and effective as a spring, an algorithm for stabilizing the rotation?
          What would force / acceleration apply and aim at a given angle of rotation.
          The PID controller is in principle suitable, but will not it be expensive in performance?
          PID controllers are really cheap, it’s just few multiplications and divisions. Integral part can become expensive if hundreds or thousands of error values are tracked back in time, but it can be optimized. PID is the simplest controller, don’t worry about it’s performance.
          Youtube Channel

          Comment


            Not sure what kind of algorithm you are looking for. PID works well for roll stability as it’s easy to measure error - just current roll compared compared to absence of it. With turns it’s more tricky as it’s not too obvious how to measure error. Check example with hovercraft that I have, direction I want it to travel is defined by turning red arrow - this is what user controls. But this would be really weird way to control something like a car.
            For turning, instead of direction you could control speed of turning and let PID measure the error between how fast vehicle is turning and how fast it should be turning. Just an idea, might not work in specific cases. Overall I would use only where user input is very difficult (steering of hovercraft) or not needed (roll stability).
            Youtube Channel

            Comment


              [QUOTE = "BoredEngineer; n1394354"]

              ПИД-регуляторы действительно дешевы, это всего лишь несколько умножений и делений. Интегральная часть может стать дорогой, если сотни или тысячи значений ошибок будут отслежены во времени, но ее можно оптимизировать. PID - самый простой контроллер, не беспокойтесь о его производительности.
              [/ QUOTE]

              Спасибо, думаю в моем случае можно обойтись без Интегральной составляющей.
              Я буду использовать два контроллера, один для стабилизации по крену, второй для частичной стабилизации по тангажу, в принципе, я представляю какое будет управление.
              По крену будет постоянная стабилизация, если кнопки не нажаты то на вход будет подаваться угол полученный от нормали плоскости над которым находится объект, если нажаты то свой фиксированный угол наклона.
              По тангажу он будет работать не постоянно, а только в определенном диапазоне поворота, там немного сложнее управление.

              Вот самый первый тест, как пример того что я делаю https://www.youtube.com/watch?v=DiZD6tQClTk

              Я боюсь за производительность этого контроллера, потому что я хочу что бы все это работало в мультиплеере с авторитарным сервером, то-есть на сервере будет >50 глайдеров и у каждого такой алгоритм пружины и ПИД-контроллеры стабилизации поворотов, потом еще куча функционала, оружия, магазины, постройка.

              Прошу прощения за английский перевод гугл переводчиком, я столько текста на английском просто не осилю=)


              Thanks, I think in my case you can do without the Integral component.
              I will use two controllers, one for roll stabilization, the second for partial pitch stabilization, in principle, I represent what will be the control.
              On the roll there will be a constant stabilization, if the buttons are not pressed then the angle received from the normal of the plane above which the object is located will be fed to the input, if its fixed angle of inclination is pressed.
              By pitch, it will not work constantly, but only in a certain range of rotation, there is a little more difficult to control.

              Here is the very first test, as an example of what I'm doing https://www.youtube.com/watch?v=DiZD6tQClTk

              I'm afraid for the performance of this controller, because I want it all to work in multiplayer with an authoritative server, that is, there will be> 50 gliders on the server and each has a springs and PID stabilization algorithm, then a whole bunch of functionality, weapons , shops, construction.

              I apologize for the English translation of Google translator, I have so much text in English just do not master =)

              Comment


                Like with any optimization, you have to try and see. Profile to find bottlenecks, analyze them and refactor or optimize your code. The algorithm itself is not necessary a problem but specifics of implementation. For example, integral part of PID controller needs an array of errors from previous measurements, so it's a good idea to pre-alocate this array instead of resizing it dynamically.
                Youtube Channel

                Comment


                  Hi BoredEngineer.

                  Ever since i have updated to version 4.18 i have not been able to open any blueprints that reference the mmt pawn base class that was created on the old version or play my game. If I create a new class it will work but copy all the code over from a previous version will be a hassle. The error i get is attached.

                  Is this fixable?
                  Attached Files

                  Comment


                    Originally posted by stigglewiggle View Post
                    Hi BoredEngineer.

                    Ever since i have updated to version 4.18 i have not been able to open any blueprints that reference the mmt pawn base class that was created on the old version or play my game. If I create a new class it will work but copy all the code over from a previous version will be a hassle. The error i get is attached.

                    Is this fixable?
                    Did you migrate your project into 4.18? Removed intermediate, binary and save folders?
                    Youtube Channel

                    Comment


                      Originally posted by BoredEngineer View Post

                      Did you migrate your project into 4.18? Removed intermediate, binary and save folders?
                      I have done this and also moved the content to new project and still happens

                      Comment


                        No idea what could be a problem then. I can take a look at it if you want, just dm a link so I can download it from somewhere.
                        Youtube Channel

                        Comment


                          Originally posted by stigglewiggle View Post

                          I have done this and also moved the content to new project and still happens
                          just seen the 4.18.2 patch notes and saw this.

                          Fixed! UE-52852 Crash opening Child/Grandchild Blueprint after updating to 4.18

                          going to give this a try and get back to you

                          Comment


                            It is working as of the 4.18.2 update

                            Comment


                              Originally posted by stigglewiggle View Post
                              It is working as of the 4.18.2 update
                              Cool! Glad its solved
                              Youtube Channel

                              Comment


                                Hi first of all thanks for making the plugin I am using the MMT plugin in my project and for a scene I am getting 45 - 50 fps for 6 M113 tank including the player.Is it normal ?Can it be improved because I am trying to include more than 10 tanks for which I get approx 30 fps.

                                My configuration just for info
                                CPU - Intel Core i7 4790
                                GPU - NVIDIA GeForce GTX 1070
                                RAM - 16.0GB Dual-Channel DDR3
                                Grab Turret Plugin on Marketplace
                                Universe is laughing at you especially when you are touching yourself.

                                Comment

                                Working...
                                X