Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

flyguy

Scripting Engines...

This topic is 6196 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi... I am writing a script editor for my scripting engine in my rpg. I was wondering..how can I make the scripting files so that I can write them in plain english, (the language I wrote), but if someone loads it, they can't make heads or tails of it and can't change it? Should I have the script editor convert the scripts to binary and then have a converter back to the scripting language in my RPG? It seems kind of slow. Please help! Tom "And I invented the internet!" - Al Gore Edited by - flyguy on June 26, 2001 3:23:06 PM

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I would reccomend changing them to binary, it''ll probably knock the file size down about 75%, plus make it allot easier for your engine to work. The language thing would be pretty cool too. I would probably have an instruction list and a mneonic list, you could switch the mneonics(I know I am spelling it wrong) based on the language.

Share this post


Link to post
Share on other sites
So you''d suggest having the script editor encode the file into binary, and then decode the binary file and store it in memory, then execute the commands in my RPG? You don''t think it would be too slow?

"And I invented the internet!" - Al Gore

Share this post


Link to post
Share on other sites
I don''t see how it could be slow... it would be faster in my opinion. Rather than doing a lot of language parsing and stuff, the editor would take care of all that. Basically, the editor would ''interpret'' your script and put it into binary form. Then, the game wouldn''t have to do no interpretation, it would be able to just right away execute the commands it reads from the binary file. It would be a whole lot easier.

Share this post


Link to post
Share on other sites
Ok none of these people know what they are talking, just do this. use a small simple xor cipher algo, with a basic randomizer built in. you select the key and bam, unless there is a leet cracker that really wants to break your script you will have nothing to worry about. plus if your key is the same text size ass the script, and you use the randomizer, you would need a f*in super computer to crack it.

Reality Makes Me XIC
I hack code: passion is my feul. Use my programs, experience genius.
http://www.x-i-c.com/

Share this post


Link to post
Share on other sites
Ok what is with the last post? what does he think this is RSA? His method would require the editor to have the same key no matter what, so that you send the script to me, I could not open the file becuase I have no key. There is no need for that..............

I would write it in C++, but no need for language details. I would use the binary file but also just shift the data left or right every other line.

Share this post


Link to post
Share on other sites
Maybe, my suggestion was... misunderstood.

Expand your mind outside of the box: the box being "if its encrypted the user must use a password" bull, it could be set to be crypted to a randomly generated file placed in some intricate location on the user HD. Then the program would just reference the file, and that would be the key. Look its low secrity but for his appearant assumed target audience, imho its pretty good.

Reality Makes Me XIC
I hack code: passion is my feul. Use my programs, experience genius.
http://www.x-i-c.com/

Share this post


Link to post
Share on other sites
You could just "compile" the scripts. It would mean you''d have to have the "source code" scripts, and the compiled ones...and you just don''t distribute the "source code." You''d also get some of the benefits of "compiled" code (speed, size, etc).

This could be as simple as writing out the parsed memory as binary. Then loading the binary file directly into a structure, so you don''t have to parse again.


Epolevne

Share this post


Link to post
Share on other sites
Go the route of assembly, and use simple opcodes with one or two parmeters. Each opcode has a number assigned to it, and the editor "compiles" the source into the resulting code. Your engine just has to read in a number, use a switch() statement on it, and decide if it should grab 0,1, or 2 more numbers, and do stuff. The go a bit further, and write your own scripting language on top of the "assembly".

Z.

Share this post


Link to post
Share on other sites
use opcodes...
store the data in raw format...
have each function retrieve its parameters...
this will allow you to pass strings, multiple arguments (first arg=how many to read), whatever...
store everything in raw format (i.e. write out data types in binary, strings direct to file with null terminator, and when you read a string just start reading bytes until you hit the null...

it can do control statements like ASM, use a JMP (JE, JL, JNE, etc) that executes fseek()...
start it with a binary zero (perhaps after a few header bytes) and most text-editors will choke trying to read it...
you''ll be able to see the strings, but you need a hex-editor to read numbers, and you have to simultaneously figure out what the opcodes are and how they read their paramteres, because there''s nothing in the file that says, "okay this is an opcode", you rely on each function pulling its arguments correctly to get the file position cursor set to something that''s the next opcode...
not very error-friendly, but it should work if the script is clean...

if you REALLY want security, use some form of encryption (XOR could work) on the entire file, then load it into a memory file and decrypt it... that way you could support both encrypted and non-encrypted scripts and theoretically only care which it is when you load and unload it

--Tr][aD--

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!