APOCALYX is a...

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

Thursday, October 23, 2008

Refractive Sphere

After a lot of days of silence, let's start again the APOCALYX 3D Engine daily posts. Today just a short old news: I simply signal an old paper of mine that describes how to simulate a refractive (and reflective) perfect sphere with just two triangles.

In DemoPack1 is available a demo (RefractiveSphere.lua) about the subject.

The article dates back to 2004, so it explains how to simulate a sphere through fragment programs. Now the same effect can be accomplished much more easily using fragment shaders and the GLSL language, but the theory behind the scene is still interesting.

Download the paper from here: RefractiveSphere.pdf.

Sunday, October 19, 2008

Third Person Shooter (II)

Other screenshots from Miguel Manchego Rivas' Simple Shooter.

You can download the demo from the Users' Gallery. Feel free to submit your little demos, even if you find the quality of yours worse that Miguel's ones. Thank you in advance!

Saturday, October 18, 2008

Third Person Shooter

Other screenshots from the Miguel Manchego Rivas' demos. This is the time of the Simple Shooter that you can find, as usual, in the Users' Gallery.

As you can see, the features of the demo resemble those of my Urban Tactics. The main important different is that the avatar can jump and walk on ramps, while in Urban Tactics the level is completely flat.
Another difference is the use of level items (items placed in the GtkRadiant Level Editor) to place objects, such as medikits, in the scenery.
Both these improvements were already available in Treasure Hunter, but jumps are much more fluid here.

Monday, October 13, 2008

Treasure Hunter (II)

Other two screenshots from Treasure Hunter. Visit the Users' Gallery for more.


Sunday, October 12, 2008

Treasure Hunter

Just a few screenshots from "Treasure Hunter", a side-scroller demo realized years ago by Miguel Manchego Rivas.

If you have developed games or demos using APOCALYX, feel free to submit them, even if they use very few functionalities. I'll be very happy to host them in the Users' Demos page.
Thank you in advance!


Saturday, October 11, 2008

Unicode fonts

Another quite hidden feature of APOCALYX is the support of UNICODE true type fonts.

You can find a demo showing how to display UNICODE true type fonts in "UnicodeTrueTypeFonts.lua" included in DemoPack2.
As you can see in the screenshot, after a true type font has been loaded in the engine, there are several different ways to use it to display texts. This feature is brought to you thanks to the FTGL and OGLFT libraires included in the engine.

Friday, October 10, 2008

Multiple viewports

Probably this is one of the most hidden features of the engine, but APOCALYX can also support multiple viewports.

There are several kinds of viewports: first of all, the world scene can be seen from different points of view, then also other simplified 3D worlds independent from the main scene can be rendered in their own viewport. To see the feature at work, try the "Viewports.lua" demo in DemoPack1.

Tuesday, October 7, 2008

Post MekaWars: Small RTS

Well, why should we limit the range of possible applications of the programming-game concept to the examples given in the past days? Other possibilities are available, such as the genre of Real-Time-Strategy games.


The paradigm harvest-build-attack is simple enough to be mastered by our intelligent bots, also known as agents. Your possible objection may be based on the number of the units: if one has to assign a virtual CPU to each unit, their computational power must be very limited. In this case, however, I have in mind something different: each player will program the AI of his army as a whole, then the computational time has to be shared among several units. This means that a single thread, the general, will command a number of units and receives feedback from them, leaving some of them, during time consuming activities (harvesting), in a sleeping status. The working unit will awake only for short periods, for example to control the nearby environment for threats. The approach may seem complex, but it's not as difficult as some programming-games are and... no general says that an army is easy to master.

Monday, October 6, 2008

Post MekaWars: SoccerTactyx

As a final example of projects that are going to benefit from the MekaWars development, let's consider the very-long waited Soccer Tactyx (ST). If you have been reading this blog since the beginning, you remember that ST was planned on occasion of the European Football Championship. Now I think that a more realistic release will be on occasion of the... Football World Cup!

