Archived

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

Ivyn

Is this ridiculous or what?

Recommended Posts

Well I''m working on a game creation IDE, it has a Map Editor, Image Editor, Code Editor and other tools. To compile the games, I plan for the program to convert the code (which is my own syntax) to Pascal and it will then be compiled. So do you think this idea will work, and do you know of any information I can get about converting one language to another? Just for the record, I''m using Delphi, but it doesn''t matter. -- Ivyn --

Share this post


Link to post
Share on other sites
Why not just make your own scripting lanuage.. since taht would be better than creating a pascal interepter.
It is better to keep you projects simple.

Share this post


Link to post
Share on other sites
Why not just make your own scripting lanuage.. since taht would be better than creating a pascal interepter.
It is better to keep you projects simple.

Share this post


Link to post
Share on other sites
You could be right. I was thinking of using a scripting system at first but the two main reasons I decided against it were...

1. I read that scripts run about 15 times slower than executed code. I will be using this myself and I need as much speed as I can pull.

2. Scripting systems (or at least the ones I've seen) all use a pre-compiled exe. This isn't good for allowing the changing of icons...etc.

Writing the pascal converter is alot of work, but would scripting be that much easier?
Anyway, I was just wondering if my idea had ever been atempted before and if there is a chance it will work exceptionally.

-- Ivyn --

[edited by - Ivyn on August 14, 2002 12:24:51 AM]

Share this post


Link to post
Share on other sites
It''s a good idea. I had one similar to that a while ago but it was going to convert to C++. It just got too hard to design so it never got started. Anyway, the only tip I have it that the user doesn''t have to run the pascal compiler and your program will call the compiler itself.

---
My Site
Come join us on IRC in #directxdev @ irc.afternet.org

Share this post


Link to post
Share on other sites
How about using precompiled scripts? Set up your own scripting language and everything but make an external compiler that compiles the scripts you make to intermediary code. This intermediary code can then be run through the virtual machine in your game without needing to parse anything. And thus, the performance hit is minimized.

Your method, though effective, just seems weird to me but to each his own I guess...

-Auron

[edited by - Auron on August 14, 2002 12:52:44 AM]

Share this post


Link to post
Share on other sites
Auron, what you've suggested sounds interesting however I don't really understand. What is intermediary code and how would I compile to that? And what do you mean by the virtual machine in the game?


And to RapidStunna: It's good to see someone else thought about it. And yes, I was planning for the user to never even know anything about the whole conversion to pascal thing. All they know is that their game is being compiled to an exe.

-- Ivyn --

[edited by - Ivyn on August 15, 2002 1:10:20 AM]

Share this post


Link to post
Share on other sites
Hey, have you seen Game Maker? I believe that is exactly what you might be making. I believe the author even used Delphi to make it. You should take a look at it to see how he did it. Here''s the webpage if your are so curious. http://www.cs.uu.nl/people/markov/gmaker/index.html

Happy Coding!
-Escaflowne75

Share this post


Link to post
Share on other sites
Yeah, I already have Game Maker. I looked at it often when designing my interface to make sure I picked up on all it's misses as well as provided more and better features. I also studied RPG Maker 2000 which I believe was also programmed in Delphi.

P.S. Still waiting for someone to explain about intermediary code and all the stuff Auron said.

-- Ivyn --

[edited by - Ivyn on August 15, 2002 1:01:26 PM]

Share this post


Link to post
Share on other sites
Intermediary code is like virtual assembly.

You basically write custom instructions that resemble machine code. You then write the engine that reads and executes those instructions. It''s also sometimes called "byte-code" because the compiled script files are usually binary and not human-readable.

Java uses a system similar to this.

Share this post


Link to post
Share on other sites
What you were doing is basically equivalent to what he said. You were going to use pascal as your intermediate code. Intermediate code can be anything, it doesn''t have to be assembly like.

An app to translate one syntax to another is commonly called a ''compiler''. If you want to program one, I recommend the book ''Compilers: Principles, Techniques, and Tools.'' You can get get it off amazon, or out of your local university''s library. You probably also want to google for lex, yacc, and/or ANTLR.

Virtual machines are programs that simulate computers. You might have heard of emulators before? Those are virtual machines.

This is a pretty big undertaking... you might want to reconsider embedding some ready-made scripting engine, such as python or Lua.

Share this post


Link to post
Share on other sites
quote:
Original post by Auron
How about using precompiled scripts? Set up your own scripting language and everything but make an external compiler that compiles the scripts you make to intermediary code. This intermediary code can then be run through the virtual machine in your game without needing to parse anything. And thus, the performance hit is minimized.



How do you avoid having to parse? Would you make a function for each instruction e.g ADD(), which reads what ever it needs as its arguments? You could have say 255 instructions and an array of 255 function pointers I guess, then you read the op and call func[op] which reads arguments from the script thing. But why would the scripts necessarily need compiling for this?
Is this what is meant by virtual machines?





Read about my game, project #1
NEW (13th August): A new screenshot is up, plus diaries for week #3


John 3:16

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
why are you doing this again?
its more work than building a game and once you''ve made it, will it be flexible enough?

why not use a IDE for the programming, a graphics editor for the graphics and a level builder for the levels.
If you want you can tile the windows on your desktop so it looks like they''re in an IDE itself..

it is ridiculous (to me at least)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
script compiler :
allows you to type stuph into a text file in easy syntax (ala C++/VB/whatever), then run it through a program to convert it to a binary file that only contains op-codes and parameters.

it''s quite a bit faster( not to mention more readable ) to have :

script >> op;
functs[op](&script);

than:

script.getline(buffer, 256, ''('');
if(strcmp(buffer, "functionOne")
functionOne(&script);
if(strcmp(buffer, "functionTwo")
functionTwo(&script);

it makes it faster by doing all of the parsing once, rather than every time you run a script...

Share this post


Link to post
Share on other sites
I''m not making this only for my own use. And besides, it''s a great learning experience and I wouldn''t want to program my entire game in pure C/C++...etc anyway. Even Unreal Tournament, Freedom Force, Spider-Man, Jedi Knight, and tons of other commercial games used a scripting language to simplify the development process.

-- Ivyn --

Share this post


Link to post
Share on other sites