Koderz 0 Posted August 27, 2016 This is a continuation of a question I added to another thread now that the forums actually allow me to post a new topic... Can c++ extensions be used within the mpmission auto download thing? I've been looking at intercept, and they've said they won't support it, but they didn't say whether it was possible. I understand all the security implications of this, and won't be surprised of you can't do this, but I would like to know for sure. I'm looking for something other than SQF to work with as I already dislike SQF. Share this post Link to post Share on other sites
austin_medic 109 Posted August 27, 2016 no. RV Extensions must be inside an addon/dll which is downloaded separately from the mission pbo entirely (ingame you can only download the mission pbo off the server itself, everything else must come from another source), and it must be approved by battleye to be used in multiplayer, otherwise it will be disabled upon launching the game. If this wasn't the case then people could hack the game to the Andromeda galaxy and back 6 times over. Of course none of that is stopping you from going H.A.M and building your own scripting engine that will be forced to loop back through Real Virtuality's engine commands, overall probably not worth the effort. Share this post Link to post Share on other sites
Koderz 0 Posted August 27, 2016 no. RV Extensions must be inside an addon/dll which is downloaded separately from the mission pbo entirely (ingame you can only download the mission pbo off the server itself, everything else must come from another source), and it must be approved by battleye to be used in multiplayer, otherwise it will be disabled upon launching the game. If this wasn't the case then people could hack the game to the Andromeda galaxy and back 6 times over. Of course none of that is stopping you from going H.A.M and building your own scripting engine that will be forced to loop back through Real Virtuality's engine commands, overall probably not worth the effort. Yeah, that's what I figured... I'm just looking for a way to avoid SQF... I've looked through it and honestly I just hate the entire design... I'm used to things like c#/c++ and do a ton of work in UE4, but I can't get myself to want to work on anything with SQF involved. Share this post Link to post Share on other sites
killzone_kid 1333 Posted August 27, 2016 Yeah, that's what I figured... I'm just looking for a way to avoid SQF... I've looked through it and honestly I just hate the entire design... I'm used to things like c#/c++ and do a ton of work in UE4, but I can't get myself to want to work on anything with SQF involved. I don't think you realise how much you can do with extension alone, or should I say, how much you cannot do. Share this post Link to post Share on other sites
Koderz 0 Posted August 27, 2016 I don't think you realise how much you can do with extension alone, or should I say, how much you cannot do. Basic extensions yeah I know how they work and their massive limitation, but I was specifically taking a look at Intercept and while it currently doesn't work from what I was told I would be more than willing to assist the project if it was possible to use extensions. SQF is honestly a disaster... I've got ideas on my next course of action, time to prototype them out... Thanks all for the help! Share this post Link to post Share on other sites
IndeedPete 1038 Posted August 27, 2016 SQF is honestly a disaster... Please elaborate. I'm just curious. Share this post Link to post Share on other sites
killzone_kid 1333 Posted August 27, 2016 Please elaborate. I'm just curious. He is still planning on using SQF functions by the looks of it, only not from SQF script but via a non working extension. Share this post Link to post Share on other sites
IndeedPete 1038 Posted August 27, 2016 He is still planning on using SQF functions by the looks of it, only not from SQF script but via a non working extension. Yes, but I just wanted to know more about the reasons beind that. SQF might be a bit old-ish compared to more modern languages but I'm genuinely curious why the extra work of writing code in a different language and then essentially parsing it to SQF would be worth the hassle. Share this post Link to post Share on other sites
killzone_kid 1333 Posted August 27, 2016 Yes, but I just wanted to know more about the reasons beind that. SQF might be a bit old-ish compared to more modern languages but I'm genuinely curious why the extra work of writing code in a different language and then essentially parsing it to SQF would be worth the hassle. Theoretically being able to run sqf functions from extension would be really fast. But this is provided your extension has access to all functions and you are not planning on to share your mission. Share this post Link to post Share on other sites
IndeedPete 1038 Posted August 27, 2016 Theoretically being able to run sqf functions from extension would be really fast. But this is provided your extension has access to all functions and you are not planning on to share your mission. Now I'm even more curious! Why would that be fast(er than calling a function from within the mission / game)? Share this post Link to post Share on other sites
killzone_kid 1333 Posted August 27, 2016 Overheads of compiling game instructions. Each script needs to be interpreted into series of C++ function calls. Then there is runtime overhead as well. If you could call C++ methods within C++ environment, you are basically going as fast as the game can do it. Share this post Link to post Share on other sites
Arkensor 96 Posted August 27, 2016 Hello there, If you want to do something in arma, and do not want to use sqf you are completly wrong here, and in the game. There is no other way then scripting. Arma does not support any kind of native library hooking or so, to change or work with code in the game. DLL's or SO's are not meant as plugins or modules for arma. They are a link to systems like mysql or file write operations etc. But they do not work with the game itself. No dll you will ever write will be allowed by battleye to be executed as a client. SQF is a very easy to learn scripting language and requires no skill at all. Give it a try or forget about the idea of working with arma Regards Arkensor Share this post Link to post Share on other sites
IndeedPete 1038 Posted August 27, 2016 Overheads of compiling game instructions. Each script needs to be interpreted into series of C++ function calls. Then there is runtime overhead as well. If you could call C++ methods within C++ environment, you are basically going as fast as the game can do it. But there is no access to the C++ functions, right? There's no real API or SOA one could call from extensions. It's all hidden behind the SQF wall, correct? 1 Share this post Link to post Share on other sites
killzone_kid 1333 Posted August 27, 2016 Yeah, Nou & Co tried something with "Intercept", this is what OP was referring to. It is a hack, so basically just for educational purposes. Share this post Link to post Share on other sites
austin_medic 109 Posted August 27, 2016 I find it strange he hates SQF, its derived from c++ isn't it? Share this post Link to post Share on other sites
pedeathtrian 100 Posted August 27, 2016 But there is no access to the C++ functions, right? There's no real API or SOA one could call from extensions. It's all hidden behind the SQF wall, correct? There's no such wall if you can get memory locations of native code interpreting SQF commands. Intercept extension dll is loaded directly into arma's process address space, it can call whatever function it has address of. No SQF interpreting in execution chain. Last time I checked this was called reverse engineering and it was illegal in some countries. However this is what geeks do from time to time in, for example, "educational purposes", but ffs, you never present this to wide community as a programming interface to anything. IMHO. I wouldn't rely on such interface in any serious project. Nevetheless, some mindblowing hours were spent figuring all this out. Amazing work. Kudos. I find it strange he hates SQF, its derived from c++ isn't it? I see no relation, really. All these classes and cpp/hpp file extensions only bring more confusion. Share this post Link to post Share on other sites
Koderz 0 Posted August 28, 2016 Well then, appears I might have started something here... Will try to work my way through this.. EDIT: Apparently all of what I just wrote failed to post correctly.... to be continued... Share this post Link to post Share on other sites
Koderz 0 Posted August 28, 2016 Please elaborate. I'm just curious. The top reasons I already hate SQF… Having to tell the language to compile/preprocess itself from within the script Having to tell the language to secure itself from within the script (compileFinal or w/e) Each function being a separate file (I realize that’s not always the case but most frameworks are) The absurd extensions system where everything must be stringified in both directions The forced naming conventions for variable scope. The hpp/cpp files that have no actual relation to C++ The benefits of something like C++… More secure, as long as you don’t do stupid things. Several orders of magnitude faster. Smaller downloads Far better tooling Far better supporting libraries Far better resources Full threading support He is still planning on using SQF functions by the looks of it, only not from SQF script but via a non working extension. Intercept mostly bypasses SQF entirely when calling back to the game, instead getting direct access to the underlying C++ functions. Hello there, If you want to do something in arma, and do not want to use sqf you are completly wrong here, and in the game. There is no other way then scripting. Arma does not support any kind of native library hooking or so, to change or work with code in the game. DLL's or SO's are not meant as plugins or modules for arma. They are a link to systems like mysql or file write operations etc. But they do not work with the game itself. No dll you will ever write will be allowed by battleye to be executed as a client. SQF is a very easy to learn scripting language and requires no skill at all. Give it a try or forget about the idea of working with arma Regards Arkensor I know the extension system isn’t meant for this, but Intercept breaks through this to a point allowing for efficient bidirectional calls without needing SQF to call the engine or stringifying everything in sight. I’m not arguing that SQF is easy to learn, it is. It’s just a horrid design. I find it strange he hates SQF, its derived from c++ isn't it? There’s concepts that are shared (if/else, for, comments etc) but the overall syntax is very different. There's no such wall if you can get memory locations of native code interpreting SQF commands. Intercept extension dll is loaded directly into arma's process address space, it can call whatever function it has address of. No SQF interpreting in execution chain. Last time I checked this was called reverse engineering and it was illegal in some countries. However this is what geeks do from time to time in, for example, "educational purposes", but ffs, you never present this to wide community as a programming interface to anything. IMHO. I wouldn't rely on such interface in any serious project. Nevetheless, some mindblowing hours were spent figuring all this out. Amazing work. Kudos. I see no relation, really. All these classes and cpp/hpp file extensions only bring more confusion. Exactly, you can bypass SQF entirely with a bit of cleaver work. Also I agree with the cpp/hpp file comment, they share a little bit of common ground, but they’re not the same thing by any means. Now, I’ve personally worked with C#/VB/F#/JS/Lua/Python/Java/C/C++/D/ASM/SkookumScript, and then things like the UE4 visual scripting BP system… I would take any of the above over SQF (ok, maybe not ASM) What I think really needs to happen is BI integrate either the JVM or CLR. You can for sure sandbox the CLR for security which drastically limits what can be run, you could even go so far as reading the IL itself to make sure all the functions used where only what you allowed. This would allow for the full power of something like C#, the 4th most popular language, to be used within Arma. This means far more efficient scripts, far more secure from hacking attempts, far more resources for new people, far better tooling, far bigger supporting libraries. Share this post Link to post Share on other sites
killzone_kid 1333 Posted August 28, 2016 Intercept has mapping for handful of SQF commands, the rest of the commands, the creators suggest to utilise using normal call command invoked from within extension. Basically not much different to calling code from the game. I wish OP good luck and long hours of re compiling of his DLL for the mission every time he wants to change something, not to mention that it would require game restart. Share this post Link to post Share on other sites
Koderz 0 Posted August 28, 2016 Intercept has mapping for handful of SQF commands, the rest of the commands, the creators suggest to utilise using normal call command invoked from within extension. Basically not much different to calling code from the game. I wish OP good luck and long hours of re compiling of his DLL for the mission every time he wants to change something, not to mention that it would require game restart. Thanks for the help killzone and everyone else! To be honest recompiling a tiny dll like that wouldn't bother me that much. I'm used to working in the low levels of UE4, so even with Incredibuild that takes several minutes to recompile. I've come up with another path, and so have one short followup question. I get you can't use dlls for mp without battleye approving. Does that same restriction apply to the server? (For example this would be like the extdb thing that only runs server-side) Share this post Link to post Share on other sites