Go Back GameStrafe > Network > Crysis > Modding
Reply
 
LinkBack Thread Tools Display Modes
Old May 20th, 2006   #1 (permalink)
BANNED
 
Join Date: Apr 2006
Posts: 111
Post BOOK: Programming in Lua, 2nd Edition, 2006

FarCry uses Lua extensively for scripting all game events and AI/game logic, both for single and multiplayer game, and for realtime game editing and probably (99%) Crysis will use too.

If you want more information about LUA, I deeply recommend the book PROGRAMMING IN LUA (Second Edition, 2006).


Book Description

Lua is the language of choice for anyone who needs a scripting language that is simple, efficient, extensible, portable, and free. Currently, Lua is being used in areas ranging from embedded systems to Web development and is widely spread in the game industry, where knowledge of Lua is an indisputable asset.
"Programming in Lua" is the official book about the language, giving a solid base for any programmer who wants to use Lua. Authored by Roberto Ierusalimschy, the chief architect of the language, it covers all aspects of Lua 5---from the basics to its API with C---explaining how to make good use of its features and giving numerous code examples. "Programming in Lua" is targeted at people with some programming background, but does not assume any prior knowledge about Lua or other scripting languages.

This Second Edition updates the text to Lua 5.1 and brings substantial new material, including numerous new examples, a detailed explanation of the new module system, and two new chapters centered on multiple states and garbage collection.
OldMack is offline   Reply With Quote
Old May 20th, 2006   #2 (permalink)
Member
 
Join Date: May 2006
Location: US
Posts: 49
Send a message via ICQ to ElShotte Send a message via AIM to ElShotte Send a message via MSN to ElShotte
Default

You need to turn that book into PDF and share...
ElShotte is offline   Reply With Quote
Old May 21st, 2006   #3 (permalink)
BANNED
 
Join Date: Apr 2006
Posts: 111
Default

No way man... How about spend some money on this great book? (besides the fact you are a LUA master, the book brings creative examples and probably will be useful).
OldMack is offline   Reply With Quote
Old June 13th, 2006   #4 (permalink)
Junior Member
 
Join Date: Jun 2006
Posts: 5
Default

Oh, I can't believe LUA is used for a professional game like FarCry and Crysis. I didn't know that it was so powerful. Now, I will surely look it with importance.

Thanks.
Pardall is offline   Reply With Quote
Old June 13th, 2006   #5 (permalink)
BANNED
 
Join Date: Apr 2006
Posts: 111
Post

Quote:
Originally Posted by Pardall
Oh, I can't believe LUA is used for a professional game like FarCry and Crysis. I didn't know that it was so powerful. Now, I will surely look it with importance.

Thanks.
Hi Pardall and welcome to TotalCRY.com!

LUA have been used as a SCRIPT Language (similar to UnrealScript - Unreal Engine) to script all game events and AI/game logic and for realtime game editing. It´s a "easy" language to learn too.
OldMack is offline   Reply With Quote
Old June 13th, 2006   #6 (permalink)
Junior Member
 
Join Date: Jun 2006
Posts: 5
Default

Quote:
Originally Posted by Mack
Hi Pardall and welcome to TotalCRY.com!

LUA have been used as a SCRIPT Language (similar to UnrealScript - Unreal Engine) to script all game events and AI/game logic and for realtime game editing. It´s a "easy" language to learn too.

Thanks Mack! The AI too? Wow, it really is a powerful language. I am a small game developer (homebrew and trying to develop a professional and commercial game ) and I was looking for a scripting language. I even started developing my own. Luckily I accessed TotalCry, found this information of Crysis being LUA

I googled more about it and found lots of info.
LUA is now my official scripting language.

If Crytek used it to FarCry and the perfect Crysis, I can use to my little games.

Thanks again!
Pardall is offline   Reply With Quote
Old June 13th, 2006   #7 (permalink)
Chief Warrant Officer 2
 
Yorick's Avatar
 
Join Date: May 2006
Location: East Coast, US
Posts: 388
Send a message via ICQ to Yorick Send a message via AIM to Yorick Send a message via MSN to Yorick
Default

Quote:
Originally Posted by Pardall
Oh, I can't believe LUA is used for a professional game like FarCry and Crysis. I didn't know that it was so powerful. Now, I will surely look it with importance.
It's used for other games too. Both World of Warcraft and Garry's Mod (for Half-Life 2) use it.

How hard is it to learn? I'd like to give it a shot.
Yorick is offline   Reply With Quote
Old June 13th, 2006   #8 (permalink)
BANNED
 
Join Date: Apr 2006
Posts: 111
Post

Quote:
Originally Posted by Pardall
Thanks Mack! The AI too?
Yes... Read below.