Delays apart, also very common in professional games, you must consider that all the code behind MekaWars is also very useful to ST as well. In fact, if you look at the 2D viewer of the recent MekaWars preview (MekaWars.zip), you can easily imagine to substitute the space-fighters with soccer players and the resources with a ball. After this imaginative effort, you can immediately recognize the soccer mode of Gun-Tactyx when seen in 2D mode. The view is more suggestive and realistic in 3D mode, of course, but the viewer is independent from the simulator, once the rules of physics and the soccer players' behaviors are set.
In conclusion, in Soccer Tactyx the units are not fighters and harvesters, but soccer players. The enviromnent is not outer space, but a soccer field. The players will program the AI of their team, and watch them play against teams the AI of which was written by other players.
It's a long way to Soccer Tactyx yet, but the programming behind MekaWars will be useful even in this very different field.

Sunday, October 5, 2008

Post MekaWars: GunTactyx2

You may know that MekaWars, the game currently in a heavy development, is a spin-off of Gun-Tactyx (my CROBOTS-like QUAKE3-style programming-game) and long before of JRobots (my Java CROBOTS-like game with online tournaments). You also may know that I planned long ago a sequel to Gun-Tactyx, that is GUN TACTYX 2.

The occasion to develop MekaWars has delayed the GUN TACTYX 2 development a lot, but all the code behind MekaWars can be applied to GT2 as well. Effectively, if you look at the 2D viewer of the recent MekaWars preview (MekaWars.zip), you can imagine that those dots may represent different kind of objects other than space-fighters and space-harvesters. This means that a lot of code will be easily recycled.
Thus in GUN TACTYX 2 the units are not fighters and harvesters, but soldiers. The enviromnent is not outer space, but indoor or outdoor spaces. The players will program the AI of their team of specialists, each with his own different weapon, and watch them fight against soldiers whose AI was written by other players. Much more complex than MekaWars is, because of the articulated environment, but also worth a try and very beautiful to see.
It's a long way to GUN TACTYX 2 yet, but the programming behind MekaWars will help a lot even in this challenging environment.

Saturday, October 4, 2008

Post MekaWars: City Racing

If you have read the last posts, you know that MekaWars is currently in a heavy development phase. You can also discover the concept behind MekaWars playing with the recent preview (MekaWars.zip).
MekaWars is a game set up in a outer space environment, but the genre of "programming-games" can be obviously applied to worlds subject to other rules. For example, let's consider a few long waited APOCALYX demos starting from City Racing.


In City Racing, the units are not fighters and harvesters, like in MekaWars, but racing cars. The enviromnent is not outer space, but the streets of a town. The players will program the AI of their pilots and watch them race against pilots written by other players. Not as tricky as MekaWars is, but since the pilots' management is simpler and the action more fast paced, the game may result even more involving.
It's a long way to City Racing yet, but the programming behind MekaWars will help a lot even in a so different environment.

Friday, October 3, 2008

Particle System

The particle engine implemented in APOCALYX simulates the movement of textured particles in a frame rate independent way. Each particle moves along a path that is a superposition of two kind of movements: a quadratic path (characterized by an initial position, speed and acceleration) and a circular path (built from a radius and an angular speed). As usual, those parameters are linearly interpolated according to the life of the particle, together with its color, alpha transparency and size.

Fire and smoke

Smoke trail

Dragon's fire

Thursday, October 2, 2008

MekaWars official site (II)

I couldn't resist and show a few screenshots taken from the new MekaWars site that is going to appear at www.MekaWars.com. More detailed instructions, more demos and full featured forums: the real game apart, what could you ask more? Stay tuned!





Wednesday, October 1, 2008

Total War

Just a screenshot

Tuesday, September 30, 2008

One vs All

Just a screenshot

Monday, September 29, 2008

Harvesters

Just a screenshot

Sunday, September 28, 2008

New MekaWars demo!

The second MekaWars demo is finally here!
You can download MekaWars.zip from SourceForge (2.5 Mb)

