By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,046 Members | 2,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,046 IT Pros & Developers. It's quick & easy.

Just in time compiling

P: n/a
A group of friends and I are doing a RPG (role-playing game) maker for a
school project. It occured to us, however, that if you want the user to be
able to have almost complete control over the contents of his/her game, that
you would end up with a tiny executable and a huge datafile. We wanted to
keep clear of this as disk accesses take a lot of time to do and there would
be a huge load of them to do this part. We could very easily write a
program to spit out the code but we don't know how to get it to compile into
an executable as part of the software. The user shouldn't have to be a
programmer to get a working game. We basically want them to design a game
and then click a build game button. On that click, the code is generated
and compiled. Now, the way we figure it, is using just in time compiling we
can use .Nets clr, intermediate language, and just in time compiling to
achieve this, however, we don't know how. :) So any thoughts or good
pointers would be most helpful.
Thanks
~Justin

Jan 31 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Justin Naidl" <jn***@lsol.net> wrote in message
news:43***********************@news.tm.net...
A group of friends and I are doing a RPG (role-playing game) maker for a
school project. It occured to us, however, that if you want the user to
be
able to have almost complete control over the contents of his/her game,
that
you would end up with a tiny executable and a huge datafile. We wanted to
keep clear of this as disk accesses take a lot of time to do and there
would
be a huge load of them to do this part. We could very easily write a
program to spit out the code but we don't know how to get it to compile
into
an executable as part of the software. The user shouldn't have to be a
programmer to get a working game. We basically want them to design a game
and then click a build game button. On that click, the code is generated
and compiled. Now, the way we figure it, is using just in time compiling
we
can use .Nets clr, intermediate language, and just in time compiling to
achieve this, however, we don't know how. :) So any thoughts or good
pointers would be most helpful.


Well, first thing, don't throw out the tiny engine, large datafile approach
offhand. Most commercial games use this approach(as do most game
construction kits I've seen.) A large executable can cause alot of trouble
in its own right. Test it and see. With careful caching and logical file
design I suspect you'll find pretty good performance.

Now, on to the larger question, compiling scripts. Its to large a topic for
this post, but the System.Reflection.Emit namespace offers almost all of the
classes you could ever need to construct a compiler, and the greater web
contains a wealth of information on it.

Amazon has two books directly on topic, although I've never read them and
can't speak to the quality:
http://www.amazon.com/exec/obidos/tg...glance&s=books

http://www.amazon.com/exec/obidos/tg...glance&s=books

There is a mailing list as well, although it is a very quiet mailing list,
as well as other resources at
http://www.gotdotnet.com/team/lang/

If you want to just use C#, VB.NET, or another language that provides a
CodeDOM compiler as your scripting you could use the appropriate classes.
Do you know what language you are planning on using, there might be a
compiler for it if it exists? I can probably give you more information if I
knwo what approach you are looking to do.
Jan 31 '06 #2

P: n/a
Justin,

In my opinion can you use this.

http://msdn2.microsoft.com/en-us/library/s4kbxexc.aspx

It is there as well in C#. You can create it, and than start the compiling
process by invoking the compile proces using the commandprompt.

Just as idea

Cor
Jan 31 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.