Jump to content

AfterAll14

Members
  • Posts

    165
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by AfterAll14

  1. @qaisjp Well, actually what I originally meant by this suggestion was something like that: local matrix = vehicle:getComponentMatrix(..) vehicle:setComponentMatrix("dummy", matrix) As I started digging into MTA source by myself, it turned out adding this feature is quite easy. I'm going to include it in this update. I'm not planning to add vectors for return value for position/rotation, cause as @Fierelier said it could lead to compatibility issues. But if MTA devs think its necessary - so be it update: took a brief look at wiki - looks like getComponentPosition/getComponentRotation methods are not documented, though they are in the MTA code. So I think that means you can add vectors as return values. Those who used older versions should blame themselves then for using non-documented funcs update 2: ok, its actually poorly documented in the end : https://wiki.multitheftauto.com/wiki/OOP_client#Vehicle
  2. У setElementData есть 4-й аргумент, который отвечает за синхронизацию. По умолчанию он устанавливается в true, т.е. все данные посылаются всем игрокам, это и увеличивает нагрузку. Если Вам нужно сохранить какие-то данные только в пределах сервера или клиента надо писать setElementData(element, "key", value, false). Также если нужно послать данные одному конкретному игроку - используйте triggerClientEvent. И да, лучше группировать данные кучами т.к. каждый вызов setElementData стоит процессорного времени, большие пакеты обрабатываются быстрее.
  3. Ok, gave up on trying to switch precision. Looks like you have to rewrite 90% of the MTA code for that . But still wanna get answer for the question above. I'm going to add one extra variable to CMatrix class, which will result in change of size for several classes that contain CMatrix objects, which will trigger those asserts.
  4. Can anyone tell me what are those statements for? file: CEntitySA.h static_assert(sizeof(XYZ) == 0x54, "Invalid size for XYZ"); //line 105 static_assert(sizeof(XYZStore) == 0x1FC, "Invalid size for XYZStore"); //line 118 static_assert(sizeof(CEntitySAInterface) == 0x38, "Invalid size for CEntitySAInterface"); //line 244 I changed Vectors precision from float to double, and it gives me :~load of errors caused by the change of the classes sizes.
  5. Ок, зайду, гляну, может чего бросится в глаза. edit: или не зайду
  6. Если у Вас все написано в таком стиле, как Вы показали - то проблема может быть в злоупотреблении setElementData. Вообще использовать setElementData с синхронизацией данных для всех игроков Я бы советовал в исключительных случаях. Это загружает CPU на сервере в экспоненциальной зависимости от кол-ва игроков. PS. кстати, что за проект? PPS. случаем не оно ? Если да, то у меня для Вас плохие новости касательно радара)
  7. Update: So, today was the day. I've managed to add some functions to extend Vector3 class. After successfull build I've started the server and joined, checked that everything works and quit. Then I took a look into server log and something scared me: some guy named "NeedyNurse32" somehow joined my server: I was like "wtf? how did he managed to join custom server?!!". I immediately shut down the server and set up password in "mtaserver.conf". It took me a while to realize that the guy was actually me. I simply forgot that MTA assigns random nickname when you launch it first time . So, moving on, I've tested functions performance, and results were quite humiliating: As you can see Lua is executing same functions about 3-4 times faster than c++. At this point I thought that there's no sense to continue, as the whole purpose of making funcs in c++ was to increase performance. It looked like the cost of transition between c++ and lua was way too high, and running math library in native Lua code turned out to be faster than offloading it to c++. But... I didn't take into count how much MTA debug version was slower from release version. It took me a while to build release version (it's not mentioned on wiki, but apart from 2010 DirectX SDK you also need 2009 DirectX SDK to build in that config with no errors). And release mode it's a totally different story : It's still far from perfect, transition cost still looks like a problem for c++, but moving on into more complex structures the difference should grow exponentially .
  8. Yes, I followed those instructions. No matter what I do, I still get this error: Microsoft.CppCommon.targets(133,5): error MSB3073 . And there's no meaningful explanation how to fix it anywhere around the internet. So, today Microsoft dickheads won I'll try again tomorrow
  9. Yeah, I did install DirectX SDK, after this I deleted "Build" folder and generated solutions again. And I'm getting those errors described in #2 above.
  10. Well, MTA build-in OOP math kind of sucks. I wanna add some new functions and classes to enrich its functionality, so it will open the usage of some advanced techniques for nubs. I have problems compiling MTA SA source. IRC chat seems to be non-responsive, and it's kickinng all the time, so I'll post my questions here: 1. projects "breakpad" and "Shared" set to skipped - is that correct? (I've messed a lot with project settings trying to fix missing "d3dx9.h", so not sure what is the right setting should be). 2. I have these errors (VS 2015): 1>------ Build started: Project: DirectX9GUIRenderer, Configuration: Debug Win32 ------ 2>------ Build started: Project: pthread, Configuration: Debug Win32 ------ 1> DirectX9GUIRenderer.vcxproj -> D:\MTA SA\mtasa-blue\Build\bin\x86\Debug\DirectX9GUIRenderer_d.lib 3>------ Build started: Project: pcre, Configuration: Debug Win32 ------ 4>------ Build started: Project: curl, Configuration: Debug Win32 ------ 5>------ Skipped Build: Project: breakpad, Configuration: Debug Win32 ------ 5>Project not selected to build for this solution configuration 2> pthread.vcxproj -> D:\MTA SA\mtasa-blue\Build\..\Bin\server\pthread_d.dll 2> pthread.vcxproj -> ..\Bin\server\pthread_d.pdb (Full PDB) 2> Недопустимое число параметров 2> Не удается найти указанный файл. 2> Не удается найти указанный файл. 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "IF EXIST ..\Bin\server\pthread_d.dll\ (xcopy /Q /E /Y /I ..\Bin\server\pthread_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\ > nul) ELSE (xcopy /Q /Y /I ..\Bin\server\pthread_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\ > nul) 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: copy D:\MTA SA\mtasa-blue\Build\..\Bin\server\pthread_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\pthread.dll 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: copy D:\MTA SA\mtasa-blue\Build\..\Bin\server\pthread_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\server\pthread.dll 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 1. 3> pcre.vcxproj -> D:\MTA SA\mtasa-blue\Build\..\Bin\server\mods\deathmatch\pcre3_d.dll 3> pcre.vcxproj -> ..\Bin\server\mods\deathmatch\pcre3_d.pdb (Full PDB) 3> Недопустимое число параметров 3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "IF EXIST ..\Bin\server\mods\deathmatch\pcre3_d.dll\ (xcopy /Q /E /Y /I ..\Bin\server\mods\deathmatch\pcre3_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mods\deathmatch\ > nul) ELSE (xcopy /Q /Y /I ..\Bin\server\mods\deathmatch\pcre3_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mods\deathmatch\ > nul) 3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 4. 6>------ Skipped Build: Project: Shared (Shared\Shared), Configuration: Debug Win32 ------ 6>Project not selected to build for this solution configuration 7>------ Build started: Project: XML, Configuration: Debug Win32 ------ 4> curl.vcxproj -> D:\MTA SA\mtasa-blue\Build\..\Bin\server\libcurl_d.dll 4> curl.vcxproj -> ..\Bin\server\libcurl_d.pdb (Full PDB) 7> XML.vcxproj -> D:\MTA SA\mtasa-blue\Build\..\Bin\server\xmll_d.dll 7> XML.vcxproj -> ..\Bin\server\xmll_d.pdb (Full PDB) 4> Недопустимое число параметров 4> Не удается найти указанный файл. 4> Не удается найти указанный файл. 4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "IF EXIST ..\Bin\server\libcurl_d.dll\ (xcopy /Q /E /Y /I ..\Bin\server\libcurl_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\ > nul) ELSE (xcopy /Q /Y /I ..\Bin\server\libcurl_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\ > nul) 4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: copy D:\MTA SA\mtasa-blue\Build\..\Bin\server\libcurl_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\libcurl.dll 4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: copy D:\MTA SA\mtasa-blue\Build\..\Bin\server\libcurl_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\server\libcurl.dll 4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 1. 7> Недопустимое число параметров 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "IF EXIST ..\Bin\server\xmll_d.dll\ (xcopy /Q /E /Y /I ..\Bin\server\xmll_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\ > nul) ELSE (xcopy /Q /Y /I ..\Bin\server\xmll_d.dll D:\MTA SA\mtasa-blue\Build\..\Bin\mta\ > nul) 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 4. ========== Build: 1 succeeded, 4 failed, 34 up-to-date, 2 skipped ==========
  11. setVehicleComponentRotation with matrices too please
  12. Спасибо за советы. Про оптимизацию кода я в курсе, там уже все оптимизировано по максимуму. А вот без ООП размер кода вырастет раз в 5-10. Да и не особо хочется рушить структуру классов, править/находить ошибки потом будет почти невозможно. LuaJIT выглядит более реально, может быть займусь его внедрением потом. Но там может возникнуть проблема - где-то на этом форуме вычитал что разработчики МТА не хотят внедрять новые версии LUA из-за проблем с совместимостью.
  13. Суть: я пишу физику автомобилей которая полностью заменяет стандартную физику RenderWare. Соответственно там существует огромная нагрузка со стороны математических операций (преобразования векторов/матриц, вычисления). В принципе конкретно у меня с процессором i5 3.4гГц все хорошо. Но вот пробовал запускать на i3 1.6гГц - фпс провисает с 80 до 30. Соответственно было бы неплохо все вычисления перенести на С++, чтобы хорошо было у всех. Но видимо не судьба.
  14. Ну я так и понял, спросил чтобы убедиться (а вдруг). Увы, модули со стороны сервера не решат проблем с нехваткой вычислительной мощности на клиенте .
  15. На вики мало информации про модули. Если писать модуль - будут ли функции доступны на клиенте?
  16. AfterAll14

    i need help here

    You can only use MTA with 1.0 version of GTASA.exe. Find correct version and try again.
  17. AfterAll14

    Request 2

    local vehicleHealthMultiplier = 3 addEventHandler( "onClientVehicleDamage", root, function ( _,_, loss ) setElementHealth( source, getElementHealth(source)+(loss((vehicleHealthMultiplier-1)/vehicleHealthMultiplier) ) end ) Try this, though it would may not be working correctly for the first damage call (fixing this would require building some sort of system, which is time costly).
  18. MTA devs should understand what I mean. It's something that would make trouble when you use advanced smooth sync techniques.
  19. What do you mean by "server camera"? I can't set camera dimension neither server-side nor client-side.
  20. So, as title says, all attempts to attach camera (to the vehicle in my case) would fail.
  21. AfterAll14

    Request 2

    Dude, thousands of slaves are wating to execute everything you say. You just have to be more commanding, cause they are slaves, you know... You have to shout at them to make something happen.
  22. AfterAll14

    Meta Error

    <meta> <info author="RoY72" type="script" name"Baseblip" /> <config src="help.xml" type="server"/> <min_mta_version client="1.5.3" server="1.5.3" /> <script src="blip.lua" type="client"/> <aclrequest> <right name="function.startResource" access="true" /> <right name="function.stopResource" access="true" /> <right name="function.setPlayerMuted" access="true" /> </aclrequest> </meta>
×
×
  • Create New...