Loading...
  OR  Zero-K Name:    Password:   

Programming language of ZK?

21 posts, 1738 views
Post comment
Filter:    Player:  
Page of 2 (21 records)
sort
7 years ago
I have heard the language of ZK is called lua, and I have looked around and found this website:
https://www.lua.org/faq.html#2.4

(Forget the last part, that was me looking at it)
Is this website correct, and if not, what is the website Lua is in?

Thank you.
+0 / -0

7 years ago
Zero-K is written entirely in brainfuck. You can't understand it, don't even bother.
+4 / -1
7 years ago
Hacksaw
+0 / -0

7 years ago
NZrankhedgehogs
AFAIK it is written in C++, and LUA is only used as scripting language and data driven code.
I've used both in the video game industry, and are a really good combination.

And that URL is correct.
+3 / -0

7 years ago
TLDR: Yes, it's Lua

In more detail:

game + chobby = Lua
engine = C++
infra and original ZKL = C#
minor extra in both engine and game = GLSL
AIs = Java, C++, Lua
+8 / -0
Github can read all of those and make them coherent?


The engine is all the physical simulations, callins, stuff like that?

Do I read the online version of the book, the very first one, which is still relevant but somewhat changed today?
+0 / -0

7 years ago
Please don't feed NZrankhedgehogs 's delusions. Even if you tell him how it works he'll just pretend to understand it, and at this point the chances of him making any real contributions are exactly zero.
+3 / -1

7 years ago
quote:
Github can read all of those and make them coherent?

In real-time, sir!
+6 / -0
This is just so cute :3

For real though: NZrankhedgehogs it's definitely worthwhile to understand the way computers work and how you can program them to work for you. If you're interested in learning a programming language, definitely go for it!

However, ZK and spring are orders of magnitude beyond what you can understand at this point. It's as if you're looking at a car from the outside while knowing how a tricycle works, so all you know are wheels and maybe pedals. You cannot understand how a motor or an entire car works if you only know about wheels. And you certainly can't make the car run better in that position. Well, ZK/Spring is that car.

If you dedicate yourself to it, you may (in a few years time) have a good idea of how a car works. You'll probably have looked at bicycles, steam engines and maybe motorcycles on the way to understanding car components. It's still a long way to actually improve a car from there, but you can likely fix small issues in your own car. (Translated: It takes some time to learn programming to the degree that you can help others with their stuff).

Same thing for ZK/Spring and Github: You essentially just asked us if the speed indicator of a car can really use the fuel even though it smells so awful. As you probably know, that's not what a fuel indicator does (or how a car accelerates, or what matters about fuel), and in fact it's not even necessary (although useful) to have a speed indicator in a car. Even though these things are connected, the way they work together is much more complicated than you can imagine right now.

Again, I definitely encourage you to investigate programming in general, it's a great skill to have and opens up many doors later in your life. Just be aware that you're currently at the tricycle stage.
+10 / -0
7 years ago
Z#
+5 / -0
If you follow the wonderful advice of GBrankTheEloIsALie I thoroughly recommend
https://learnpythonthehardway.org/book/
for anyone trying to learn programming.

It's not useful for ZK directly, but it's a wonderful language to start with.


EDIT: I won't be dragged into language wars
+2 / -0

7 years ago
I like Elol's analogy. Being able to drive a car does not qualify you to fix or design one, and for that matter for someone who can only use two factories badly you should really be concentrating more on learning to drive.

Personally I think python is a crap language. All of its flow control statements are inside out and backwards (compared to every other programming language as well as to how computers actually execute the code), it doesn't have real OO or real data structures, it uses god awful semantic whitespace, and practically the only good thing about it is the ridiculous number of libraries available. Well, that and it's not a broken piece of crap like perl. Compared to lua or javascript python is barely even readable.

https://learncodethehardway.org/javascript/ does exist though. Since javascript is C-like it's a pretty decent starting point. If you can learn javascript then lua or java or C# are just a small step from there. C and C++ are widespread but you have to deal with manual memory management and raw pointers and arcane syntax which are things that a beginner does not need to be worrying about (and which cause problems even for experienced programmers).

The main downside of javascript is that it's a prototype based language, which gives it incredible flexibility but is well beyond anything a beginner could hope to understand without the experience and context to back it up. On the other hand that flexibility is also similar to what you can do with tables in lua so I guess it's at least relevant.

