April 22, 2010

Engine status [22042010]

As I don't have anything else to rant about, I will give quickish update about the status of the engine as of now.

Engine supports fully Python, and there aren't (atm) any found bugs. I'm in the middle of writing PAK file format for AGE, that, in all simplicity, works as a package, both crypted and packed, if so wanted. Currently it is designed to hold data for camera, entity, mesh, image, material, worldnode, light and shader. I also plan on adding the support for scripts later.

My COULDHAS is also been expanded with possible editor. It'd work as better management for engine data, and easier "export" of PAKs, as it's pretty hard to do directly from blender. Not impossible, but hard and complicated.

EDIT: I'm currently working on the Blender exporter. It's more easier than I thought.

Compatibility settings are still on the shelf, with only parts of it in use. I found it more important to program major features before making sure it's completely bug free and compatible with other machines. I will probably add the system before initial beta release to the wild, which should, by current plans, happen in three, four weeks. Before the release, I will try to upload a few videos and give complete list of features implemented and a little tutorial for fly through level.

April 11, 2010

Scripting AGE

AGE supports currently Python scripts. This means it gives you more rapid development cycles when you don't need to rebuild your c/#/++ project all over again.

Currently the system is as follows:

You make main.py that includes, at minimum, following lines:
# Import age library
import age

# Initialize AGE, give it title "AGE" and set
# window size to 768x480
age.Driver.initEngine("AGE", 768, 480)

# Loop driver update cycles as long as the engine
# is not "done" with the rendering
while not age.Driver.isDone()
age.Driver.update()


That's it.

Then, if you want to add items, like camera, you add following lines after age.Driver.initEngine:
# Create new scene, set it active and get it
curScene = age.Driver.getScene(age.Driver.addScene('Scene001', 1))

# Add a camera to our scene and make it active
cam = curScene.getCamera(curScene.addCamera('Cam001', 1))
cam.set( age.Vec3f(0.0, 0.0, 0.0), # Position
age.Eul(0.0, 0.0, 0.0), # Rotation
age.Vec2s(0.0, 0.0), # Viewport offset
age.Vec2s(768, 480), # Viewport size
age.Vec2f(1.0, 1000.0), # Clip distances
45.0) # FOV

# Set the script file camera uses, without the extension (.py)
cam.setPyScript("camera")


Then you need to create a new file, called camera.py that includes following lines to enable fly through:
import age

# Get the camera as global variable
me = age.Driver.getCamera("Scene001", "Cam001")

# Camera action
def on_update():
# Check if WASD or gamepad's Point Of View (Directional btns)
# are pressed and move accordingly
if age.Input.getKey(age.KEY_W) == 1 \
or age.Input.getPadBtn(0, age.BTN_POV_UP) == 1:
me.moveOriented(age.Vec3f(0.0, 0.0, -10*age.Driver.getStep()))
if age.Input.getKey(age.KEY_S) == 1 \
or age.Input.getPadBtn(0, age.BTN_POV_DOWN) == 1:
me.moveOriented(age.Vec3f(0.0, 0.0, 10*age.Driver.getStep()))
if age.Input.getKey(age.KEY_A) == 1 \
or age.Input.getPadBtn(0, age.BTN_POV_LEFT) == 1:
me.moveOriented(age.Vec3f(-10*age.Driver.getStep(), 0.0, 0.0))
if age.Input.getKey(age.KEY_D) == 1 \
or age.Input.getPadBtn(0, age.BTN_POV_RIGHT) == 1:
me.moveOriented(age.Vec3f(10*age.Driver.getStep(), 0.0, 0.0))

# Rotate camera 150 degrees per second in X and 120 degrees
# per second in Z
curRot = age.Eul()
curRot.x -= age.Input.getMouseForce().x*150*age.Driver.getStep()
curRot.z -= age.Input.getMouseForce().y*120*age.Driver.getStep()

