Binary API

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Binary API

by aldobr » Fri Nov 30, 2012 06:09

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...
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Nov 30, 2012 11:53

You can compile Lua.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Fri Nov 30, 2012 12:10

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.
Last edited by kaeza on Fri Nov 30, 2012 12:24, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
tonyka
Member
 
Posts: 320
Joined: Sat Jun 16, 2012 04:08

by tonyka » Fri Nov 30, 2012 13:16

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 ...
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)
 

madarexxx
Member
 
Posts: 144
Joined: Sat Aug 04, 2012 06:49

by madarexxx » Fri Nov 30, 2012 15:25

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!
Sorry for my bad English, please help me learn it - correct my worst mistakes :)
 

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Fri Nov 30, 2012 17:35

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...
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sat Dec 01, 2012 04:32

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.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 4 guests

cron