Hi,
I’m trying to plan out a game. I was thinking that the scenarios might be better set up with XML and/or Scripting. Then I was looking at all these different languages Lua, ruby… why learn something else? I read this article where this company actually uses Java itself for its scripting language.
http://www.gamasutra.com/view/feature/3147/nihilistic_softwares_vampire_the_.php?print=1
[quote]3. Using Java as a scripting engine.
We knew from the start that allowing the user community to edit the game was an important part of the design. After working in the first-person action-game market, we saw the benefits of supporting the user community and wanted to carry this idea over into role-playing games, where it is not the norm. A built-in scripting system makes a game engine much more extendable by fans. In Jedi Knight, we created our own customized game language called COG. Creating COG took a lot of effort from the development team; several months of work went into creating the compiler, testing the generated code, and implementing the run-time kernel used to execute the scripts. The end result was worth it, but it cost a lot in terms of time and resources to pull it off (for more about COG, see my article, “Adding Languages to Game Engines,” September 1997).
The ambitious design included parties of up to four 3D characters, each with interchangeable weapons and armor.
When starting Vampire, we looked for ways to incorporate a scripting engine more easily than creating our own from scratch yet again. There were several scripting systems we examined and tested. At about that time, another game development company, Rebel Boat Rocker software, was getting a lot of attention for its use of Java technology. After exchanging a few e-mails with lead programmer Billy Zelsnak, we decided to give Java a try. Up to this point I knew very little of Java, and had largely dismissed it as a language suitable only for making icons dance on a web page and the like.
A set of four interactive 3D head models at the bottom of the screen are skinned and animated in real time to give lifelike status for each party member.
After a crash course in Java, we did a few simple tests incorporating it into our game engine. It passed each one with flying colors. In a matter of a few weeks, we had solved the major challenges involved in interfacing a standard, freely distributable Java virtual machine to our 3D RPG engine. From that point on, the only maintenance required was to add new native functions to the scripting language, which we did whenever we added new engine functionality that we wanted exposed to the script writers. We also trained several designers in the use of the scripting language, and they started creating the hundreds of small scripts that would eventually drive the storyline of the game.
Ever since those initial tests, I kept waiting for the other shoe to drop, so to speak. I expected to come to work one day and find out that the Java thread was chewing up 100MB of RAM or eating 50 percent of the CPU time, but amazingly, the system was trouble-free throughout development and never became a significant resource drain. If for some reason we had hit a dead end with the Java system late in the project, it would have easily taken three to four months to get back on track using a different scripting technology. In the end, the gamble paid off. We saved months of programmer time that would have otherwise been devoted to creating a scripting environment, and the result was a system significantly more efficient and robust than any we could have created ourselves.
[/quote]
Okay so a couple of questions (not easy)
-
How would one set something like this up? Seems like a cool idea. Is this doable with Java using java as the scripting language?
-
Does anyone have any code links for medium complexity scripting engine tied to a scripting language? I want to set up things like variables, graphic positions, timers, dialog, and events. Perhaps AI.
Any help or direction would be appreciated.
Darrin
