glob2-devel
[Top][All Lists]
Advanced

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

[glob2-devel] Embedded scripting language


From: Bradley Arsenault
Subject: [glob2-devel] Embedded scripting language
Date: Sat, 3 Dec 2005 18:32:59 -0800

Heres one thing to consider for post 0.8.16: an embedded scripting
language. I know the discussion about one has been goin on for a
while, but I thought I would bring the discussion to the mailing list.

If you have ever played age of empires or age of mythology, you may
take note of a few things. One, random map generation is abstract and
high priority. Two, ai's are made in a c-style embedded language, same
with random maps. Three, map scripting is fairly advanced. I believe
that this idiom worked, and worked quite well, and I certainly believe
that Globulation 2 should adopt a couple of these themes. And the best
way to do that is to embedd a programming language, and use it for
one, two and three.

I know portability is an issue, and so is uncanny dependancies, so
what programming language to choose may be a hard decision. If we
wanted the utmost in flexibility and elegance, i would use
boost::python and the python programming language, of which I have
personall experience. If we wanted something really small and
abstract, scheme may be a good choice. If we wanted an easily embedded
procedural language, lua may be our main choice. My personall choice
would be python, but it probably won't be chosen since dependancies
are a big issue. I'm not sure how easy it would be to distribute
python with the program. Python is certainly covered for all unixes,
but we would have to use manual distributation for windows. Scheme
could fit snugly into the code, and since Lua's main purpose is as an
embedded language, it should not be difficult to use Lua for either
circumstance.

Design considerations are pretty abstract from language of choice.
Random map generation is the one that strikes me as most important.
Having played glob2 for quite a while, you begin to get a feel for
certain maps, such as big ones like playground. You know exactly where
your enemies are, where wood, wheat, stone and stuff are, you barely
need explorers at all. You can generally figure out what angles your
opponents attack from as well. So making good random map generators is
important. My suggestion is to simply modify the gui, and integrate
the language of chocie directly into the map interface to allow it
direct control of generation of a map. Once thats done, we can slowly
build a framework, in the embedded language, for map generation. I
will reference age of empires again, because they did this and it
worked for them, so looking at their designs (such as downloading
random map scripts from aoe archives) may help us to make our design.

Ai scripting isn't as trivial. Bassically, we need to expose the ai to
the AI interface, the Order interface, and then work our way on from
their into Player, Map, Team, and Game. Building, BuildingType, Unit,
UnitType will all need to be exposed. However, no code elsewhere will
need to be changed (except the gui code that lists ai names), because
theinterface can be implemented as a subclass of AIimplementation. AI
scripting will bassically force us to interface everything to the
embedded languagem, unlike random map generation. As well, having
modular ai's isn't as important as having goo,d modular random map
scripts.

And lastly, there is map scripting. Map scripting will obvioussly
replace SGSL. But since I don't know much about SGSL, I won't bother
stating requirements here.

In my opponion, random map scripts are the most important, and equally
require the least effort.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]