Programming & Scripting

View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

User avatar   Uber Modder Uber ModderMember since: 21.10.2011, 23:50Posts: 1731 Likes: 8
 

 Post Topic: Which Language?
PostPosted 14.05.2012, 21:45 
Hey CryDev guys,

I think I arrived now at the point where a programming language (except XML^^) is strictly required. But I don't know which one I should learn? LUA or C++? I'm a complete noob in programming languages, (okay, I can read and understand code, but not write it myself) and I think I'd just take the easier one to learn and use. My friend told me, LUA is very nice and easy. And I've seen what the guy from CryDev does with LUA (Fligh Simulator) so, I prefer LUA at the moment, but maybe you can convince me to switch to C++. :)

And last but not least: Which programs do I need to code, and is visual studio express enough?

Well, my current programming skills:
  • (XML)
  • Karel the Robot
  • (YAML) (minecraft server)
Quite short, I know...

Which one would you suggest you me to learn?
Thanks in advance.

  Trained Modder Trained ModderMember since: 05.04.2012, 14:13Posts: 254 Likes: 14
 

 Post Topic: Re: Which Language?
PostPosted 14.05.2012, 22:24 
I first learned Pawn/Small which is a derivate of C, so I recognize certain parts of C++ although the execution is very different.. I then learned LUA which is not that hard to learn if you've got some common sense and some previous rudimentary programming language knowledge. It is fairly easy to use and at the same time quite powerful, but it is nothing to build a game on in my opinion (usually C++ is used for the most complex stuff and then LUA can hook into certain parts), but still very useful.

It's all about how much time you feel you can spend on watching tutorials, going over a single block of code really understanding what everything does and what calls what etc, what you want to be able to create and what level you feel you want to put yourself on :)

I would say LUA though as it's easier and you can do a fair amount of cool stuff with it in CE3, if you're looking to create a game you will certainly need a couple of C++ programmers along the way though!

Programs: I use VS2010 Express to view C++ files, but I am no C++ programmer and to compile in x64 with the Express version you need the VS SDK, which I haven't tried out yet. You can use VS2010 Express to code in LUA, I use N++ because it's very simple and simply because I'm used to it + I use it for XML files aswell.. Again it's what you feel suits your needs the best :)

Good luck!




Intel i5-2500K 4x@4.9GHz@EKWB Supremacy Nickel water block
ASUS Maximus IV Gene-Z/Gen3 @Z68
Gigabyte HD 7950 @ 1100MHz/6000MHz@Alphacool NexXxos ATXP water block
24GB Corsair Vengeance 1600MHz CL10
User avatar   Has no life Has no lifeMember since: 11.07.2008, 20:25Posts: 11740Location: Nottingham, UK Likes: 89
 

 Post Topic: Re: Which Language?
PostPosted 14.05.2012, 22:30 
Disclaimer: I work on a project which was born out of a deep hatred of Lua. Now that that's out of the way...

Most languages you learn, such as C#, Java, C++ et al have what's known as typing. This is the idea that an object has a defined set of variables and functions, and this is enforced throughout the language. You can't declare a number and then assign that same variable a string of text.

Lua doesn't really do typing. When a function receives a variable, it just is. You don't know ahead of time whether you're receiving a string, number or even a table.

Coming back to what I call 'normal languages' (purely because that's what I'm familiar with of course) they've worked out a decent balance of readability and verbosity. They use braces (the { and } chars) to indicate scope. Lua isn't so much a fan of that, and instead requires a bit more typing with of then and end statements.

On a vaguely related note I may be writing some getting starting with CE3 & C++ tutorials soon, so hopefully that'll help either way :)


Out now! CryENGINE Game Programming with C++, C#, and Lua
Ex-Crytek, now with Deep Silver Dambuster Studios
User avatar   Experienced Modder Experienced ModderMember since: 18.07.2011, 13:00Posts: 567Location: France Likes: 4
 

 Post Topic: Re: Which Language?
