23 April 2006

Some more technical details about the new game

In this post I am trying to explain some of the ideas behind the new game I am working at, so maybe other less experienced game developers can learn something, and more experienced game developers can offer some feedback.

The goal of this new game is to have a scripting engine capable of creating games such as Ultima 7.
For those who didn't play Ultima 7, it's an old game. About 14 years old.
While the game is not playable on modern computers due to the fact that it used some more or less nonstandard memory manager, there is an effort, which is quite successful, to remake the game, so that it can be played on a variety of platforms, such as Windows, Linux, Mac, and even some Linux powered PDA. For more information, visit the Exult project homepage.

Ultima 7 had something very innovative for the time: An engine that had an embedded scripting language. At that time, however, there were no such thing as mods, so they didn't provide any information about their scripting language, or about their data files.
That scripting language, referred as Usecode, was responsible for most of the ingame logic. It was used for quests, for NPCs, for teleportation, weather, and so on.

Since my goal is to make a 3d game that is in many ways similar with Ultima 7, it makes some sense to look at how they did it, and do it better (afterall, we are 14 years later, many things have changed since then).
Yesterday I've tried to look for example and documentation on that Usecode, but couldn't find much. What I did know, for example, was that they use "eggs".
An egg is a trigger, which is activated by a variety of factors, such as if you are near or on it.
Such eggs were used to trigger various events, and set flags.
For example, an egg was placed on a door, so when you enter that house, a script is executed.
This is all good and nice, but the problem is, sometimes a house has two doors, or maybe you teleport in that house. If that happens, the egg is not triggered, and the game can be ruined, as the right flags are not set. Which DID happen in Ultima 7 and Ultima 7.5, causing some really annoying bugs, some even critical, not allowing you to finish the game.
Needless to say, that is very bad, and should be avoided at any cost.

The way I am avoiding it in the new engine is setting areas, rather than eggs. An area has the advantage that no matter how you enter in it, the code associated with it is triggered. Another advantage is that you can have an area be triggered by various factors, such as when you enter it, when you stay in it, or when you are leaving it.
Unlike an egg though, you can't call a script when you are NEAR the area. So for example, if you want a monster to spawn as you walk on a road, an egg can be useful. Similarly, sometimes you might want to trigger some code ONLY when you enter a place through a specific route (say, a door, rather than an illusion wall).
Which is why I am going to implement the eggs as well, but they will be used for different purposes.

Most of the area code has been finished, the next thing I will work at is finishing and testing the area code, as well as implementing those eggs.
The I will have to work at the combat system, and also at the items management system.
Unlike Eternal Lands, this new game will allow you to place items on the floor, rather than in a bag. In EL, the items automatically went to bags because putting them on the floor would have generated a lot of extra bandwidth. For a single player game, there is no bandwidth issue, and it can be easier and better for the player to place items wherever he wants, and it can even contribute to more complex quests, where you have to, for example, set a few items on various locations in order to open a door.
Because this new game is a 3d game, unlike Ultima 7, the code for putting items on a table, for example, is quite complicated. It will require some collision detection with the object under the cursor, to determine the Z position of the item. And only some items will allow placing objects on them, such as tables, stoves, counter..
That will be pretty hard, as I don't have that much experience with 3d collision detection. I hope I'll find someone to do that code for me :)


Blogger Donny said...

Sounds like an good addition I never played Ultima 7 but I would agree with the egg idea it can be bad at times, I think most games now a days use the area effect for spawning enemies which sounds like it will be a nice addition to your engine and using the eggs will be nice as well not many games implement both. Can't wait to see some beta screenshots or even a playable demo it sounds nice. Always love seeing work in progress because then you can look back at it and say it really looked like this before?? Or only had so and so features now look at it. I like the idea of having multiple triggers for the engine could make for some nice ways of implementing certain things like say if a player had a certain quest object and passed through an area with that object it would cause something to happen in that area that wouldn't have happened without that object in his inventory or maybe the player knows something might happen if they go to a certain area so they stay away from that area and take a different route. Could also implement a random generator for events on certain area triggers that way you won't always know whats going to happen and it will add to the fun of the game in general.

Sorry for long comment, just giving some helpful input. :)

23/4/06 21:31  
Blogger Radu said...

Right now, posting screenshots would be useless, as I am pretty much just using the EL engine and some EL maps to test stuff, so the game doesn't look much different than EL.
But I hope to have a 'technology demo' in a few months, where people can make some quests and stuff.

24/4/06 20:07  
Blogger Donny said...

Well this is what I ment heh once it's ready and does some different things then EL.

Anyways back to me setting up cvs on my system so I can work on my main machine and my laptop easily. Then time to start playing with SDL :)

24/4/06 22:40  

Post a Comment

<< Home