About Store Forum Documentation Contact



Post Reply 
Lua integration
Author Message
kulesz Offline
Member

Post: #1
Lua integration
When developing some software using a game engine, it is important to have as many things in one place as possible. Maybe integration with lua scripting language would be a good idea, instead of using external libraries like luabind?
10-24-2011 04:24 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #2
RE: Lua integration
NPC behaviours, item actions, enemy actions, configuration scripts, world settings, quests, some game mechanics... There's quite a lot of this :-)
10-25-2011 05:56 AM
Find all posts by this user Quote this message in a reply
Seba Offline
Member

Post: #3
RE: Lua integration
10-25-2011 09:11 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #4
RE: Lua integration
I know this tutorial and I know, how to use LB. But it would be good to have such feature integrated with engine.
10-26-2011 06:00 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: Lua integration
I'll more likely develop my own scripting than integrate lua
10-26-2011 10:56 AM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #6
RE: Lua integration
Won't it make a little less "compatible" (like UnrealScript compared to C# in Unity)? Lua is quite a popular scripting engine.
10-26-2011 11:26 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #7
RE: Lua integration
(10-26-2011 11:26 AM)kulesz Wrote:  Won't it make a little less "compatible" (like UnrealScript compared to C# in Unity)? Lua is quite a popular scripting engine.

Yeah quite agreed. Actually we are using them ourselves but mostly for AI purposes. As for the rest, we use C++
10-27-2011 10:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #8
RE: Lua integration
I cannot agree... Even when you have a small team, 1-3 members, no matter how big the project is, scripting is a great tool.
Let's take an NPC AI... You can have a hundreds of characters, each with tons of lines of text, tons of behaviors and characteristics. Now:
Make a spelling mistake in quest - recompile the code
Make an error in player attributes - recompile the code
Make a mistake in filename - recompile the code
Add a new character - recompile the code
etc...

The same applies to level triggers, item actions and a lot of things...

In case you have these things in scripts, you don't even need the IDE.
I'm a programmer and my part is a code. I've got one person for graphics and a game designer, who is responsible for such things, as stated above - he doesn't care about the code, he doesn't waste time for hours of compilation... He just corrects the script and tests, sometimes there's even no need to restart the game. It boosts the project dramatically.

Personally I work as an A.I. programmer and I'm writing from my own experience - there's a lot of things that can be done with scripting. It saves our time (and therefore - money), makes coding easier and helps to control the code in a long term. Hardcoding is NEVER a good option, especially, when you have to set rules for entire game world.

And it doesn't matter, if you are a single indie or 50 people team.
(This post was last modified: 10-27-2011 05:00 PM by kulesz.)
10-27-2011 04:56 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #9
RE: Lua integration
@ kulesz

Yes I absolutely agreed with you. This is also the reason why we opted to use LUA for our AI Scripting instead of everything done in C++. Its the flexibility to modify the scripts without needing to touch and recompile the core program every time we do some changes on the AI. And we have a very tiny team and using this method (as you mentioned above) gave us the flexibility that we needed.
10-28-2011 08:03 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Sadahar Offline
Member

Post: #10
RE: Lua integration
AI server side FTW grin (C#)

Btw, compiling a single cpp (the new AI change) in my enviroment takes about.. 2 seconds?
Recompiling whole project less than 30 seconds.
Use optimizations and precompiled headers... learn about compiling options.. it will boost your project as you said grin

Also lua is pretty slow, maybe just too slow if the AI's load is too heavy.. you wont have such problem with C++, also consumes more memory.

Maybe a better solution is to keep AI in a separated DLL? I (personally) dont like Lua grin
(This post was last modified: 10-28-2011 12:41 PM by Sadahar.)
10-28-2011 12:40 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #11
RE: Lua integration
But you can have the bottle-necks of AI system written as functions in code.
For example you don't need to scan environment for nearby enemies. You can write a function in game and make it visible to the LUA code, so it won't need to make these operation itself.
10-28-2011 01:54 PM
Find all posts by this user Quote this message in a reply
Demostenes2 Offline
Member

Post: #12
RE: Lua integration
(10-26-2011 10:56 AM)Esenthel Wrote:  I'll more likely develop my own scripting than integrate lua

Why? Integraration de-facto industry standard would be timesaver, because nobody have to learn any proprietal language.

Anyway I support any scipting language, it makes developement much faster and far less demanding on resources. Scripting can by done by almost anybody, C developement not.
(This post was last modified: 11-28-2011 11:48 PM by Demostenes2.)
11-28-2011 11:47 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #13
RE: Lua integration
(11-28-2011 11:47 PM)Demostenes2 Wrote:  
(10-26-2011 10:56 AM)Esenthel Wrote:  I'll more likely develop my own scripting than integrate lua

Why? Integraration de-facto industry standard would be timesaver, because nobody have to learn any proprietal language.

Anyway I support any scipting language, it makes developement much faster and far less demanding on resources. Scripting can by done by almost anybody, C developement not.

could not agree with you more, but this is one of few areas where esenthel just wont listen smile we had quite some cat-fights over this and he did it anyway smile

so it puts us to a place where if we want a real scripting language we got it to do ourselves, and its perfectly fair. Maintaining code editor now after its more or less done takes significantly less than maintaining a wrapper of some scripting language would. besides i think that not every single method of engine should be exported to scripting language, as SL is meant to just implement game logic, and those functions are to be provided by game programmers, not engine maker. therefore scripting language should also be burden on game programmer's shoulders, dont you think?
11-29-2011 01:19 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #14
RE: Lua integration
(11-29-2011 02:00 PM)aceio76 Wrote:  I'd rather compile game logic stuff smile I'm on the other school of thought.

that is also very fair point. i mean - what is the use of implementing scripting language if it will have max 20 lines of code for your puzzle game, and noone besides you will edit those 20 lines, and you will do it only first time when you create the level ^_^
11-29-2011 06:59 PM
Find all posts by this user Quote this message in a reply
Post Reply