PostPosted 14.05.2012, 22:34 
For me Lua is just scripting... not programming... :p


And, please stop kill kittens.... ;)


User avatar   Uber Modder Uber ModderMember since: 21.10.2011, 23:50Posts: 1731 Likes: 8
 

 Post Topic: Re: Which Language?
PostPosted 15.05.2012, 06:58 
Actually, I have no problem with typing then and end and stuff. I got used to it from Karel the Robot from School.

Thanks for the tip with N++, it's by far my favourite text editor.


Last edited by NeoLegends on 15.05.2012, 14:04, edited 1 time in total.
  Trained Modder Trained ModderMember since: 05.04.2012, 14:13Posts: 254 Likes: 14
 

 Post Topic: Re: Which Language?
PostPosted 15.05.2012, 08:29 
Quote by NeoLegends:
Actually, I have no problem with typing then and end and stuff. I got used to it fron Karel the Robot from School.

Thanks for the tip with N++, it's by far my favourite text editor.


No problem! :) Although I might try using VS2010 because apparently N++'s syntax highlightning doesn't detect mistakes in certain XML tags..

@Braces/end: I used braces in Pawn, the only difference I find is that it's faster to type if (param) then blabla end instead of if { dothis } if you're writing single line code, so yeh not really any difference there I think. I haven't really checked a lot of CE3's LUA yet but as I learned it in Garry's Mod where almost everything "Game" is done in LUA (the Source engine is C++, but the LUA hooks into a lot of it), so there it was very powerful, while not being too abusive/hard to learn. I might be wrong :p




Intel i5-2500K 4x@4.9GHz@EKWB Supremacy Nickel water block
ASUS Maximus IV Gene-Z/Gen3 @Z68
Gigabyte HD 7950 @ 1100MHz/6000MHz@Alphacool NexXxos ATXP water block
24GB Corsair Vengeance 1600MHz CL10
  Uber Modder Uber ModderMember since: 11.08.2004, 12:38Posts: 2277 Likes: 70
 

 Post Topic: Re: Which Language?
PostPosted 15.05.2012, 12:35 
I've used Lua for some years to create new vehicles (aircraft, trains, ships, spacecraft). The basic vehicle code has about 6000 lines of code. Lua gives me extreme flexibility and I can add any features I want, within reason. For example, you can naturally walk around an aircraft interior while flying at hundreds of miles an hour.
.
Lua is very easy to use and learn. The programming environment couldn't be simpler or more direct. Simply edit and save your Lua script, in Sandbox select the entity, click Reload Script (it takes a fraction of a second to re-compile the code), hit CTRL-G for game mode and test your new code.
.
Lua runs very fast, in fact Crytek has stated that it's nearly as fast as native C++ code. It's also very powerful and perfect for real-time control of entities. You can directly move, scale and rotate entities e.g. with self:SetPos(pos) or self:SetAngles(angles). By placing them in slots, you can directly manipulate objects, effects or even clouds (I have made a Weather entity that automatically places clouds according to its Properties settings).
.
A major feature of Lua is tables. In fact a Lua-created entity can be thought of as a table, which can contain any number of sub- and sub-sub- tables etc. Lua tables are amazingly flexible and, once you get the hang of them, are very powerful.
.
C++ programming will always be more flexible, but I suspect the difference is quite small. To anyone thinking of getting their hands dirty with CryEngine, Lua is a perfect place to start. The Lua documentation is pretty good and there is an excellent tutorial by ins on how to create entities with Lua.
Regards,
Chris
User avatar   Uber Modder Uber ModderMember since: 21.10.2011, 23:50Posts: 1731 Likes: 8
 

 Post Topic: Re: Which Language?
PostPosted 15.05.2012, 14:01 
^^ I meant writing your name in the initial post, but I forgot your nick. Shame on me. :)

@all: thank you for giving me advices!