2 Replies - 333 Views - Last Post: 22 December 2014 - 09:23 AM Rate Topic: -----

#1 Spiked Penguin  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 98
  • Joined: 19-December 13

Not sure how I want to format the story and side quests

Posted 25 November 2014 - 10:16 AM

I am coding a 2D open world RPG but, I am not sure how I want to start. I have began writing the story line (incomplete) but, I know what I want to do. I just am not sure if I should implement the side character dialogue and quests as I write the game or if I should do it after I code the story line. What do you guys think would be easier?
Is This A Good Question/Topic? 0
  • +

Replies To: Not sure how I want to format the story and side quests

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 10020
  • View blog
  • Posts: 38,266
  • Joined: 12-June 08

Re: Not sure how I want to format the story and side quests

Posted 25 November 2014 - 10:21 AM

how is this a 'share your project'? Moving to game dev.

Quote

I just am not sure if I should implement the side character dialogue and quests as I write the game or if I should do it after I code the story line.

"Code the story line"? You mean write the story line, right? I would figure you would hammer out the main story and keep a quick hit list of side quests. Flesh those out as you have time, are early on milestones, or before your release date. Work on the core first and add gold plating afterwards.
Was This Post Helpful? 0
  • +
  • -

#3 jbeme  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 98
  • Joined: 30-October 09

Re: Not sure how I want to format the story and side quests

Posted 22 December 2014 - 09:23 AM

I'd add quests after the entire world is created, collision works (if you have that), and movement works.


But I would keep an idea of how you want quests to work. So as your programming you can put in code that dynamically adjust later.

For example. Have a text file that holds coords, texture, shaders to be used, color, and the name of a function. That would allow you select create a function on the fly if you decide on a unique quest, but your programming is already set up to accept it..
Then you can add the function in later, or change the shaders or whatever.

Like:

menu_loader(char menu_layout_loc[20]){
int a = 0;
int b = 0;
char temp_hold[100];
char *temp_pnt;
FILE *fp = fopen(menu_layout_loc, "r");
while (fgets(temp_hold, 100, fp)) {
    temp_pnt = strtok(temp_hold, " ,");
    while (temp_pnt != NULL){
            printf("%s", temp_pnt);
        vertices[a][b] = atof(temp_pnt);
        b++;
        temp_pnt = strtok(NULL, " ,");
    }
    if (b == 28) {
        b = 0;
        a++;
    }
}
fclose(fp);
return;
}


This can read a .txt file like the one below, and puts each float into the array.
0.55,	0.55,	0.0,	0.2,	0.2,	0.2,	1.0,	1.0
0.5,	-0.5,	0.0,	0.8,	0.8,	0.8,	1.0,	0.0
-0.5,	-0.5,	0.0,	0.9,	0.8,	0.8,	0.0,	0.0
-0.5,	0.5,	0.0,	0.8,	0.8,	0.8,	0.0,	1.0


First three on each row are x,y,z. Second three are color. Last two are texture cords.
It would be a simple thing to add
base_vert, spec_frag, some_func
at the start of the .txt on it's own line. Then use to that dynamically change things - the same way the cord array does.

Start out dynamic, and quests can be added later easily.

For OpenGL the above dynamic array setup would be run through something like
 glBindBuffer(GL_ARRAY_BUFFER, VBO);

/*[color="#008000"]with an int to help out, vertices[0] can be changed to vertices[x] to keep it dynamic[/color]*/
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertices[0]), vertices[0], GL_STATIC_DRAW);

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);

   glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 7 * sizeof(GLfloat), (GLvoid*)0);
/*[color="#008000"]can also be converted to a dynamic state[/color]*/
    glEnableVertexAttribArray(0);
    // Color
    glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 7 * sizeof(GLfloat), (GLvoid*)(3 * sizeof(GLfloat)));
    glEnableVertexAttribArray(1);
    // TexCoord
    glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 7 * sizeof(GLfloat), (GLvoid*)(6 * sizeof(GLfloat)));
    glEnableVertexAttribArray(2);



I should also mention, .txt might not be the best way - but it's a good start. It's also something you can change easily, later on. Once your game is working and finished, if you plan to host on a place like steam - they will help you adjust a few things if you have most of it set up .txt files. Long as you are at that point, they can fix it easily.
If your not going that far, then .txt works fine. For 2D .txt probably works fine anyways.

This post has been edited by jbeme: 22 December 2014 - 09:41 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1