APOCALYX is a...

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

Saturday, April 23, 2016

Friday, July 18, 2014

YouDev.it about apps & games development

The Apocalyx 3D Engine is adopted as the main development tool at You Dev .it a new site devoted to tutorials about apps and games programming. There are sections about 3D Games programming, 2D Games programming, Text Games programming and more.

The 2D section adopts the TooDee Engine, while the tutorials about text adventures (interactive fiction) use the Inform 7 IF Design System.

To visit the site, follow this link: http://youdev.it

Tuesday, July 2, 2013

Just a simple APOCALYX 3D Engine tutorial


So you have downloaded the full 64 Mb Windows installer of the APOCALYX 3D Engine. Now you want to learn how to use it.
The engine is distributed with a lot of interesting demos. From their Lua sources you can learn a lot, but also a few lines of simpler code may be helpful.

Thus let's follow this code provided by R. Roswell. This source features a basic tutorial which explains how to start the engine, clear the screen, and sets the update and finalise code.
What are those "start", "update" and "finalize"? Well, it's simple: a Lua script controls completely the game (or generally, the program/simulation) behaviour. An infinite loop is executed continuously and that loop calls an "update" function defined by the developer. Usually a call to some keyboard and mouse control functions is performed, too.

But let's read the source (in red bold style the actual code, while in red italics the Roswell's comments):

The following are functions needed at the start of the script. The actual start of the script is at the bottom of the file. You may wish to read the bottom segment first.
This is used for our group of functions starting with callback.


  callback = {}

  function callback.init()



We set the title of our render window. We then also set the size of our window. This is part of the WIN object.

    setTitle("Tutorial 1: Basic Engine Template")
    setDimension(800, 600)





empty() and emptyOverlay() empty the 3D scene objects and 2D scene objects. These methods are part of the WORLD object.

    empty()
    emptyOverlay()



This removes the partial help menu located on the left hand side during rendering. With the following command it will simply display "F1 Show/Hide Help". If you want to disable the help menu completely use the command hideHelp(). These methods are part of the WIN object.

     showHelpReduced()


This sets the blanking colour of the scene. This is colour fills the screen after each frame. Part of the WORLD object.

     setClear(0.0,0.0,1.0)
  end

  function callback.update()


Here we could move our objects around and take input


  end

  function callback.final()


empty() and emptyOverlay() empty the 3D scene objects and 2D scene objects. This tutorial has no objects but it is always good practice to clear the scene. These again are part of the WORLD object.

    emptyOverlay()
    empty()


  end


This is where the engine actually gets initilised. The render loop is controlled by ApocalyX and you gain control back through the CallBack functions.
What this means is when ApocalyX Engine starts it runs our function callback.init specified in the first parameter.
Before the engine renders its next frame to the screen it also runs our function callback.update specified in the second parameter.
When you close the program or end the scene the engine runs our function callback.final specified in the third parameter. This is used to free up any resources or you might want to save some data.


   setScene(Scene(callback.init,callback.update,callback.final))


Scene is a construct method of Scene object and is used for setScene which is part of the WIN object.

Thank you Roswell for this clear presentation of the main loop of every APOCALYX game.

For more details and the complete source code of this simple example, visit the Tutorial section at the internet address: http://apocalyx.sourceforge.net/tutor-basics-01.php

Monday, August 17, 2009

Fleet Viewer



The new MekaWars' Fleet Viewer

Sunday, January 18, 2009

MekaWars meets Gun-Tactyx

Yesterday I cited the space marines that populate the starships during battles.

Space marines defending the
central area of a module

