Game Dev Obstacles (split from Spring developer crisis)
Moderator: Moderators
Re: Game Dev Obstacles (split from Spring developer crisis)
Does one of you remember sunspot? That guy did it right. He showed up one day, asked for the api, showed some code, worked for two weeks. completed his modification, Vannished again (propably due to magnetic fields changing)
sooo the point is we were all superfriendly to him.
If you proof you are willing to work (and if it is only the willingness to open paint and paint a heightmap) even smoth becomes a purring ball of niceness. And like hell, we even tolerate those who dont want to contribute anything more then social comitment to the comunity.
Maybe not everybody gatecrashing here, is always nice either. The attitude: Me CEO, you nothing, do my work. Deserves nothing else.
sooo the point is we were all superfriendly to him.
If you proof you are willing to work (and if it is only the willingness to open paint and paint a heightmap) even smoth becomes a purring ball of niceness. And like hell, we even tolerate those who dont want to contribute anything more then social comitment to the comunity.
Maybe not everybody gatecrashing here, is always nice either. The attitude: Me CEO, you nothing, do my work. Deserves nothing else.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Game Dev Obstacles (split from Spring developer crisis)
To be honest this is also my experience of getting involved over the last year in game dev-ing. As soon as it was clear that I was contributing stuff I got lots of help & friendliness.
My experience is that the vast majority of unhelpful response & abuse that appears on these forums comes from that strange class of people who almost never contribute any content but somehow feel they've sat around long enough to start giving orders. This is probably my #1 dislike about developing stuff, although the idiosyncracy of lua syntax is competition
My experience is that the vast majority of unhelpful response & abuse that appears on these forums comes from that strange class of people who almost never contribute any content but somehow feel they've sat around long enough to start giving orders. This is probably my #1 dislike about developing stuff, although the idiosyncracy of lua syntax is competition

- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Game Dev Obstacles (split from Spring developer crisis)
Why do you insult lua syntax? I really don't get it. It is the most elegant and concise language.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Game Dev Obstacles (split from Spring developer crisis)
For example: If then ... end is silly, If{...} is all you need; easier to read and less typing. I also like to know what types my variables are and the whole thing with 0,nil is just wtf why as far as I'm concerned - especially I dislike the treatment of types since Spring.Echo(x) can return things that don't match whats actually there (e.g. if x is a function and the wiki has not made this clear, Spring.Echo(x) can tell you x is an empty table). I also have never found a proper way to empty a table (without iterating over its whole contents). Variables being global by default seems mad. I could go on... its things like this.
Re: Game Dev Obstacles (split from Spring developer crisis)
"then" "end" is a bit more verbose than {} but Lua made the choice to have explicit words, instead of odd punctation signs, which in the end makes it much more comprehensible than Perl : Imo Perl and Lua are similar, except Perl has arcane syntax. So { } is shorter but not easier.If then ... end is silly, If{...} is all you need; easier to read and less typing.
I enjoy not having to specify what my variables are. It's cumbersome to have to decice if I'll use an char, short, int, long, signed or not, every time I just need, like, an index. Lua autocasting also remove the trouble of number formatting every time I print a numnber.I also like to know what types my variables are
Beside, if you really want to keep track of your variable types, go use some variable naming scheme with a type prefix.
0 being truethy is a different convention from C, but once you get past that hurdle and get into Lua mindset, you realise the deal with nil is quite useful, for exemple to have default value with the (x or default) syntax or to handle variable argument number in your function calls.the whole thing with 0,nil is just wtf
Really? For me it prints "function" and its adress.Spring.Echo(x) can return things that don't match whats actually there (e.g. if x is a function and the wiki has not made this clear, Spring.Echo(x) can tell you x is an empty table)
Sometimes I wish print / Spring.Echo would print the content of the table instead of just "table" though.
Err, yourTable={}I also have never found a proper way to empty a table
A small annoyance is that to copy a table, you need your own function. And if that table can contains table, your own recursive function. And if that table can contains table that can contains the initial table, it gets more complex.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Game Dev Obstacles (split from Spring developer crisis)
This does not solve the problem with an API where you have to dal with variables of prespecified and sometimes unknown types (e.g. command options).if you really want to keep track of your variable types, go use some variable naming scheme with a type prefix.
Fair enough, I prefer to know.I enjoy not having to specify what my variables are.
0 and nil being different is not a "design convention", its a historical issue that they landed themselves with through trying to do without boolean variables in early versions of lua. (According to http://lua-users.org/wiki/ExpressionsTutorial)0 being truethy is a different convention from C
For me it will do this as long as the table only goes one-deep in terms of keys. However if I try to Echo a bitmask it usually pretends I've got an empty table. Iirc Niobium wrote a function for Echoing tables which is hiding inside some fo the BA gadgets.Sometimes I wish print / Spring.Echo would print the content of the table instead of just "table" though.
Etc, there are tonnes of operations on its data types, like sorting, copying, searching that lua could handle much better if you had to choose your own data types (instead of almost the current bare bones that it does have). This is no big deal for writing 200 lines of widget, but imo its a huge tool missing if I wanted to write anything bigger in lua.A small annoyance is that to copy a table...
Re: Game Dev Obstacles (split from Spring developer crisis)
Err, it was still a design choice to consider 0 as truthy, and to have another thing (initially nil, later also false) for falsy.
So far table.sort nicely handled all my sorting needs. Using well chosen keys for the tables can eliminate much of the searching needs, otherwise yeah big "for" loops. And there's the powerful regex-like patterns for searching in strings.
Having few types and few special functions is what makes Lua simple, and Lua simplicity is what makes it easy.
So far table.sort nicely handled all my sorting needs. Using well chosen keys for the tables can eliminate much of the searching needs, otherwise yeah big "for" loops. And there's the powerful regex-like patterns for searching in strings.
Having few types and few special functions is what makes Lua simple, and Lua simplicity is what makes it easy.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Game Dev Obstacles (split from Spring developer crisis)
In my view this is the root of the problem! It's a great language for writing 200 lines, and a dreadful one for writing anything big.Lua simplicity is what makes it easy.
Re: Game Dev Obstacles (split from Spring developer crisis)
It seems common complaint about Lua that Echo (table or even nested tables) does not print some nice output and how one has to make loops/rescursion. Is there any other language where this works?
Compare with http://stackoverflow.com/questions/1370 ... array-in-c
I think having this somewhat "easy" language is good, it makes it easier for new people to start. Maybe something else would be better for big things (debatable) but that is no use if everbody gives up in frustration during "hello world."
Compare with http://stackoverflow.com/questions/1370 ... array-in-c
I think having this somewhat "easy" language is good, it makes it easier for new people to start. Maybe something else would be better for big things (debatable) but that is no use if everbody gives up in frustration during "hello world."

Re: Game Dev Obstacles (split from Spring developer crisis)
I agree with the whole Lua sucks notion, but for different reasons.
I mainly hate it for not having classes and lacking libraries (limited in what you could use in Spring, and most of it also requires compilation).
It also oversimplifies things by having only one number type (a simple float, not BigDouble/BigFloat), and as you mentioned container classes are a joke and it has a poorer standard library than C.
It's also not as fast as a decent compiled language like C++/Java/C#, but that's a minor thing imo.
However the simplicity is what makes it easy for non professionals to use it and that's why it's often popular as a scripting language.
@ knorke: ye, it tends to just work with python, and even Java/C++ if you overload/create certain functions, "string toString()"/"std::ostream& operator<<(std::ostream& o)" (although C++ usually does it differently).
Besides there's no reason not to do it like that with Spring.Echo, I think I even suggested once that the official Spring.Echo gets wrapped up with what table.lua does. E.g:
I mainly hate it for not having classes and lacking libraries (limited in what you could use in Spring, and most of it also requires compilation).
It also oversimplifies things by having only one number type (a simple float, not BigDouble/BigFloat), and as you mentioned container classes are a joke and it has a poorer standard library than C.
It's also not as fast as a decent compiled language like C++/Java/C#, but that's a minor thing imo.
However the simplicity is what makes it easy for non professionals to use it and that's why it's often popular as a scripting language.
@ knorke: ye, it tends to just work with python, and even Java/C++ if you overload/create certain functions, "string toString()"/"std::ostream& operator<<(std::ostream& o)" (although C++ usually does it differently).
Besides there's no reason not to do it like that with Spring.Echo, I think I even suggested once that the official Spring.Echo gets wrapped up with what table.lua does. E.g:
Code: Select all
if type(o) == "table" then
table.echo(o)
else
Spring.Echo(o)
end
Re: Game Dev Obstacles (split from Spring developer crisis)
Hm, but in C++ it does not "just work."@ knorke: ye, it tends to just work with python, and even Java/C++ if you overload/create certain functions, "string toString()"/"std::ostream& operator<<(std::ostream& o)" (although C++ usually does it differently).
One can overload the << operator and then do cout << myCustomDataBla; and then it will work but still had to write the function yourself. Like decide in what order things get printed, what member variables even make sense to print etc. It is comperable to what one has to do in Lua.
Re: Game Dev Obstacles (split from Spring developer crisis)
<3Silentwings wrote:To be honest this is also my experience of getting involved over the last year in game dev-ing. As soon as it was clear that I was contributing stuff I got lots of help & friendliness.
My experience is that the vast majority of unhelpful response & abuse that appears on these forums comes from that strange class of people who almost never contribute any content but somehow feel they've sat around long enough to start giving orders.
As far as LUA I take the bad with the good and find it a joy to use. On my last trip I met an older guy who had a long career as a programmer. We discussed languages and he said he really enjoys lua for what it is and actually preferred it over python. Then again, he was writing stuff in corona for fun. I didn't get around to asking him why he liked lua over python, but it was an interesting sentiment.
I would prefer lua over C++ or any other compiled language because it's very nature FORCES you to show your code. There probably is a way to compile lua into something, but with C++/C it would be required. I am glad we are not using JAVA and honestly, am indifferent about python. The lightweight and open nature of lua is a joy because it is a fairly straightforward syntax(I do find metatables a bit odd) meaning I can learn faster by reading the code of others and vice versa.
having to compile something means you HAVE TO COMPILE IT FOR EACH OS/have to have a state machine for it. It also means your code cannot be directly read.gajop wrote: It's also not as fast as a decent compiled language like C++/Java/C#, but that's a minor thing imo.
Re: Game Dev Obstacles (split from Spring developer crisis)
Oohh, so Java/C# (other compiled languages that run on "VM"s) are bad but languages that need an interpreter get a free pass?
The main annoyance I have with compilation is that with C++ it takes time, other languages do it fast and run portable, so it's hardly an issue. If you really do need to recompile it.. well just do it, it's not that hard, can easily automate it and redistribute multiple versions under rapid for each OS/arch.
As you said, interpreted languages forcing people to show code is not true. One can compile both languages into bytecode:
Lua: http://stackoverflow.com/questions/8936 ... execute-it
Python: http://hackerboss.com/how-to-distribute ... lications/
You can also very easily decompile some languages, especially those that produce bytecode such as Java and C#:
http://stackoverflow.com/questions/2725 ... lass-files
C++ makes it a lot harder, and IDA pro is the most used decompiler, but that often produces unreadable code.
The problem with Lua is that a lot of Lua libraries require you to compile C/C++ code, so you are back at square one. I don't like reinventing the wheel each time I start working at a problem.
The main annoyance I have with compilation is that with C++ it takes time, other languages do it fast and run portable, so it's hardly an issue. If you really do need to recompile it.. well just do it, it's not that hard, can easily automate it and redistribute multiple versions under rapid for each OS/arch.
As you said, interpreted languages forcing people to show code is not true. One can compile both languages into bytecode:
Lua: http://stackoverflow.com/questions/8936 ... execute-it
Python: http://hackerboss.com/how-to-distribute ... lications/
You can also very easily decompile some languages, especially those that produce bytecode such as Java and C#:
http://stackoverflow.com/questions/2725 ... lass-files
C++ makes it a lot harder, and IDA pro is the most used decompiler, but that often produces unreadable code.
The problem with Lua is that a lot of Lua libraries require you to compile C/C++ code, so you are back at square one. I don't like reinventing the wheel each time I start working at a problem.
Re: Game Dev Obstacles (split from Spring developer crisis)
Today OpenJDK + JSR223 Scripting for Java Platform would be a viable option. There are ScriptEngine implementations for quite a few languages, including several for lua.
There's no right or wrong here. You also need to look at the historical perspective, the decision to adopt lua was taken many years ago. Options were fewer back then.
There's no right or wrong here. You also need to look at the historical perspective, the decision to adopt lua was taken many years ago. Options were fewer back then.
Re: Game Dev Obstacles (split from Spring developer crisis)
Nope.gajop wrote:Oohh, so Java/C# (other compiled languages that run on "VM"s) are bad but languages that need an interpreter get a free pass?
I said it is probably possible. Also it is NOT required like C++.gajop wrote:As you said, interpreted languages forcing people to show code is not true. One can compile both languages into bytecode:
Lua: http://stackoverflow.com/questions/8936 ... execute-it
Python: http://hackerboss.com/how-to-distribute ... lications/
key point. Variable names are lost etc.gajop wrote:You can also very easily decompile some languages, especially those that produce bytecode such as Java and C#:
http://stackoverflow.com/questions/2725 ... lass-files
C++ makes it a lot harder, and IDA pro is the most used decompiler, but that often produces unreadable code.
I think you ignored my key points. readability, open and simple to read. There are people who believe in optimizing code so strongly it becomes obfuscated to the point of being difficult to read and maintain. on something larger than "200 lines" readability is king to me.
Re: Game Dev Obstacles (split from Spring developer crisis)
Names of variables are maintained when you decompile Java class files, unless they are obfuscated.smoth wrote: I think you ignored my key points. readability, open and simple to read. There are people who believe in optimizing code so strongly it becomes obfuscated to the point of being difficult to read and maintain. on something larger than "200 lines" readability is king to me.
Writing code that is difficult to read is possible in any langage.
With JSR223 you could use say, groovy, here's an example groovy script:
Code: Select all
println "Hello, World!"
The key difference is that JSR223 would allow you to run groovy + lua + ruby + anything else you can implement.
Re: Game Dev Obstacles (split from Spring developer crisis)
I didn't, I just decided to ignore C/C++ because that's a special language, more similar in it's design goals to Lua than Java/Python/C# imo.smoth wrote: I think you ignored my key points. readability, open and simple to read.
To prove a point I took my Java AI's jar and decided to see how it would looked decompiled, and here's a comparison:

Left is decompiled, Right is original, pretty similar, don't you think?
Btw.. There are certain parts of Java that are overly complicated and really lack a simple version, and even if they are too powerful/good for rapid development they tend to confuse newcomers (think SOAP/WSDL/ORM/EJB stuff).
Still most of the time I'd rather learn the overly complex version which will save me pain later.
Re: Game Dev Obstacles (split from Spring developer crisis)
A big thing Lua has going for it is how easy it is to embed securely and sandbox to behave *exactly* as you need it to behave. Lua may not be the easiest language for game-devs to code with, but the ease of engine-developers coding to it is a whole other situation.
I mean, do you know if you could produced synced simulation code in C#? Python? Do you know if you could sandbox them? Sandboxing Python has had a long and nightmarish history.
In Lua, it's trivial for engine developers to control access to whichever functionality they want you to have.
Lua is far from a perfect language, but it's the right tool for the job. Probably the only real competitors in this space would be languages you'd like a lot less - Scheme-based languages, or javascript ones.
I mean, do you know if you could produced synced simulation code in C#? Python? Do you know if you could sandbox them? Sandboxing Python has had a long and nightmarish history.
In Lua, it's trivial for engine developers to control access to whichever functionality they want you to have.
Lua is far from a perfect language, but it's the right tool for the job. Probably the only real competitors in this space would be languages you'd like a lot less - Scheme-based languages, or javascript ones.
Re: Game Dev Obstacles (split from Spring developer crisis)
Well, you can have classes by using metatable and the :gajop wrote:I mainly hate it for not having classes
As for library, yes, no languages has as many libraries as C++, but Lua still can have libraries.
Re: Game Dev Obstacles (split from Spring developer crisis)
lua is ideal for what we use it for. I too disliked the abuse of 'end' coming from Python, Java and C but now it doesn't bother me in the slightest.
Pxtl covered the engine dev side of it pretty well, and Smoth the game dev side of it. Must we really descend into the internet's 50 billionth programming language discussion.
Pxtl covered the engine dev side of it pretty well, and Smoth the game dev side of it. Must we really descend into the internet's 50 billionth programming language discussion.
