Page 1 of 1

Binary API

PostPosted: Fri Nov 30, 2012 06:09
by aldobr
Pls provide binary API for compiled languages (C).

Just a kind of .DLL/.so that allows plugin development (like the lua side) using C.

The reason is to speed up servers and diversificate the possibilities of modding the game.

i believe lua is quite slow and too much code will make servers crawl...

Using lua for too much things will make minetest as slow as minecraft.

The main reason for minecraft to bee so slow is the use of bytecode language (java). Theoretically, java is faster than lua... Then, all gains aquired by using C++ instead of java will be lost in the lua side of things...

PostPosted: Fri Nov 30, 2012 11:53
by PilzAdam
You can compile Lua.

PostPosted: Fri Nov 30, 2012 12:10
by kaeza
aldobr wrote:Pls provide binary API for compiled languages (C).
Just a kind of .DLL/.so that allows plugin development (like the lua side) using C.


You can load native libraries from Lua.
Look here.

aldobr wrote:i believe lua is quite slow and too much code will make servers crawl...
Using lua for too much things will make minetest as slow as minecraft.


Lua is one of the fastest interpreted languages around IMHO. Anyway, if your computer cannot cope with all the mods, either remove some mods or get a better computer. Sorry.

PostPosted: Fri Nov 30, 2012 13:16
by tonyka
aldobr wrote:Pls provide binary API for compiled languages (C).

Just a kind of .DLL/.so that allows plugin development (like the lua side) using C.

The reason is to speed up servers and diversificate the possibilities of modding the game.

i believe lua is quite slow and too much code will make servers crawl...

Using lua for too much things will make minetest as slow as minecraft.

The main reason for minecraft to bee so slow is the use of bytecode language (java). Theoretically, java is faster than lua... Then, all gains aquired by using C++ instead of java will be lost in the lua side of things...


if you want to work in c or c + +, it makes sense to do it in the source code, about Lua is designed as a scripting language, implement a Java engine for scripting, would greatly increase the weight and resources, if it really is to have more control doing mods would be more logical to suggest other languages designed for this purpose as:
AngelScript, GameMonkey, Io, Pawn, Squirrel, and Scheme. Sometimes heavy-weight languages are also used, like Python or Ruby. These languages are usually quite a bit harder to embed, and aren’t know for their speed.

sorry for my bad English ...

PostPosted: Fri Nov 30, 2012 15:25
by madarexxx
I am agree with topic starter, but i think we need implement it in luaJIT library. It doesn't need sources rewriting, it uses fully compatible api with original lua library.
Does someone have LG p500 or p350? If you have it, you can see difference between stock 2.1.0 ROM and latest 2.1.1 :) The difference is that JIT was enabled later.
If nobody has this phones, i explain directly: Difference is AWESOME! It is MORE THAN 40-50% of performance!

PostPosted: Fri Nov 30, 2012 17:35
by aldobr
For example :

I want to make NPCs. Whats needed ?

1st - Path finding with ability to update path on the fly (If someone puts a block in one spot where the npc decided to walk, path needs to be recalculated). I dont believe lua is fast enough for this. Nos imagine the amount of calculations needed (some kind of A* adapted for 3d space) if NPC decides (needs) to walk from spawn city to new riverwood (redcrab server)... I dont believe Lua can do that fast enough (x number of NPCs).

2nd - object identification. NPC needs to search the current scene (centered around him) to find objects with wich to interact. I dont believe Lua to be fast enough to visit block by block to check whats what (This can be easier on the NPC if some kind of cache is used).

Etc...

PostPosted: Sat Dec 01, 2012 04:32
by kaeza
aldobr wrote:I want to make NPCs. Whats needed ?

Take a look at workers and towntest for inspiration.

aldobr wrote:NPC needs to search the current scene (centered around him) to find objects with wich to interact

Search for "find_node_near" and "find_nodes_in_area" here.


aldobr wrote:Path finding with ability to update path on the fly

I think workers has some kind of pathfinding, but I'm not sure.

Again if you want to "mod" (if that's the word) in C++ you have to get the source and change it.