APOCALYX is a...

free Game Engine based on OpenGL (MAIL) (SITE) (FORUM) (BLOG)

Saturday, July 19, 2008

Demos modifications

Sometimes I receive requests to modify in some way this or that demo. I'm surprised by these requests because I always explain that one can easily modify the demos himself. For example, it's very easy to change any resource used in the demos (textures, models, sounds etc.). Take for example the latest demo, Mushroom's Ride, posted two days ago and let's change the player's avatar. Since the avatar is a MD2 model (the old Quake2 model format), it's simple to take one's own preferred MD2 model and replace it. In the screenshot below, you can see that I have simply replaced the original fairy with an orc.

Some of the animations are different, of course, but the convention implied in the MD2 format makes coherent the overall behavior. To replace a model with another, or modify textures, sounds etc, one simply opens the "main.dat" file as it was a ZIP file (effectively, it is a ZIP file renamed to DAT).
Other more complex modifications need some knowledge of a programming language. For example, in the screenshot below you can see that the height of the camera over the ground is lower than in the original demo.

To make this kind of changes one can open the "main.lua" file with his text editor of choice. Doing so the complete source of the demo will be available for one's modifications. Usually the sources of the demos are short and quite structured, then downloading the documentation of the engine at the APOCALYX Downloads Page, it's not so difficult to understand the meaning of the variables and functions. In addition, the Lua language is very intuitive for people who already knows another programming language and, being scripted, no recompilation is necessary: one can immediately see his modifications at work.

2 comments:

Electro said...

Teach a man to fish:

1: What's simple to you isn't simple to a wannabe with 0 experience in C++. XD

2. Teach a man to fish. When someone asks for a modified demo... why not write a tutorial on modifying the demo. :P Though... the tutorial would probably be more work.

Alternately, they might be like me and not want to touch any GPL-ed code for fear of accidentally remembering it and copying it someday... XD Or they might have not accepted the GPL and thusly be legally prevented from making said modifications... or more likely... they're lazy. Or more likely... they know they'll just add error's and create incomplete code. Or... final possibility... maybe the demo isn't that easy to compile for a newbie.

My bet... laziness. Counteract by being equally lazy... write a blog post on how to do it and ask someone else to submit a demo. Winner gets a cookie (the kind set on your browser... done via blog... not the edible kind).

This will also tell you a bit about the community behind Apocalyx.

Note: I'm not a member of your communty(or any community yet)... GPL = no publisher... they tend to like exclusivity... but good luck.

Leonardo said...

> What's simple to you isn't
> simple to a wannabe with 0
> experience in C++. XD

No experience in C++ is necessary: the engine is completely scripted and all its features are available to Lua scripts. Lua is simple, but some basic programming skills are necessary, of course.

> When someone asks for a
> modified demo... why not
> write a tutorial on
> modifying the demo.

Because that tutorials already exist :)

> Alternately, they might be like
> me and not want to touch any
> GPL-ed code for fear...

The engine is GPL only because a few third-party libraries included in the engine are GPL. When someone askes for a LGPL version, I simply remove those libraries (not so important) and the engine becomes LGPL.
Anyway the GPL license regards only the C++ code. One can make whatever modification he wants through the the scripts without any limitation.

> the demo isn't that easy to
> compile for a newbie.

No recompilation is necessary! :)

Thanks for the suggestions. I'll try to improve the tutorials, but I usually prefer to add features to the engine because it's more amusing.