Since the first demo was very primitive, this new preview includes several improvements:
  • a static initialization screen
  • an options screen with animated models
  • users can choose the number of units
  • radar tracks shown in the 2D viewer
  • two different programmable teams
  • improved info and Lua documentation
  • a Lua language programs editor

Please, report any problem that you can experience with the new demo and feel free to post here comments, suggesions and constructive criticisms about the MekaWars simulator.


Saturday, September 27, 2008

The 2nd MekaWars demo (II)

The second MekaWars preview is almost completed. In the screenshot you can see a preliminary mask to modify the number of items in the arena. The upload is scheduled for tomorrow afternooon.

Friday, September 26, 2008

The 2nd MekaWars demo

The second MekaWars preview is under development. The next demo is going to include some masks useful to personalize the test arena. Stay tuned!

Thursday, September 25, 2008

MekaWars' radars

Very soon you'll be able to play with an improved MekaWars demo. In the current version, published a few days ago, there is very little to change: the starting situation is always the same, but you can already try to modify the basic AI written in "pilot.lua". Then, there is no documentation and some important features of the 2D viewer are still missing, like the drawing of the radar tracks (very useful to understand if the pilot's view of the surrounding environment is optimal).

In the next to come version, you'll get a short Lua manual to understand the differences between Lua and the other languages that you may already know, then a few dialogs to modify some properties of the playground and, finally, the radar tracks.
Stay tuned! The new demo will be available in just a few days.

Wednesday, September 24, 2008

MekaWars official site

The MekaWars official site is already online.

Not much to do on the site yet: it's simply a placeholder for the future official site that is going to manage the MekaWars universe, infact the game is still in heavy development. However, you can play a little with the very early preview the link of which was posted a few days ago on this Blog.
Improved versions with more documentation will be available soon, but be aware that, while the simulator behind the scenes is stable in its design, the "real thing" will be graphically much better, of course!

Tuesday, September 23, 2008

The Gun-Tactyx site is back

Waiting for MekaWars, I put online again the old Gun-Tactyx site.
It has been hosted at GameProg.it for years, but recently they modified their hosting policy and there is no more space for external projects.

I uploaded it for historical reasons only, in fact more than two years have passed since the last online Gun-Tactyx tournament. However, if you were addicted to Gun-Tactyx, you should consider to keep in touch with MekaWars, because its concept is very similar.
MekaWars renews the playability of Gun-Tactyx, extends the modularity of the units, but also simplifies the AI programming phase.

In practice, the main difference between Gun-Tactyx and MekaWars is in the programming language: Gun-Tactyx script were written in SMALL, while MekaWars adopts Lua (that is also the language in which the simulator is written).
The advantage to use Lua is in its versatile interpreter: it does not need a compilation phase, its syntax is simpler to master for beginners and it keeps all the advantages of the SMALL interpreter (full control on memory allocation, step by step execution of bytecode instructions, simulations completely reproducible).

Monday, September 22, 2008

Banners in Flash (II)

Another banner in Flash freely created through PowerBullet.

I think that this new one is cleaner and more readable than my two-months-old past attempt. The banner already links to the official MekaWars site, but the site and the game are still in development. While waiting for the final version, give a look at the very early 2D preview posted yesterday.

Sunday, September 21, 2008

MekaWars very early demo

Since a reader has asked for it, I have uploaded a very early demo showing the MekaWars simulator at work. Don't expect too much: it's only the 2D viewer that I used in the past four weeks to capture a few screenshots and demonstrate some of the simulator features.
You can download the MekaWars very early demo (1.5 Mb) from SourceForge. Just for blog readers' eyes only.