One piece of advice if you do decide to try to learn programming, it's really difficult to learn programming without a real project in front of you. The toy projects that you usually find in programming tutorials tend to be meaningless and will quickly become a barrier to progressing further, so once you understand the basics of variables, functions, loops and so on I suggest you grab a copy of ZK's source and find something that you actually want to do. Because ZK is in lua you don't have to compile anything to run it which makes it really easy to jump right in and hack away. If you're writing widgets you don't even need to quit the game to test changes, just type "/luaui reload" in game and hit enter ("/luarules reload" for gadgets).
+2 / -0
Well since we're all throwing in our opinions, I'd like to advocate strongly typed languages. The more explicit you have to be about what you intend, the easier it is for the computer to tell you when you're doing something wrong/dumb. Also, OOP is so much prettier in them.
But I can definitely see the merits of a "throw a line into an interpreter and things happen" start to programming. No confusing auto-generated text bodies, no "arcane" steps to follow to achieve what you want. Then again, if you want to have some kind of UI (which I highly recommend, "click this button to read in the value in this edit and display it in this label" is such a great basis to explore out from), you won't really get around this.

I fully agree that wanting to implement some idea, some project, is one of the best ways to learn - a friend of mine (which I would've never expected to be the coder type) got so into developing his own space ship game (including everything from databases over UI, 3D graphics and game logic to website design) that he started neglecting his engineering exams. It's important to balance your ambition (and stamina) with the scope of your project though - don't try and build Starcraft III as your first programming exercise. Trying to make a dot move, or even Pong (which, as I just learned, was only an exercise for its creator, too!) might be a good start though.
+2 / -0

7 years ago
Personally I think OO and strong typing are things that you should avoid until you have some level of knowledge and experience. Both are certainly very useful, but type systems are complicated and OO is something that takes some getting used to before you can really understand how to use it properly. Unless you already have a decent theoretical and practical background you're unlikely to understand either one.
+1 / -0
Skasi
7 years ago
quote:
I like Elol's analogy.

I like Elol's new nickname!
+2 / -0
quote:
Well since we're all throwing in our opinions, I'd like to advocate strongly typed languages.

QFT

Proper object-oriented programming you can leave until you feel like it, but shooting yourself in the foot because the language let you do something you shouldn't have done is painful.
+0 / -0

7 years ago
quote:
Proper object-oriented programming you can leave until you feel like it, but shooting yourself in the foot because the language let you do something you shouldn't have done is painful.


Most modern languages including python, lua and javascript are strongly typed. They all throw errors if you try to do something invalid, although only runtime errors which means you have to perform fairly exhaustive testing to rule out the possibility of derp, which can be pretty tedious and painful. If you use java or C# then type errors are compile time and your IDE will usually point out the derp immediately. Then there are still null pointer errors, array bounds errors and so on which won't be caught until runtime. Not having proper exception handling is even worse, because then if you screw up you won't even get an error (another good reason why newbs should avoid C/C++).

Still, most of that stuff does no good unless you know what it means and how to use it.

Also, I just noticed something..

quote:
Is this website correct, and if not, what is the website Lua is in?


You don't need to "download lua". Spring runs lua internally by some magical means that I don't particularly understand, so if you have spring you can already run lua. You might want a lua IDE however (although technically you can use notepad or wordpad if you're a masochist), of which there are not many choices and none of them are particularly good. Eclipse can supposedly handle lua, but eclipse is ridiculous bloatware which is extremely excessive and suffers from memory leaks. Personally I use Decoda which is reasonable but still kind of sucks. You can also use Notpad++, which is sort of useful but I mainly use that for writing GLSL shaders with the GLSL syntax plugin. I don't use it for lua because it doesn't give you any function navigation which makes things much harder than necessary.
+0 / -0
quote:
and javascript are strongly typed. They all throw errors if you try to do something invalid

https://www.destroyallsoftware.com/talks/wat
I think you'll also have a hard time finding support for (vanilla) javascript being strongly typed.

PS: It's not my fault that lowercase L and uppercase i look the same in the forum font - pretty sure that wasn't an issue when I chose that name :(
+2 / -0


7 years ago
I've found ZeroBrane to be an alright Lua IDE, though it's a bit tricky to do any kind of widget development with an IDE since each widget is basically just a set of event handlers for engine events, rather than a complete program. ZeroBrane does help a lot for basic syntax errors, though.
+1 / -0
7 years ago
Necro-

What does pressing "download lua" do?
+0 / -0
Page of 2 (21 records)