Thursday, July 1, 2010

Asteroids Field

Time to load the engine a bit.
So, ladies and gentleman... a 1500 asteroids field.


Wednesday, May 12, 2010

May 2010

In these days i've little time, but i've regained my motivation.
So no exciting news, but im going deeper in ogre to learn how to use it.
I've bought some books, and it looks like very interesting!

  • Pro OGRE 3D Programming, by Gregory Junker. It's an introductional guide to the engine. There's no "hardcore" sessions, but it's essential to learn about all the philosophy behind ogre. Ogre webpage is full of informations (wiki, documentations, forum).. but it's a bit difficult to learn how to use it starting from scratch, a book imho is essential.
  • Game Coding Complete, 3rd edition by Mike McShaffry. A wonderful guide about how to write a game, the right steps, tips, common mistakes, and a lot of algorithms. Mike was a game developer of "Ultima" series and "Thief" series. So he KNOW how to do it.
  • Real Time Rendering by Tomas Akenine-Moller, Eric Haines, Naty Hoffman, a wonderful Bible about the real time tecnique, and all state-of-the-art algorithms.

Anyway, i've rearranged all my code, rewriting all from scratch. And i've reintroducted the HUD that was not present on previous video




Tuesday, April 20, 2010

Camera

Previous video was affected by an ancient issue: the camera is too much "nervous", so when you see it you could suffer some headache!

So i've implemented a tracking option (with previous version there was no "built-in" solutions), and i've tracked the camera to the moon..

This is the result, and i think that it's nicer.

First Ogre Video



Just to show you Ogre3D in action.
Don't look to distance, dimension, time, it's only a demo tho show you how ogre works, especially with shadows....

Monday, April 19, 2010

Ogre again

Ok, despite to lack of time, i've finally choose to adopt the Ogre enviroment.
It's robust and enough powerful for my needs.
I'm making little steps to learn how to use it. It's quite simple, but it has some little lack, especially on the 2D side.

Anyway, until now, i've recreate sky doom, lens flares, planets and shadows.

Here a screenshot..


Wednesday, March 24, 2010

First Screenshot using Ogre3D


Ok, you' ve seen this a lot of time, but there's an important difference: this screenshot was made using the Ogre3d engine to render the scene.
The source is very small, so small that i post it here!
And, if you examine the image you can see two important news:

- Shadows are in hi-res and very realistic.
- Anti-Aliasing is implemented

The source?


#include "ExampleApplication.h"

class TutorialApplication : public ExampleApplication
{
protected:
public:
TutorialApplication()
{
}

~TutorialApplication()
{
}
protected:
void chooseSceneManager(void)
{
mSceneMgr = mRoot->createSceneManager(ST_EXTERIOR_CLOSE);
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

}

virtual void createCamera(void)
{
mCamera = mSceneMgr->createCamera("PlayerCam");
mCamera->setPosition(Vector3(0,10,500));
mCamera->lookAt(Vector3(0,0,0));
mCamera->setNearClipDistance(5);
}

virtual void createViewports(void)
{
Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(ColourValue(0,0,0));
mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
}


void createScene(void)
{
Entity *ent;
Light *light;

mSceneMgr->setAmbientLight( ColourValue( 0.1, 0.1, 0.1 ) );
mSceneMgr->setShadowTechnique( SHADOWTYPE_STENCIL_ADDITIVE );


mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox2");

ent = mSceneMgr->createEntity("Station", "Mesh.001.mesh");
ent->setCastShadows(true);
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);

light = mSceneMgr->createLight("Light1");
light->setType(Light::LT_POINT);
light->setPosition(Vector3(30, 150, -250));

light->setDiffuseColour(1.0, 1.0, 1.0);
light->setSpecularColour(1.0, 1.0, 1.0);



}
};

#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"

INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
#else
int main(int argc, char **argv)
#endif
{
// Create application object
TutorialApplication app;

try {
app.go();
} catch(Exception& e) {
#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
fprintf(stderr, "An exception has occurred: %s\n",
e.getFullDescription().c_str());
#endif
}

return 0;
}



Nothing more.

---

Eccovi la prima immagine ottenuta usando il motore Ogre3D. Lo so, e' uguale a un sacco di altre che ho postato in precedenza, pero' la novita' fondamentale e' che e' stata ottenuta implementando il mio materiale dentro al nuovo engine.
E la cosa sorprendente e' che e' stato davvero facile! Il sorgente che potete leggere qui sopra e' tutto cio' che serve per ottenere una telecamera mobile, uno skybox, una mesh e delle ombre.
Tra l'altro le ombre sono molto piu' precise di quelle che ho ottenuto io con l'approccio "fai da te". E tra l'altro e' arrivato "gratis" anche l'antialiasing.

Wednesday, March 17, 2010

Tau Ceti is dead?

Briefly: i've received a lot of question about the Work-in-progress status. The answer is: i've no time, unfortunately. So i cannot spend hours per day into it.
So i've understand one thing: it's impossible to write all by myself.. i need an help for the engine part.
So i've searched for a 3d engine freeware-open source.. i've tried UDK but it's too complex and too much fps oriented. Not suitable for a spacesim.
Then i've tried ogre3d and... it's ok! Simple and powerful, in few hours i've made the same thing i've made by myself in one year!
So Ogre3d is become my engine for the game so i'll can spend my time only into the gameplay!
I need some days to undestand the basics, to convert all the meshes or skydome and then i hope to really make some other steps!

---

Probabilmente si', si sapeva del resto.
Pero' c'e' una speranza.
Preso atto che da un anno a questa parte non ho quasi mai tempo da dedicarci, e che quindi l'idea di scrivere un engine da zero e' pura follia, ho deciso di appoggiarmi ad un engine di terze parti.
Ho provato udk ma, onestamente, non fa al caso mio: estremamente complesso, si sposa sicuramente bene con gli fps-tps classici, ma per farci il "gioco qualsiasi" c'e' talmente tanto lavoro di sviluppo che probabilmente si fa prima a scrivere tutto in C++. Molte attivita' vanno fatte attraverso l'editor dei livelli, che mi serve a ben poco vista la natura procedurale del mio gioco.
La documentazione e' poi quella che e', essendo un prodotto commerciale solo in seguito rilasciato freeware non ci si possono aspettare gran tutorial ed esperti online pronti ad aiutarti se non ci capisci un accidente.
Pertanto l'ho accantonato.
Ho provato Ogre3D e... in mezza giornata ho ottenuto gli stessi risultati che ho ottenuto in un anno di sviluppo!
Il suo e' un approccio parecchio old-style: una serie di librerie e dll da linkare al proprio sorgente per chiamare i vari metodi.
Questo mi mette a mio agio nella scelta di come organizzare il lavoro, e contemporaneamente mi libera dal "fardello" di dover occuparmi di tutto cio' che riguarda il 3D.
Posso insomma concentrarmi di piu' sulle meccaniche di gioco piuttosto che sul rendering.
Inoltre ho visto che ha diverse belle features. Le ombre si fanno in un attimo, effetti nebbia, landscape, sky dome, e tante altre cose si realizzano con UNA LINEA.
Cosi' ho deciso di farlo mio ed e' diventato ufficialmente l'engine del gioco.