Forums » General
What language is vendetta written in?
I have an interest in programming, and was just wondering what language the server and client apps are written in. You use openGL for the graphics, right? Hence the portability?
The client and server are each written in a mixture of C++ and Lua - the server uses Lua far more than the client does, though.
We have a compatibility layer which we built backends for OpenGL, DirectX 8.1, and DirectX 9 (and actually DirectX 6 & 7, early on). On OS X and Linux, obviously, we only use OpenGL.
We have a compatibility layer which we built backends for OpenGL, DirectX 8.1, and DirectX 9 (and actually DirectX 6 & 7, early on). On OS X and Linux, obviously, we only use OpenGL.
Ah, cool. Ive been working in OpenGL/C++ since high school, and had to learn Lua for a programming class I picked up at CMU. Might I ask why you use it? Its so high level and disgusting, wouldnt it be better if it were all in C++?
Lua doesn't do any heavy lifting. All the performance-important parts are done in C++ (hence almost all of the client being written in that). For lightweight, reptitive tasks, however, a flexible scripting language can be a real boone. A lot of games use lua for event/behaviour scripting (baldur's gate, various others). We use it for missions, high-level AI, and lot of other things on the server.
Ah, cool. That makes sense.
I think a lot of the guide functions and command structure use Lua as well.
Yeah, I was just talking with my friend about it, he hates Lua too, but concedes that its used for almost all of the addons and scripting for WoW. Since we are both interested in MMORPG, weve repented our original position and have decided to actually become 'fluent' in it.
(Coroutines are fun, but I still think typeless variables and metatables are just asking for trouble (IE really, really hard to find bugs -.- Had some bad experiences there.))
Anyway, if you want a high quality volunteer programmer, or if anyone does, you can drop me a line at davvblack(at)gmail.
(Coroutines are fun, but I still think typeless variables and metatables are just asking for trouble (IE really, really hard to find bugs -.- Had some bad experiences there.))
Anyway, if you want a high quality volunteer programmer, or if anyone does, you can drop me a line at davvblack(at)gmail.
Theres a short tutorial on gamedev which describes why a scripting language is essential in any game that has any dynamic behavior, especially things like doors opening in a RTS.
http://www.gamedev.net/reference/programming/features/lua/
The introduction should answer your question to why use a scripting language.
http://www.gamedev.net/reference/programming/features/lua/
The introduction should answer your question to why use a scripting language.
Fascinating. I suppose Ive yet to deal with projects truly so massive that a full compile isn't reasonable. I've also built my own sort of on the fly scripting systems, but the downfalls and impracticality are obvious.
So I suppose Lua does exist for a reason, though there are some things it rather inhibits. If you want an AI routine to do heavy lifting, for example, you couldn't do it. Like if you wanted a 8-deep, decision tree for next moves in combat, or deeper, you could hack that together in C and perhaps dynamically load things like threasholds and such to tweak it without reinstalls.
If anyone here is into game programming and has some free time on their hands, I really would love to discuss practical matters like this. So much cool here.
ps... that site says lua is open source, but lua.org says its copyrighted and free. Not that this is relevant per se...
So I suppose Lua does exist for a reason, though there are some things it rather inhibits. If you want an AI routine to do heavy lifting, for example, you couldn't do it. Like if you wanted a 8-deep, decision tree for next moves in combat, or deeper, you could hack that together in C and perhaps dynamically load things like threasholds and such to tweak it without reinstalls.
If anyone here is into game programming and has some free time on their hands, I really would love to discuss practical matters like this. So much cool here.
ps... that site says lua is open source, but lua.org says its copyrighted and free. Not that this is relevant per se...
An 8-level decision tree is well within the range of a scripting language like Lua, Python, Perl or Ruby. For most things, these languages have minimal performance difference when compared to C, but the vast advantage of (since they're ducktyped) being immune to a lot of the bugs that affect things like C's "string" implimentation (or, rather, char *). Yay for no more buffer overruns! By heavy lifting, incarnate means things like rendering and such. I mean, the fact that most of the server (and the website, in fact) is written in Lua should give you that idea. Lua also has many more uses than just the 4 listed on that linked site (which was pretty good). Homeworld2 uses it for pretty much everything non-cpu-intensive (IE: All AI, pathfinding, menus, levels, etc). Oh well. I still say Ruby's better. :D
heh, Ruby to me seems to be weird cross of python meets perl. what you want is Perl6 / Parrot. :-)
anyway, after working with Common Lisp for enough time to _get_ it, ("The art of the metaobject protocol" should be essential reading for anyone doing Computer Science) the whole performance thing is just annoying to hear complaints about.
I've done faster IO in perl than C. I've done faster pure Common Lisp number crunching than both C and Fortran with the same algorithms. and as for OpenGL, the language doesn't matter _that_ much, I've seen a fair bit of really heavy openGL stuff done in python. as far as I remember, EVE also has a huge amount of stuff done in python. the myth that C++ is faster by default than other stuff is plain wrong. put into the right hands, yes, it can be. it doesn't, however, matter if your language is assembly if your code isn't written to be fast. and lets face it, premature optimization is debugging hell.
as for loose / week / delayed type definitions, well, again, I don't see a problem with it. in my experience people more often make pragmatic mistakes as compared to doing silly things with syntax or semantics. yet another annoyance with C / C++ is that it's un-frigging-beliveably hard to verify machine wise. when you're basically passing memory around, it's hard to be able to tell you're actually passing something valid throught the system. I've worked with people who write verifying systems to monitor applications, and after spending some time in that department, I more or less stopped my already limited usage of the C family. actually, most languanges share that trait (perl is just as bad). I am however somewhat surprised to see so little use of functional languages (or Common Lisp) in certain contexts.
but, anyway, up until a certain point, the most important thing is that the devs of any project work with languages and tools they are comfortable with and that are effective for them. let's just all agree on all incarnations of BASIC being bad for you. :-)
anyway, after working with Common Lisp for enough time to _get_ it, ("The art of the metaobject protocol" should be essential reading for anyone doing Computer Science) the whole performance thing is just annoying to hear complaints about.
I've done faster IO in perl than C. I've done faster pure Common Lisp number crunching than both C and Fortran with the same algorithms. and as for OpenGL, the language doesn't matter _that_ much, I've seen a fair bit of really heavy openGL stuff done in python. as far as I remember, EVE also has a huge amount of stuff done in python. the myth that C++ is faster by default than other stuff is plain wrong. put into the right hands, yes, it can be. it doesn't, however, matter if your language is assembly if your code isn't written to be fast. and lets face it, premature optimization is debugging hell.
as for loose / week / delayed type definitions, well, again, I don't see a problem with it. in my experience people more often make pragmatic mistakes as compared to doing silly things with syntax or semantics. yet another annoyance with C / C++ is that it's un-frigging-beliveably hard to verify machine wise. when you're basically passing memory around, it's hard to be able to tell you're actually passing something valid throught the system. I've worked with people who write verifying systems to monitor applications, and after spending some time in that department, I more or less stopped my already limited usage of the C family. actually, most languanges share that trait (perl is just as bad). I am however somewhat surprised to see so little use of functional languages (or Common Lisp) in certain contexts.
but, anyway, up until a certain point, the most important thing is that the devs of any project work with languages and tools they are comfortable with and that are effective for them. let's just all agree on all incarnations of BASIC being bad for you. :-)
> ps... that site says lua is open source, but lua.org says its copyrighted and free. Not that this is relevant per se...
All open source stuff is copyrighted, it's just licensed with a free/open license like the GPL or any of the other many open source licenses. The only things that are not protected by copyright laws are things that have passed into the public domain, and public domain != open source.
All open source stuff is copyrighted, it's just licensed with a free/open license like the GPL or any of the other many open source licenses. The only things that are not protected by copyright laws are things that have passed into the public domain, and public domain != open source.
Im currently working on an experimential direct3d system using lua to load meshes, textures, control positioning systems etc. Much easier than to hack through the C code (which gets messy btw). I tried to create my own on the fly scripting system like you. My system kept having memory leaks and errors. So i decided to go and work with an existing scripting language rather than spend even more time creating my own.
Question for the devs, how many lua_register(l,n,f) calls you got in your client. My engine has 30, and it doesnt even display anything yet!
Question for the devs, how many lua_register(l,n,f) calls you got in your client. My engine has 30, and it doesnt even display anything yet!
About 30 times. We also use Luna which has some code that does the same as lua_register. That's called about 15 times. These numbers include all the client/server/sector code. The client doesn't really do anything with lua other than load a couple configuration files. The only real lua function is the 'shortest path' code for the nav map course plotting.