Jump to content

Maggi

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by Maggi

  1. MTA developers may create flag "protected resource"; this resource remains in memory while playing session and not saved to disk like non-protected resources.
  2. Ну че там ? есть ли какие успехи у автора? я не могу на мта перейти пока не закончу проект в самп... Боюсь на lua он будет медленно работать если перевести его из pawn... я уже описывал разработчикам про то, чтобы добавили возможность писать моды как плагины к МТА серверу на с++. это идеальный вариант, учитывая то, что строится гигантский мегаполис, в нем играют 100+ людей, скриптов на всех не хватит, скрипты идеально подходят для не-онлайн игр или онлайн игр с простым игровым режимом - если задуматься, самп и мта делались именно для этого - чтобы побегать и пострелять... потом начали появляться рп режимы итд...
  3. да, вариант через модули не "честный" но пока что не вижу другого способа, как реализовывать большие проекты не на луа (куча игроков, заглянем в будущее, 500+ игроков, куча объектов, которые обрабатываются в циклах итд...). обновил 1 пост, там представлен 2 вариант написания модов на С++. зы: спс за ответ, lil Toady.
  4. цель: создать среду для написания мода на С++. lua будет тоже использоваться на стороне сервера (миссии) и клиента (только GUI + визуальные эффекты). скачал шаблонный проект модуля отсюда: https://wiki.multitheftauto.com/wiki/Modules. вроде бы разобрался что к чему, а именно как делать функции в C++ модуле чтобы потом они были доступны в lua. Вопросы: 1) как перехватывать события https://wiki.multitheftauto.com/wiki/Ser ... ing_Events. в модуле? 2) В чем назначение функции DoPulse() которую экспортирует модуль. И так понятно что ее будет вызывать система через N-нный промежуток времени, хотелось бы узнать чему он равен и кто именно будет вызывать эту функцию (DoPulse) Писал в пм lil Toady но он не ответил. Может он занят или не знает, хз)) ------ Недавно копался в исходниках МТА, (расскажу как я понял, так что поправьте если что не так) и увидел как организован мультилпеер МТА а именно: он состоит из системной части CORE и mods (моды). Теоретически в папке моды могут лежать много игровых режимов, я там нашел только deathmatch. поэтому возникла идея расширить функциональность этого режима вводя в него новые функции или что-то в этом роде. Так вот, абстракция игрового режима предполагает наличие API логики и новые события (Events). В режиме же deathmatch реализовано максимально возможное количество событий и базовая логика и он является основным: на нем даже построены гоночные режимы. хотя было бы разумней сделать режимы: race / deathmatch / RPG... приведу примеры: режим гонка: API расставить тачки / пикапы починки / смены модели авто у игрока / цвета / итд события: взрыв авто, повреждение авто, итд режим RPG: API достаточно большое: системы бaнд, зданий, бизнесов, фабрик, территорий, автомобили, дома, скиллы (важно), миссии (локальные (per player), глобальные, групповые (банда, или иное множество игроков)). события: только 3 штуки! PvP, PvE, и Pulse() мира. режим deathmatch: API: распределение по командам, установки скина команде, итп события: смерть члена команды, смерть игрока, захват флага, убийство целевого игрока.итд...
  5. Важны не важны но при развитии игрового мода тебе придется переписывать скрипт заново (в случае добавления новых измерений). Если же это одноразовый скрипт то все норм.
  6. Вы забыли учесть виртуальный мир и интерьер)
  7. не понял смысла поста) Жаль что нельзя устанавливать задачи для ботов. С другой стороны GTA - игра-то не сетевая.
  8. https://wiki.multitheftauto.com/wiki/Lis ... ayer_tasks теоретически можно сделать бот-банду-компаньон (на основе системы задач GTA) которая будет следовать за вами и садиться в авто к вам итд. ведь в сингле именно так и происходит.
  9. MTAEXPORT bool InitModule ( ILuaModuleManager *pManager, char *szModuleName, char *szAuthor, float *fVersion ); MTAEXPORT void RegisterFunctions ( lua_State * luaVM ); MTAEXPORT bool DoPulse ( void ); MTAEXPORT bool ShutdownModule ( void ) My question is: DoPulse - what it does?
  10. I found only isElementStreamedIn() that is only on client side. Is it possible to create function GetStreamedElements(player, element_type) that returns table of streamed elemets. Example: local t[] = GetStreamedElements(player, ELEMENT_TYPE_VEHICLE); function should be serverside, not clientside. I found also server-side events: onElementStartSync and onElementStopSync. with them it is possible to manually fill table with player's streamed elements. but it will take some memory and time.
  11. Maggi

    MTA Problems

    In short, I want to make MTA client to be looked as SAMP client (no grass, no blur, no dirt level, etc....).
  12. Maggi

    MTA Problems

    FPS: Is it possible to reduce client side features (blur, dirty level for vehicles, grass, etc) as done in SAMP? It is big problem for large RP servers, where player count may be more than 300. I also know that ghost mode and scripts in OnClientPreRender,etc.. uses additional system resources. Network: MTA uses network streamer to stream nearby vehicles and players. SetElementData, is not streamed, so I avoid using it in gamemode. MTA also have advantage over SAMP - scoreboard can be disabled (I know that scoreboard is a script that uses SetElementData). so, my question about network: is there any othar activity except sending streamed players(vehicles) data and SetElementData? PS: warning: bad english =)
  13. you may create special flag for resource in meta.xml named "autodownload" = true / false, and then, client side tries to play music that is not yet loaded (but still presents in script), it makes request to server and downloads file (maybe in separate thread)
  14. Is there any method of selectively resource loading? As I understood, MTA sends all resources, listed in xml file to client. If Game mod uses a lot of music then downlad process becomes very long.
  15. to mta developers: "Actions" model: CLIENT iteracts with server through actions: ACTION_FALL, ACTION_FALL_ON_GROUND, ACTION_BREAK_ARM(LEG) ACTION_TURN_HEAD, ACTION_DANCE, ACTION_VEH_TURN_LEFT(RIGHT), ACTION_THROW_GRENADE, ACTION_SWIM... etc... My idea is to change synchronization model from SYNC_MY_WORLD to ACTION model. Benefits: 1) no speedhacks, because client have to describe his actions. Ex: player entered server, spawned in the field. now he starts moving (ACTION_WALK+walk_data), looks at sky (ACTION_TURN_HEAD+turn_head_data), runs (ACTION_RUN+run_data(vector+speed)), enters vehicle, player is driving vehicle: press left button (ACTION_DRIVE_VEH_TURN_LEFT+data)... etc... CORE physics is on client side (as usual), server side only takes: [action+action_data] 2) Good for anticheats, because client have to describe his actions (what has been done!), there is no stupid synchronization. 3) Possibility to have multiple Element Syncers - if player uses GM while ramming another player or element, server sends action data to all streamed players. So, if 3 clients says that vehicle is damaged 30 units and 1 client says that vehicle damage is 0 units, then he maybe lies or there is lags or smth else, and then server accepts 30 units damage (there is also trusted level param desribed below) What will happened if player has no streamed players nearby? We can use special technique: streaming imitation (will be described below) CLIENT structure: client_ID, performance_value (fast computers have higher values), task_count (how many players are streamed in the client client, including virtually streamed clients), trusted_level (new players has trusted level = 1, admins and other good players have trusted level 1000). The main idea, as you understood is to make physics calculation at trusted clients... The main problem is how to make virtual streaming? PS: sorry for my bad english
  16. Snoozy, can you post your script here?
  17. Lets discuss this scripting technique: Game 'phisics' (treat it is as game logic, game rules), Extending game core actions: various atomic actions is scripted at client side and each action has its ID. so, server only calls trigger_client_event() with action ID + arguments. Advantages: minimal bandwidth load + less CPU usage (at server side) Disadvantages: player can decompile or just see script contents and look at 'secret' data, or keyword moments (mechanics) of certain script, problem for anticheat. viewpoint: core GTA actions is also treated as scripts: ex: if I shoot somebody, I use action 'shoot' with params: target, bodypart, weapon_type, weapon_skill.. and the result of this sript will be target damage (loss HP). lets name this system as game phisics. So, We can extend game phisics by adding new features: 'shoot' action result depends on player health (If you have extremly low HP, your actions will not be so effective). Next, we can also add param blind (especially useful for RP servers) if you are get blinded (teargas or smth else) you just can't shoot. To be shorten: Gamemode declares ACTIONS that are represented as scripts on client side, thus extending CORE game RULES (phisics). server's task is to call actions + params for it!. Main conception: ALL actions are scripted at client side. So, server becomes director of movie named 'GAME'.
  18. thanks for reply Aibo additional information about this function can be found at http://lua-users.org/wiki/ShortAnonymousFunctions
  19. Hi community! While creating mission engine i've discovered a question: script generates lua script and put generated script in the string. How can I run generated script? (as function call, of course) ex: my_lua_fn_string = "function myGeneratedCodeFn() ....some lua code here.... end" my purpose is to call myGeneratedCodeFn function as callback somewhere from gamemode script.
  20. You can create map objects using createObject function. In Your case, if player enters hotel in RP world, then there is no need to load it, because hotel is a part of world... If you want dynamically add hotel in game, you can open file, loop through all objects and create them using https://wiki.multitheftauto.com/wiki/CreateObject function
  21. executeCommandHandler... it executes only clientside command handlers, not serverside
  22. Question: Is there any function to simulate sending from clientside to serverside a command with args? I know about events, but I want to know if there is another way...
  23. What is about setElementData function? Can I have access to the vehicle data that is in another dimension from client side?
×
×
  • Create New...