Here just a few notes follow to describe what is available in this very simple demo (read the included readme.htm file for more details).
First of all, let's explain how to play. MekaWars is not going to be an interactive space combat simulator: it is based on the same design of JRobots, thus it is a "programming-game", those games where players program the AI of their team of bots and then watch them fight against other players' teams.
In the demo, you can experience only a few features of the real simulator and the situation at the beginning is always repetitive: 2 fighters and 6 harvesters that always start from the same positions, while asteroids and resources change the position at random. In practice, you must fight against yourself to see some action.
To develop the pilots' AI, you must program in Lua the file 'pilota.lua', that already features a few lines of simple behaviors. In the readme.htm, you can read a short list of the available functions.
Feel free to ask for any additional explanation and stay tuned for more interesting, more complete and more playable demos.

Saturday, September 20, 2008

MekaWars trailer (VI)

Space station

Twilight on the sun

Orbiting fighters

Thursday, September 18, 2008

The Wadfather

I always look for good resources for my demos and games and sometimes I find large repositories under the sun that I missed completely for years. One of these is The Wadfather.

The Wadfather is an important source of graphic files for game developers, focusing primarily on First-Person Shooters such as Half-Life, Quake 3 Arena, and Unreal. they currently feature: 552 environment maps, 198 texture collections containing 19004 textures, 69 desktop wallpapers.
Are you looking for a suggestive skybox for your game? Do you need nice textures in the public domain? Do you simply look for a nice wallpaper for your desktop? The Wadfather is the site for you!

MekaWars trailer (V)

Fleet flying over a planet

Fighters in an asteroid field

Orbiting fighters

Wednesday, September 17, 2008

Particle-based physics (III)

The particle-based physics engine included in APOCALYX is useful not only to simulate flags and cloths, but also other kind of objects with different physical properties.
In fact, the rigid constaints that link particles are resolved spreading the calculations over several frames (the method, known as relaxation, guarantees convergenge, but not immediately). If the satisfaction of the constraints is further relaxed, the body built of that particles and sticks looks like a soft body rather a rigid body, as the jelly cube that you can see in the screenshot.

Other links may be designed to achieve perticular effects and behave like ropes, bumpers, springs or dampers, instead of rigid sticks. To simulate those different links, there is no need to modify the core of the constraint solver, but only the required stick lenghts. For example, a rope is a stick that can be shorter than a given length, but not longer; a bumper is just the opposite of a rope; a spring restore its lenght at a rate proportional to that length itself; a damper restores its length at a rate proportional to the length restoring rate itself; and so on.
Even if the algorithm it quite simple, the range of effects that one can achieve is remarkable.

Tuesday, September 16, 2008

Particle-based physics (II)

Sometimes people asks how those cloth simulations that you can find among the APOCALYX demos are done, or more precisely how can a virtual cloth be affected by wind. Are they simple animations or are precise physics laws applied?

I programmed that effect several years ago and some simplified technique had to be applied, because there was no PhysiX engine running on the GPU at that time. The wind-blowing-on-cloth effect was part of my particle-based physics engine, that I called SimulAxion.
I first read about a particle-based physics engine in an old paper by Thomas Jakobsen, who designed the dead-body simulator of the first chapter of the Hitman series: “Hitman: Codename 47”. In that paper Thomas described a simple way to simulate rigid-bodies, soft-bodies and cloths, through the use of particles linked by sticks. In practice, the particles follow the usual laws of dynamics, but also they are constrained in their motion by rigid connections with nearby particles. The result is a very fast way to create a believable physics behavior with little computational effort.
In practice, the algorithm works on a grid of particles connected by almost rigid constraints, not the usual springs as you can see in other simulations. The distance constraint is solved by the particles themselves over several frames: they simply adjust several times their position to better fit the required stick lengths.
Finally, to create the blowing wind effect, the 3 vertexes of each triangle, that the cloth is made of, are displaced accordingly to the surface exposure to the wind direction: large displacements when the wind is perpendicular, no one when it is parallel.
It may be surprising, but this small set of rules (linked particles and wind direction) is sufficient to create in a realistic way those characteristics movements of flags and cloths.

Monday, September 15, 2008

Incoming missiles (II)

Just another radar-screenshot