Quote:
Originally Posted by Yorick
How hard is it to learn? I'd like to give it a shot.
Simple. Read below.


From "Beginning Game Level Design" - John Feild and Marc Scattergood:

"If you decided that the path of the game or level designer was what you really wanted to do, not only because of the inherent creative but also because you can´t program to save your life, that´s okay. However, you absolutely must have some understanding of simple programming grammar and structure. These are computer games, after all. Every facet of your game is facilitated by lines and lines of computer code. Not having a basic knowledge of how to read and write this stuff can mean the difference between making a distinct, fun level or a drab, cookie-cutter level.

Another reason to know basic programming is that many game creation tools allow the level designer to make basic programs that grant him a great degree of power over how the game works. These small programs can do everything from changing how the AI works in a give situation, to determining how fast day and night go by, to altering the combat system so that the player's breath is a deadly weapon. These small programs are called 'scripts'.

Simply put, scripting is the interface through which the designer can actually change how stuff works in the game, determine new behaviors, or handle special interactions, such as triggers, locks, and anything else you can image (within the scope of what was exposed by the engine creator).

You lay out the levels with those art assets you've been provided, and you place actors that use both the developer's work through AI and the artist's work through look and animations, as well as the goodies a commando in training could want.

Now you're stuck. You have no way to tell a specific actor that when the player crosses an invisible line in your level, he is to start pathing toward a specific target and then spout off some cool dialogue. This is where scripting can come in. Scripting can allow you to tie in seemingly unrelated actores in your level (NPCs, trigger regions, special effects, doors, elevators, traps, and even conversations) to create a cohesive, fun, and solid level for your players to then tear through.

For some games, like Far Cry, scripting can be as simple as setting up your level objectives, any special door or elevator, and maybe a specialized trigger or two if the built-in system doesn´t do what you want.

Far Cry has an advantage in that the toolset, Sandbox Editor, can handle 99 percent of all events that need to be in the game. Trigger regions are defined clearly and easily through the use of standard geometric shapes, 2D, 3D and a fairly powerful event/response system so that you can link, multilink, and react on most needed levels, including handling save pointgs, objectives changes, and so on. This is somewhat advanced behavior is covered extensively in the Sandbox FAQ and toolset documentation provided by Crytek. You should be aware of the system, and if you're terrified of programming, you can breathe a small sigh of relief if Far Cry is your chosen game engine to work in.

Many newer games, such as Far Cry, rely on WYSIWYG (What You See is What You Get) system to make the process of level building much easier and much more intuitive. While most of them also allow for use of scripting, it is not the only way to get things done, and often not the most efficient or easy. In a WYSIWYG environment, many behaviors that you might normally tell the system how to do through scripting, you instead can do through a more natural "point and click" type interface. An area where this really makes your life easier is through pathing.

Objetives in Far Cry use a combination of scripting and the WYSIWYG tools. This mixing of tools is not uncommon and ,usually to create more powerful experiences, requires use of both to push your game platform as far as it can go.

(...)

The WYSIWYG aspects are also pretty straightforward to use, at least for Far Cry. The game uses trigger regions to handle most of its event/response behavior, and this type of behavior is no different.

Far Cry has mini-wizard that allow you to quickly associate objects with other objects, and even scripts and functions in those scripts.
"



Example: first program in Lua - just prints "Hello World":

Code:
print("Hello World")
Hope it helps!
OldMack is offline   Reply With Quote
Old June 14th, 2006   #9 (permalink)
Private First Class
 
Join Date: May 2006
Posts: 13
Cool

Hi guys!

Yes, the LUA language is greate, I use it for me own Engine too. Its really
simple and give you a lot of possibilities =). When someone wants to use
it or to read the official documentation about LUA, should visit the website
of Lua. That is http://www.lua.org.

There is a big list with all games which are use the Lua language.

I hope I could help a little bit =).

Well, see you later!

Bye

Best regards

ModCreator
ModCreator is offline   Reply With Quote
Old June 20th, 2006   #10 (permalink)
Banned
 
Join Date: Jun 2006
Posts: 0
Default

@Mack, is it hard to apply your AI scripting to an entity in the FarCry editor?
ceramic.wolf is offline   Reply With Quote
Old May 8th, 2007   #11 (permalink)
Sergeant
 
[GT]OGEB1103's Avatar
 
Join Date: Oct 2006
Posts: 50
Default Re: BOOK: Programming in Lua, 2nd Edition, 2006

Quote:
Originally Posted by ElShotte View Post
You need to turn that book into PDF and share...
First edition is available online as is the 5.1 reference manual. Programming in Lua - contents
Lua 5.1 reference manual - contents
[GT]OGEB1103 is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 07:19 PM.