me.rotate(curRot) # Apply rotation to camera


Not so hard, but alot code to take in at once.

The "def on_update()" is a function that is called automagically inside the engine. You can also create your own, but you have to call them inside one of the predefined, automatically called functions.
  • on_[event]() : when an event; collision, deletion, scan and so on happens. how will the entity react to it
Also on a related note, you would normally call the camera, etc. creation code inside the scene on_init() function, that is called when the entity/object is created.

NOTE: This is the current method, which I most likely will change later for more dynamic script usage.

April 5, 2010

Thoughts about games and engines

While working on this engine, I've been reading and watching numerous GDC (Game Developer's Conference) stuff and I have learned alot of simple and advanced tricks, like multithread tasking, shadow mapping tricks, animation layering and reusing code in numerous ways, just to name few. Also a huge point that I've heard on many sources and witnessed myself, is that an AAA engine, like Unreal, CryEngine or Source have, at some point been a generic container of features and techniques, that then is mold into a game specific engine, with dropping and adding features, modifying some parts and just leaving the game specific stuff. The result can be something entirely different than what it used to be. This is also a huge point on getting the source code of an engine and why industrial AAA companies make a huge scene of it. It's true that Quake IV and Doom III used the same id Tech 4 engine, but the featureset is still so different.

This is also the case with AGE. I try to develop it so that I can later extend it to a game specific engine. Of course engines all have the core features remain the same, but some more high level, like shaders and action system might be altered.

Keeping in mind, that a game engine is the motor under the hood and the game is the nice seats, wheel, pedals and so on with the player being the driver, getting the experience of moving fast and waiting for the light turning green while burning the tires and listening to heavy rock. The game engine is the core to build a world for the player to experience.

A hint I've gotten from a industry veteran is, that don't make the game become experience, let the player experience the world the game creates.

April 3, 2010

Imaging AGE

As I promised earlier today, I will update some screens to you. I keep my promises.

But before them, I would like to give a small(ish) list that includes features in my current TODO-list and features on my COULDHAS-list.

TODO (in possible order of completion)
  • Shadows with spotlights, point lights and global (sun) lighting, in that order
  • Dynamics
  • Scene exporter to blender
  • Material files
  • Animations (keyframe)
  • Particles
  • Multithreaded system
  • LUA scripting
COULDHAS (in no order)
  • Scene graph: thanks to Samuel Anjam for reminding me of this thing. I was first a bit against it when he thought adding it to his engine, BlendELF, but then I also begun some investigations and thought why not. I will explain later what scene graph is and why it's useful.
  • Cache and asset system: Or in direct terms; a more sophisticated file system.
  • Bones animation: Something every GE nowdays needs. I just need to look up to this to implement it, when I get there.

That's the short "public" version of my little list. I will explain how I implement things as I push on. I will also probably add tutorials when I see fit that this engine can be shared.

Now something random called screenshots:


Sphere. I know I said I wouldn't post a sphere. Couldn't resist.


Sled that uses two materials. Thanks to blendercookie.com.


Sled closeup. Thanks to blendercookie.com.

AGE is still alive, folks.

I haven't been updating this blog for a while, so I'll bump it.

The AGE is still alive and I've finished great portion of it already, making it versatile engine to use in your game creation. I'm working on things like Python bindings, multithreading (and choosing which technique is the best to implement) and shader generator.

Currently AGE has the capability to the following:
  • Python scripting
  • Multiple materials per mesh
  • Multiple meshbuffers per mesh (LOD-system, experiemental)
  • Support to all image types you can name
I will be adding following in next few weeks:
  • LUA scripting
  • Shadows with spotlights, point lights and global (sun) lighting, in that order
  • Dynamics
  • Scene exporter to blender
  • Material files
I will update this blog with some nasty screenshots when I find something else than spheres in my computer. On that same post I will also hype about all the features I currently have in my TODO-list.

Work work,
Inestical