Planet landing/flying

Development directions, tasks, and features being actively implemented or pursued by the development team.

Planet landing/flying

Postby strook » Fri Sep 03, 2010 5:38 am

Hi there, I'm a imformatics student focussed on graphics programming.

My aim is to make planet landing flying in vs come true like in the infinity engine.

I did already some work on freeorion.

but they don't want my ideas.

the steps to realize this are:

1. dl documentation about procedural synthesis (random surface generation) - done.

it seems to be easy to generate surface.

2. compile - done

todo:

3. work into the engine and understand it.

is the engine ogre based?

i did already some work on a program based on that engine.

can you give me a short introduction on which c++ files i have to focus?

realize planet flight:

4. create the random surface.

there is an alogrythm ready for this called midpoint displacement - the meshes will be easily done, but there are more problems:

1. random texture. i'll get docs for this, too. - for the beginning a simple height seperation
will do (ground level: water - blue color, height level 1: sand yellow, medium level: green, top level mountain (grey color))
2. skybox - when you come into the athmosphere the state of the skybox must change depending on the altitude from blue to black.
3. memorize landscape - the system has to save some mb/gb of surface that the player already has visited.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Planet landing/flying

Postby klauss » Fri Sep 03, 2010 9:07 am

strook wrote:3. memorize landscape - the system has to save some mb/gb of surface that the player already has visited.


I wouldn't consider that as an option. VS has thousands of systems with several planets each. Just a few mb each and it amounts to way too much.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Planet landing/flying

Postby klauss » Fri Sep 03, 2010 9:09 am

strook wrote:3. work into the engine and understand it.

is the engine ogre based?

Nope.
There were attempts at replacing the rendering engine with Ogre, that weren't ever finished.

strook wrote:can you give me a short introduction on which c++ files i have to focus?

All graphics stuff is spread around, but mostly located in src/gldrv and src/gfx

Do you have a more detailled plan?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Planet landing/flying

Postby strook » Fri Sep 03, 2010 10:40 am

after reviewing some code, the engine seems to be similar coded like ogre.

i'll modify test.cpp at first to give out a example landscape.

in the moment i have problems in debugging it cause i don't have .wav codecs on my system.

and it won't compile with sound turned off.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Planet landing/flying

Postby strook » Sat Sep 04, 2010 12:23 pm

I have found out, that the mesh of a planet in planet.cpp
(class
Code: Select all
GamePlanet
)
is created with

Code: Select all
new GFXSphereVertexList


in sphere_generic.cpp.

this class has 2 functions

Code: Select all
BeginMutate

and
Code: Select all
EndMutate


i can replace the polygon structure with

Code: Select all
int GFXCreateList()

and
Code: Select all
GFXBOOL GFXEndList()


which is extracted by

Code: Select all
glGet(...)


and modified by this alogrithm

http://freespace.virgin.net/hugo.elias/models/m_landsp.htm
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Planet landing/flying

Postby strook » Sun Sep 05, 2010 4:22 am

I have written some code,

could you tell me, why i get here a segmentation faultin my code?

Code: Select all
void GFXSphereVertexList::ProceduralModification()
{
    //read vertices
    GFXVertexList::VDAT* read_list = sphere->Map( true, false );
    GFXVertex* pv = NULL;
    int numPolys = 0;
    int numTris = 0;
    GetPolys( &pv, &numPolys, &numTris );
    sphere->EndMutate( sizeof(GFXVertexList::VDAT) * numVertices );
    //modify them
    //write vertices
    GFXVertexList::VDAT* write_list = sphere->BeginMutate( 0 );
    for(int i=0; i<numPolys;i++) {
   //     Vector vert(rand(),rand(),rand());
        Vector vert(100+i,100+i,100);
        (pv+i)->SetVertex( vert );
    }
    write_list->vertices = pv;
-->    sphere->EndMutate( sizeof(GFXVertexList::VDAT) * numVertices );
}



the segmentation fault happens exactly here in your code after calling that EndMutate func:

Code: Select all
void GFXVertexList::RefreshDisplayList( )
{
#ifndef NO_VBO_SUPPORT
    if (game_options.vbo && !vbo_data) {
        if (glGenBuffersARB_p == 0 || glBindBufferARB_p == 0 || glBufferDataARB_p == 0 || glMapBufferARB_p == 0
            || glUnmapBufferARB_p == 0) {
            game_options.vbo = 0;
        } else {
            (*glGenBuffersARB_p)(1, (GLuint*) &vbo_data);
            if (changed&HAS_INDEX)
                (*glGenBuffersARB_p)(1, (GLuint*) &display_list);
        }
    }
    if (vbo_data) {
        BindBuf( vbo_data );
-->        (*glBufferDataARB_p)(GL_ARRAY_BUFFER_ARB, numVertices
                             *( (changed&HAS_COLOR) ? sizeof (GFXColorVertex) : sizeof (GFXVertex) ), data.vertices,
                             (changed&CHANGE_MUTABLE) ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB);
....
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am

Re: Planet landing/flying

Postby klauss » Sun Sep 05, 2010 10:08 am

strook wrote:I have written some code,

could you tell me, why i get here a segmentation faultin my code?

I have no idea.
Did you try debugging it?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Planet landing/flying

Postby strook » Sun Sep 05, 2010 11:30 am

i access invalid memory.
the only reason for this can be that you must preallocate the memory
to where the polygon data is written from getPoly.

tomorrow ill go on coding. if i could compile it on my mac i could spend
more time for this project, but the mac g++ compiler is buggy on my intel
mac.

any ideas what i should do - maybe install linux gcc with macports or fink?
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
User avatar
strook
ISO Party Member
ISO Party Member
 
Posts: 461
Topics: 20
Joined: Fri Sep 03, 2010 5:10 am



Return to Engine Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron