GoldenEye: Source Forums

  • March 28, 2024, 11:44:46 pm
  • Welcome, Guest
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: GES and scripting languages  (Read 9602 times)

0 Members and 1 Guest are viewing this topic.

Mark [lodle]

  • Retired Lead Developer
  • 007
  • *
  • Posts: 1,411
  • Reputation Power: 1
  • Mark [lodle] has no influence.
  • Offline Offline
GES and scripting languages
« on: September 02, 2009, 04:19:09 pm »

Well my current assigned task for the ges team (which i cant disclose) involved alot of interaction with the scripting langauge that we have in the current build (Lua).

Now im a programmer and can work with most languages but i must say lua has to be pretty bad from a syntax and oo point of view. I must say that using Lua is Garrys fault (of GMOD fame) but i dont blame him for using it. Its one of the few scripting languages that are standalone and sandbox but using it for any thing more than simple stuff it becomes a pain to work with.

So recently i have been looking into switching the scripting lang to something else. The requirements i was looking at was that it had to be oo, have to have simple c++ bindings  and have "normal" syntax. So i was looking around the web and found two good scripting langs i could embed, ChaiScript and python.

I feel in love with ChaiScript from the moment i saw it. Its very c++ like and has really easy c++ bindings with no cost setup. However it doesnt support c++ objects (well not for what we need it for) so it rulled it out and that left python.

My friend at uni is a python nutter and goes on non stop about it (if he could write an operating system in python he would). So naturally i was a bit hesitant to use it at first and i was right. The syntax is not c++ like (but still shits over lua) and the initial setup (embedding it into c++) was hard as hell. However i have grown to love it.

Python allows us (the ges programmers) to easily expose classes to python which involves one line per function where as lua required around 8 with alot of manual effort and easy conversion between python objects and c++ objects. However its still hard going from c++ to python back to c++ but that complexity is only when we write the interfaces and not when we make the gameplay or other classes.

Python also has another advantage of having massive library support however this is very bad from a security POV as gameplays can get access to the os if we are not careful.

So thus in beta 4 ges should be dropping lua completely and picking up python. I currently have a working version thats a little wonky atm (crashes on map change :() but the number of files needed for python to work are around half that of lua and with easier binding means we can spend more time coding fun stuff than coding the interface to allow us to do fun stuff.

Ill be writing a tutorial up on the valve wiki soon on how to embed python into source for any one who is interested.

Logged

killermonkey

  • GES Programmer
  • Retired Lead Developer
  • GE:S Fanatic
  • *
  • Posts: 5,473
  • Reputation Power: 346
  • killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!
  • Offline Offline
    • DroidMonkey Apps
Re: GES and scripting languages
« Reply #1 on: September 02, 2009, 06:41:39 pm »

---> KM comes to the rescue

I am going through Mark's code tonight to catch nasty bugs and implementation flaws. It is always good to get two programmers to look over each other's work. A fresh set of eyes can debug faster then the complacent set.
Logged

VC

  • Valiant Varanidæ, Citrus Jockey
  • Retired Developer
  • GE:S Fanatic
  • *****
  • Posts: 2,843
  • Reputation Power: 16
  • VC is working their way up.VC is working their way up.VC is working their way up.
  • Offline Offline
Re: GES and scripting languages
« Reply #2 on: September 02, 2009, 06:45:16 pm »

I'd much rather learn Python than go about my devious plan to find some way to shoehorn objects into LUA.
Logged
"As for VC's scripts they have not broken the game at all, in fact the game has never felt better." -- KM
"(03:12:41 PM) KM: I would call you a no life loser, but you are useful"
"(03:12:59 PM) VC: Go ahead.  I am, and I am."
Pages: [1]   Go Up