[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting



>>>Also doing the compiler is not very fast.
>>>
> 
> g++ on my 750Mhz PC compiles at about 1000 lines per second.
> I think that's plenty fast.


I agree with you completely, but remember fast is relative (engaging Devil's 
Advocate Mode). To a programmer the extra step(s) required to prepare code
for use in a game are acceptable, probably even to the point of not even 
being noticable, but to a content developer who just wants to see what his 
changes have done in the game? It could be frustrating, perhaps anyway.


>>   interpreter..) using libraries means everything is one big piece of
>>   code and picking out which bit is going wrong can be trickier...

> Yes...but it depends a lot on who you think will be writing the scripts.
> 
> I don't make programming errors  ;-)


Sure ;))


> ...then you can punt the problem back to whoever wrote the script. However,
> if scripting is in C/C++ then it's very hard to distinguish an end-user-induced
> error from a genuine error in the game engine itself.


The alternative is to stick pre and post condition checks in the functions 
that interface with dynamically loaded code. This should cause less overhead 
than an interpreter, but still allow you to say whether it was the script of 
the game that caused a problem. To an extent anyway.



> On the idea of transmitting behaviours over the net during game play, I'd
> have to say that it would be a horrible mistake to transmit C/C++ programs
> and compile them in the target machine.  That's the kind of dumb thing that
> Microsoft would think of.  Just think of the possibilities for Virus writers!


There is a way it can be done I think. I'm working on this because I'm 
relying on a system that will allow the game to pull in new items, AI and 
other game entities from specified "approved" repositories when the user 
requests it (or joins an online game to ensure their copy is up to scratch - 
all with confirmations and so on). My idea is based around signing the 
source - you tell the module finder which sites you trust by adding the 
public key for that site to a keyring, when you go online the game checks 
the trusted sites for updates and downloads the files. As it does so it 
verifies the signature on the files and a CRC checksum - if the signature 
and CRC are fine then it knows the file is trusted, if the signature is bad 
the download stops immediately, the bad file deleted and the user informed. 
Game components on the site must, obviously, be checked and signed by the 
site owner - not signing them will make it impossible to use them and not 
checking them will end up with that site's reputation being destroyed. Only 
accepting signed modules form specific sites also goes some way to avoiding 
the more naive accepting dodgy modules from someone on ICQ saying things 
like "Wanna try out me l337 sh1p m4t3?". I think anyway. Probably. And 
assuming the user doesn't do something stupid like install a copy with the 
signing checks removed.

Chris
-- 
  .------{ http://www.starforge.co.uk }-----. .--------------------------.
=[     Explorer2260, Designer and Coder     \=\ P: TexMaker, ROACH, site \
=[___You_will_obey_your_corporate_masters___]==[ Stack: EETmTmTRRSS------ ]