Jump to content


Retired Staff
  • Posts

  • Joined

  • Last visited

Everything posted by eAi

  1. Congrats on the release! Great to see so much progress still happening!
  2. @Megadreams I'm interested that you say it's a lot of extra work. Obviously you've already done a lot of work on this - so changing strategy is obviously difficult - and I've not really thought a huge amount about it so maybe it's different to how I expect, but... The key difference between transpiling and interpreting is that instead of parsing the SCM and then calling functions based on it, you need to generate code that calls the same functions from the SCM. I imagine that either way you end up writing a library of code that handles each operation, and that library could be almost identical between both systems. With the transpiling approach I'd guess that control flow might be the tricky bit - though I believe Lua now supports 'goto' which could help quite a bit (I'm not sure if MTA has updated Lua yet - I know it was being talked about). Anyway interesting stuff - keep us updated!
  3. This is pretty cool. I do wonder if it'd be easier to make a system to transpile/decompile the code from SCM to MTA's LUA? Given that you'll need to modify the missions quite a lot, is SCM actually the best place to do this? I assume there will be opcodes that have to be added to SCM to facilitate co-op. It'd also be much faster to run, presumably.
  4. As the original website designer from approaching 10 years ago(!), I agree it needs an update. But I don't feel this is quite enough. The key art at the top is less interesting, and the rest is just a bit more square. I'm not really involved these days, so whatever I say has very little importance, but I think a more substantial redesign could be worthwhile.
  5. What would that dialog say? "Would you like to run this plugin? It may destroy your computer? [Yes] [No]" There's no easy way to judge whether code is 'good' or 'bad'. On Android, code runs in a fairly protected sandbox (unless you root your phone) so it can't do anything too nefarious. A native plugin on Windows could do pretty much anything - from deleting all your files, to exploiting the OS to install a rootkit - and there's no way to really detect this ahead of time.
  6. Client side modules would be a massive security hole as they'd allow you to run arbitrary native code on the client.
  7. I wouldn't say that breaks OOP - it's a fairly common situation (for example, Unity would behave exactly the same way). Perhaps .position should be be a function called GetPosition? I'm way out of the loop on this stuff though!
  8. It's pretty unusual for games to use double precision floating points - for example both Unity and Unreal don't support it (of course, you can use 64 bit floating point numbers, but everything internal uses 32 bit floats).
  9. It's been basically forever since I wrote any MTA code, but CMatrix and CVector are classes that need to match those in GTA - so their sizes can't be changed. You may have already realised this! This also applies to any class that is suffixed with Interface.
  10. That's correct. There were (years ago, now) some discussions about implementing server-side physics, but it was never going to be an easy task (and would probably require rewriting the client-side physics too, to make them match. It's been a while since I've contributed, but from what I remember, each object has a concept of an owner, and they're responsible for synchronising the physics. Vehicles have dead-reckoning, which makes them have quite good looking physics (though collisions can be an issue sometimes, depending on latency). There's a difference between physics being accurate versus being smooth - and MTA tends towards the latter, which is mostly what you'd want!
  11. Tables aren't arrays, so they only allocate memory for the keys that contain values.
  12. Shared means that it will be loaded on both the server and client. You can't share functions between resources except via exports. What's wrong with doing it that way?
  13. Sure, that's true if you only want to send your data to a single player, but if you want every player to get that data, then I'm fairly sure that setElementData is the most optimal way, or at worst, it makes very little difference.
  14. See this post: viewtopic.php?f=148&t=77161 I'd say get/set element would be more optimal than the code provided.
  15. Try using onClientPreRender rather than onClientRender. By using onClientRender, you're taking the position of the bone just after it has been rendered, then setting the position of the attached object in the next frame, so you always see your attached object where the bone was the previous frame. Your variable and function names are atrocious.
  16. It depends what the data is. If you can put it on the server, you probably should, especially if it's something where the player would gain some advantage by change it. That's generally the principle of multiplayer networking - don't trust the client.
  17. I would expect that exporting methods for accessing a table would be more expensive than using un-synced element data. Calling methods between resources is a relatively expensive thing to do. setElementData and getElementData are great for syncing little bits of data easily. Unsynced, they're also a good way to share data between resources. If you don't care about doing either of those things, then the method described in the original post is obviously the best way to go - you're keeping your data inside the LUA virtual machine, which is much faster. Overusing synced element data - when you don't actually want to sync that data - is actually going to have quite a bit more of an impact than the original post states as it'll increase the amount of data that has to be sent (increasing bandwidth usage), increase the load on the clients and increase the load on the server (as some of the networking will be asynchronous).
  18. You'd need to set the texture filter mode to nearest neighbour (see here). Unfortunately MTA doesn't support this. It think it would be fairly easy to add it to dxCreateTexture though.
  19. You're missing an item - number 32 in the second list (which probably should be "small").
  20. eAi

    Server Load

    Best thing to do is to delete all the resources cached on your client, then join your server, then have a look in the resources folder to see what is there. You can then see if there are any obvious large files.
  21. Lua was an easy language to embed, and also fairly widely used in the games industry. It's undoubtably not the best language - Python is certainly better, but from what I remember, we looked at embedding python, but it wasn't terribly easy to do. There was also probably an element of naivety - it was the first time anyone had integrated a scripting system into another game like this, and it was certainly quite experimental at the time - both in principle and for those doing the implementation. That said, there are certainly worse languages to use. Lua has very little boilerplate which makes it very easy for beginners to get started. It doesn't scale well to large systems, unless you're very careful about how you write your code, but then that applies to Python too.
  22. My guess is because SA-MP doesn't allow you to download your own models, so they have to include them built-in to the client. I've never played SA-MP though, so I don't know if that's the case.
  23. That's basically the same reason that it's not built in. The MTA server doesn't know anything about the collision data for the vehicles or the world, so it can't do server-side collision detection (as most other real-time multiplayer games would do). To implement server-side physics we'd have to extract all of the collision data from GTA and make our own perfect copy of the physics engine. Even if we could do this technically (it would be very hard) it would infringe R*'s copyright to include the GTA collision meshes with the MTA installer.
  24. eAi

    mta public statistic

    It doesn't appear that GTA V has affected MTA at all, we've still got record numbers of players. The number of players playing varies massively at different times of the day - with 5x more players playing at the peak compared to the trough each day. We've never had 26k simultaneous players.
  • Create New...