Jump to content

Lua Variable Lifespan


Oblivionburn
 Share

Recommended Posts

Shouldn't this fall outside the scope of NDA, since it's a general question of how Lua functions within the framework of a persistent mmo?

Or can Lua be limited/controlled by a game's engine, and thus it being a proprietary thing specific to Dual Universe's engine that would mean it falls under NDA?

Link to comment
Share on other sites

Yeah, but it would stay in RAM so long as the server remained running, wouldn't it? I would imagine it'd be the same as any other program that allocates memory to a particular variable and holds that memory slot so long as the program is running, else there would be a memory violation exception... but I've never dealt with server/client architecture, so I'm not entirely certain if that would be true for this mmo or if there would be garbage collection methods in place for Lua variables?

Link to comment
Share on other sites

I don't know of any game engine or server infrastructure written in Lua.

 

Unengine certainly isn't written in Lua.

 

I don't think persistence of data has been addressed by Novaquark publicly, so any further information is NDA.

Link to comment
Share on other sites

There's a lot of games that use embedded Lua to do stuff in-game, despite the game being written in like C/C++ or something. Easy example: ComputerCraft mod for Minecraft. Minecraft was written in Java, but the mod allows in-game Lua execution... and I'm guessing some framework behind the scenes to translate particular Lua methods to Java for the events to occur in the game. However, in the example of that mod for Minecraft, the Lua variables only get allocated memory during execution of the Lua... as soon as execution is complete, the variables are empty and that memory is flushed. It basically functions as a one-time run script, as opposed to a native part of the game's engine that would be held in RAM so long as the game is running.

 

Lua's been discussed in multiple Dev Blogs (else we wouldn't know about it), so should be fair game to discuss.

Link to comment
Share on other sites

There are a couple of different ways of saving data within Lua.  You can write the variable to a file, or you could upload it to a database.

 

This is basic Lua that you can be found in any tutorial.

 

If Novaquark has implemented a method to save data persistently, they haven't mentioned it publicly.

 

Whether that feature exists, or not, I'm very happy with the alpha and believe its worth the price of admission.  Questions along these lines can easily be answered withing the NDA forums or the NDA discord channel.   

 

Link to comment
Share on other sites

8 hours ago, Oblivionburn said:

Is there a lifespan to how long a variable in Lua will retain its value in memory, or with this being a 'persistent universe' do variables never lose their value once assigned?

LUA scripts run client side, so my guess is that variable lifespan is as long as client running script is connected to the game and in close proximity to control element.

Link to comment
Share on other sites

4 hours ago, spaceforger said:

LUA scripts run client side, so my guess is that variable lifespan is as long as client running script is connected to the game and in close proximity to control element.

Does it? They've talked about industry machines using Lua that continue to run even when you're not logged in and nobody's around, which makes me think it's being handled server-side. It would make sense for it to be a client-side thing, but for stuff to continue to happen in the world for objects that are utilizing Lua scripts... I dunno, man. It's all very interesting to me.

Link to comment
Share on other sites

1 hour ago, Oblivionburn said:

Does it? They've talked about industry machines using Lua that continue to run even when you're not logged in and nobody's around, which makes me think it's being handled server-side. It would make sense for it to be a client-side thing, but for stuff to continue to happen in the world for objects that are utilizing Lua scripts... I dunno, man. It's all very interesting to me.

machines run if you are offline but there are enough resources, not LUA scripts run while you are offline and yes, i am 100% sure because devs said that running millions of scripts server side is too costly ;) that's why LUA script is only applied when client is online AND in close proximity to control element

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...