My idea was to develop the MekaWars control unit system (as you may already know, in MekaWars the players develop the AI of their units - that's how MekaWars is meant to be played) and recycle it for Gun-Tactyx-2 (that is the sequel of Gun-Tactyx).
Then, recently, I had a more interesting idea: why don't merge the two projects? This brought to an additional mechanic of the game.
During starship battles, hits can destory a unit (producing wreckage that is going to be collected), but starship modules can't. The latter are only disabled, but hulls may be robbed of their resources (up to a certain percentage).
The additional mechanics is: before materials can be brought away from a module, a space marine unit must assault it and defeat the defending troops. Here is where the Gun-Tactyx fight-style comes in.
You can imagine hard fights between starships and, at the end, you'll see assault units moving to the modules; then the attention is focused on the inner corridors of the modules, where attackers fight the defenders (as in the initial scene of the first Star Wars movie) to steal the contained resources or the whole module.

Space marine on an assault
unit waiting for the attack

Saturday, January 17, 2009

MekaWars' dungeons

The starships concept included in MekaWars was extended and improved. Additional modules apart (research module to develop the projects from which devices, units and ships are designed; factory module to effectively build devices, units and new modules), the ships have now got a crew.
I'm not talking about the pilots of units or the captains of the ships (or even the admiral that commands the fleet), but there are also the space marines that defend the ships from outer attacks.
I'll descibe them more deeply tomorrow. For the moment give a look to the starship's corridors.

Starship's corridors

Friday, January 16, 2009

MekaWars' stellar systems

Yesterday I talked about the Galaxy. Today is the time of stellar systems.

The star, one planet with a moon
and a fleet exiting the hyperspace

Each sector of the Galaxy contains a stellar system. The prototype of the system is given by a star, with several planets, each with its moons.
The asteroids rich of resources will be located in that environment, so the units must scan the space to avoid the star, planets and moons and look for asteroids or enemy units.
I already told of a different combat system. One of the differences is: once a unit (fighter, harvester, exoskeleton etc.) is destroyed its deviced will be available as wreckage, after the explosion. Special units will look for that wreckage to collect it and bring it to the fleet hulls. Then such devices will be used to assemble other units or sold to other players.
Some ship will mount research modules and factory modules to build units, but collecting devices from enemy players will save a lot of energy and resources.

Thursday, January 15, 2009

MekaWars' Galaxy

MekaWars Offline will feature a strategic map like the one you can see below.

MekaWars' strategic map

Each player has got a sector to manage, separated from other players by neutral sectors.
A fleet can travel from sector to sector through hyperjumps, because travels among stellar systems needs too time being performed at sub-light speeds.
A fleet can jump in a neutral sector only if no more than two fleets are already there (well, one can jump, but it's almost sure that the fleet will appear too near to the star to survive).
Then there are three possibilities: if no fleet is there, the harvesters can freely work to collect resources (the usual iron, silicon and uranium) to research and produce new devices, units and ship modules; if there is a friendly fleet that is already harvesting, the cargos can commerce exchanging materials; finally, if there is an enemy fleet, a battle could take place.
A new kind of battles, different from the usual ones described in past posts and shown in the demo, will be available, but let's discuss it in one of the next posts.
Different rules apply when a fleet enters the sector where the base of a player is located: only one enemy fleet at a time can enter and enough time since the last attack must have passed.
Just an additional note about resources: asteroids rich in uranium (useful to produce energy) will be more frequent near the center of the galaxy, the silicon (useful to build devices) will have an higher density along the border, while iron (necessary to build any kind of structure) will be located more frequently in between.

Wednesday, January 14, 2009

MekaWars' simulator

Almost three months have passed since the last post. I was quite busy and it was impossible for me to publish the promised daily post.
However recently I've found some spare time to spend and I used it to continue the development of MekaWars Offline. In particular I have successfully ported the already working Lua simulator to C++, so very large starship battles are going to be possible.
The port wasn't very difficult, because the Lua code was already object oriented, and the final result is more mantainable and error proof.

CodeBlocks & Borland C++ at work
to compile the MekaWars simulator

As you may know, MekaWars Offline is a project different from MekaWars Online. In fact, the latter is going to be played online among a large number of users, who are going to manage their empire like in other browser games, but its core will be the battle simulator of MekaWars Offline. This one will be more similar to a mixture of JRobots and Gun-Tactyx (where the players are only going to share the algorithms of their bots), as I'm going to describe in the next posts.

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.