NWNX
Liareth
Member Posts: 74
We expect the initial release to be some time this weekend. The first release will be .so and .nss only. More on available functionality to come.
I've set up a Discord channels for discussions related to NWNX. Feel free to pop by if you want to know how you can contribute or how the changes effect you or if you have any other questions.
Discord: https://discord.gg/hxTt8Fr
Code: https://github.com/nwnxee/unified
I've set up a Discord channels for discussions related to NWNX. Feel free to pop by if you want to know how you can contribute or how the changes effect you or if you have any other questions.
Discord: https://discord.gg/hxTt8Fr
Code: https://github.com/nwnxee/unified
Post edited by Liareth on
15
Comments
- Initial release is just .nss and .so files.
- Code will be open sourced some time in the future
- Debugging symbols as such will not be available; however, the new NWNX API exposes all NWN functions and structures so there is very little to reverse engineer. Browsing code in IDA will be harder though.
- NWNX is Linux only for the time being, but may be ported to other platforms eventually - code is written such that allows this, but it is extra work that is for now better spent elsewhere. Once ported, all plugins will be available on all platforms.
- Server deployment via docker is currently being evaluated
List of plugins to be available at release:- NWNX_Administration.so
- NWNX_BehaviourTree.so
- NWNX_Chat.so
- NWNX_Core.so
- NWNX_Creature.so
- NWNX_Data.so
- NWNX_Events.so
- NWNX_Metrics_InfluxDB.so
- NWNX_MoveSpeed.so
- NWNX_Names.so
- NWNX_Object.so
- NWNX_Optimizations.so
- NWNX_Player.so
- NWNX_Profiler.so
- NWNX_Repair.so
- NWNX_Ruby.so
- NWNX_SQL.so
- NWNX_ThreadWatchdog.so
- NWNX_Tracking.so
In the channel Liareth also posted a few code snippets that show how easy it is now to write plugins. This is just a random excerpt for the curious:https://gist.github.com/mtijanic/3b36edd02df330b613fdfa15580ab9f3
I have one question about NWNX and the new amazing NWN Enhanced.
Even if it seems that server side there will be no problems, what about client side?
Actually many featuress are unlocked by using NWNCX. Mainly NWNCX allows to visualize some new graphical aspects (examples: visual effects on the weapons), unlock the camera and, one of the most important, load the custom content at the creation of the character (it means that if you introduce new skills, new domains or new feat they can be choosen at the creation).
I am afraid that recompiling the client NWNCX will stop to work. Did you consider also this aspect?
Thank you so much guys for your work and let me know if I can contribute somehow!
We don't support NWNCX at the moment. There are a few reasons why we've made this decision:
- Security on the server side. On 1.69 we have seem existing servers crash (accidentally!) because of other server's alterations to the netcode through NWNCX plugins. We have hardened the server significantly since them, but exposing the netcode to modifications is still a risky proposition and we don't want to encourage it.
- Security on the client side. It would be trivial for any developers to create an infected plugin and distribute it. Even if, as a plugin consumer, you trusted the developer completely, there is still no infrastructure in place for signing plugins or ensuring their authenticity. Each server would have to do this on their own, and being practical here - very few would.
- (regarding both of the above:) It is certainly true that exploiters will find exploits with or without symbols or an API, but their job is made much more difficult if an API and/or symbols are not provided.
- Workload on the NWNX team. At launch we're shipping with only one target - Linux. We're doing this because we don't have the resources available to supports Windows right away. If we were to support NWNCX, it would increase the number of supported platforms to 4. We simply cannot accommodate this at the moment.
That isn't to say it isn't possible for you to do on your own - but we won't ship an API for it and the client symbols won't be released for NWN:EE.
I know this news might be disappointing to you, but I hope you can understand. I will say, however, that NWNX development is not a dictatorship. The project belongs to those who came before and those who will follow in the future as much as it does those who maintain it now. This post simply reflects what we will make available at launch, and it's possible that the state of affairs might change in the future.
I strongly encourage you to file feature requests so we can introduce the functionality you rely on into the main game and make it available to all developers, rather than those who use a specific NWNCX plugin. Can you imagine what the modding scene might look like in six months, if we roll all of the advanced custom functionality available on all servers, into the base game for everyone to use? Coming from a background working on a hak-less server, Arelith, the prospect really excites me, and I hope it excites you, too.
I am glad to say that these changements looks amazing and they did not disappoint to me. Everything new is well accepted.
I am Admin in one of the biggest Italian server and I am using NWNX for many many things.
However, exactly how you said, I had to trust the developer in the past but I realized that many features were uncompleted and I had to finish them by myself.
In these days I will show you what I have done and how I used NWNX to develop systems that improve the RPG experience in multiplayer, and especially what I've tried to do to further improve.
Btw you are doing a great work guys.
@NobAkimoto Actually, NWNX for EE was rewritten from scratch and doesn't have any original NWNX code in it, so it is "free" from the GPL. It will still be open sourced, but as far as I know, the actual license still hasn't been decided on.
@NobAkimoto GPL has nothing to do with the new NWNX - it shares no code whatsoever with the old NWNX. We haven't settled on a license yet for the new core.
Edit: Damn, beaten by a second!
Also I assume that if we get all structures and methods there's no problem to move some logic outside nwn as we can call them from something completly external.
One more thing, does nwnx will still work on strings? After all this years getting back to nwnscript without objects, collections and everything that's normal for current languages sounds like a nightmare by it's own. I really don't want to get back to writing super complexed toString() methods in nwn and parsers for those strings in plugins.
Something already happened before with Wyvern crown of cormyr and the old DLA team.
Regarding data to/from NWNX - this is handled with strings internally still, but it is stack-based rather than all in one local variable, and each string has type information embedded inside of it, so pushing or popping the wrong types will result in an exception (and an error thrown to stdout). It's a little slower this way but much safer and more user friendly, and in my experience the speed cost is irrelevant compared to other more important factors.
It might make more sense for me to show you the full implementation of a plugin, which is a port of nwnx_chat:
https://gist.github.com/ScholarMidnight/3fd7d008fff3676d32153a3abd3fab3b
Will be support for multithreading too?
https://gist.github.com/ScholarMidnight/e2d2cdc77da67f0407b11a83de20123d
Though I will say that the Task service is the most poorly written service, and I want to rewrite it.
You can use std::thread if you want, but currently it's up to you to implement synchronization.The SQL plugin may eventually support offloading the DB operations to another thread,
and we may down the road add a nicer API to start a worker thread and signal a NWScript event from itLooks like this already exists, see above. I hadn't noticed it.
Are there any plans for wrappers for higher level languages? I see there's nwnx_ruby, but are there any chances for port or new implementation of nwnx_jvm or nwnx_lua? With new api and exposed methods and structures this could be game changer.
- I have updated all of the plugins to work with the latest head start build.
- Unfortunately, I cannot distribute this NWNX build, as the binaries contain symbol information which I cannot strip. That means that the binary release and the source release will need to be linked. Getting this done is my top priority, but the exact information we can release is something that needs to be decided by the higher-ups. I can't give an exact estimate on this, but I can say for certain that it won't be before Tuesday the 28th.
Thanks for the reply, Liareth. To narrow down my primary NWNX focus a bit: Would it be more worthwhile as a fan to suggest/encourage NWScript feature changes to the toolset that mimic NWNX behavior? In other words, from a purely business standpoint; is it less expensive or time consuming for you to port over what exists in NWNX to NWNX EE, or is it just as expensive or time consuming to add new NWScript functions to the toolset?
I am specifically thinking of the new SetTag function, which was great to see in EE. Previously that was only possible through NWNX, but now it's a NWScript function in the toolset. So as we're looking forward, pretty much everything the nwnx_funcs library is really useful (GetFirstArea, GetNextArea, SetAbilityScore, SetRace, etc, etc, etc). If they are moved to the toolset rather than ported to the EE version of NWNX, that would more quickly open up use for non-Linux servers and (maybe even better) would make them available to single player module creators who don't use NWNX at all.
BUT, the problem here is that, from a business standpoint, I'm guessing it is cheaper for Beamdog to port existing NWNX functions, rather than add them into the toolset. I'm hoping I'm wrong though, or I/we may be able to convince the company of the value in setting up previously NWNX-only scripting functionality in the EE toolset.
Might you have an idea if you would be porting NWNX functionality into the base game prior to the EE's official release (hopefully!), or would all that be done sometime after it becomes generally available?
We're adding things all the time - this is what this beta is for (among other things).
https://nwnx.io/storage/pre-releases/8149-prerelease.zip