Poll

Continue work?

Yes (Say why)
28 (73.7%)
No (Say why)
10 (26.3%)

Total Members Voted: 38

Author Topic: So, I made a game too. (Server offline, but I can use models now :D )  (Read 4749 times)

So where's my automatic peestols and grenades and the Russian bad guys?
They be coming.

You should add bricks for building, and three starting tools, a printer, a hammer, and a wrench for eventing!

...

Srs replay: You should add building of some sort.

You should add bricks for building, and three starting tools, a printer, a hammer, and a wrench for eventing!

...

Srs replay: You should add building of some sort.
This will be a modern era sandbox game. Meaning it will be a game where you collect resources to build whatever you want. You could make a farm, or mine for ore, or make boats, or whatever.
Eventually...

This will be a modern era sandbox game. Meaning it will be a game where you collect resources to build whatever you want. You could make a farm, or mine for ore, or make boats, or whatever.
Eventually...

Do this and stuff bricks at what some people make.

Also Continue your work.

Do this and stuff bricks at what some people make.
Lol.
Also Continue your work.
And thanks.

Also, it's gonna take me a while to make a model loader, and when I'm done it'll be able to show .obj model files.
This is my work so far:
http://pastebin.com/ppqbe0RR

After that I'll work on an inventory system, and then adding a real landscape, not just a flat square with the same texture.



EDIT: Being a stupid, nevermind.

EDIT: Being a stupid, nevermind.
What did you say origionally?
I accidentally voted no.
I'll edit poll to allow changes.

Also, I was away for an hour + for irl stuff.
Now I'm back, and it'll probably take be another two hours to finish the model phraser, but when I'm done, detailed objects will be able to be imported in game.

What did you say origionally?
That it crashed, and then I saw that you knew the server was down, which is why it's crashing I suppose.

That it crashed, and then I saw that you knew the server was down, which is why it's crashing I suppose.
Ya, that was why.
Also, you can check stderr.txt for errors.

Anyway, I completed a basic, single polygon .obj phraser and shower, so I can make complex shapes and display them.

Here's the code, by the way:
Code: [Select]
/* start model code */

string fstr(float in)
{
    stringstream bob;
    bob<<in;
    return bob.str();
}

struct vec3
{
    float x,y,z;
};

class globjfaces
{
    public:
    int verts,fv;
    vec3 vectors[101];
    vec3 facevector[101];
    void show(int x,int y,int z);
    void readin(char *filenam);
    globjfaces(){verts = 1;fv = 0;};
};

string v3str(vec3 in)
{
    string ret = "";
    ret+=fstr(in.x);
    ret+=" ";
    ret+=fstr(in.y);
    ret+=" ";
    ret+=fstr(in.z);
    return ret;
}

void globjfaces::show(int x,int y,int z)
{
    glBegin(GL_POLYGON);
    for(int i = 0; i<fv; i++)
    {
        glVertex3f(x+facevector[i].x, y+facevector[i].y,  z+facevector[i].z);
    }
    glEnd();
}

int numwords(string in)
{
    int count = 0;
    int offset = 0;
    bool goon = true;
    while(goon)
    {
        int pos = in.find(" ",offset);
        if(pos != string::npos)
        {
            count++;
            offset = pos+1;
        }
        else
            break;
    }
    return count+1;
}

string getword(string in,int word)
{
    int count = 0;
    int offset = 0;
    int begw = 0,endw = 0;
    bool goon = true;
    while(goon)
    {
        int pos = in.find(" ",offset);
        if(pos != string::npos)
        {
            offset = pos+1;
            if(count == word-1)
            {
                begw = offset-1;
            }
            if(count == word)
            {
                endw = offset-1;
                break;
            }

            count++;
        }
        else
            break;
    }

    return in.substr(begw,endw-begw);
}

void globjfaces::readin(char *filename)
{
    string line;
    ifstream infile(filename);
    while(!infile.eof())
    {
       getline(infile,line);
       if(numwords(line) > 1)
       {
           if(getword(line,0) == "v")
           {
                vec3 tmp;
                tmp.x = atof(getword(line,1).c_str());
                tmp.y = atof(getword(line,2).c_str());
                tmp.z = atof(getword(line,3).c_str());

                vectors[verts] = tmp;
                verts++;
           }

           if(getword(line,0) == "f")
           {
                for(int i = 1; i<numwords(line); i++)
                {
                    facevector[fv] = vectors[atoi(getword(line,i).c_str())];
                    fv++;
                }
           }
       }
    }
}


/* end model code */


Lol, on to inventory now.
Also, server is back online.

Finished model phraser and displayer.
See this comparison of an in game gourd and the same gourd in a model viewer.

bump, get the server up, I want to see new stuff

I cant really say if i like it or not. Since it's so basic right now. But it looks like you really know what your doing, so continue and then I'll have a full opinion on how this is going. Also, is this game is going to be in the style of AoT?