Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 30 Dec 2010
Offline Last Active Sep 02 2013 10:15 PM

Topics I've Started

C++ Developer moving to Web

12 July 2013 - 02:03 PM

Hi all,


I am looking for a bit of advice and possibly some guidance. I programmed in C++ for a good three years. I also used SFML and OpenGL for 1 of the 3 years.  I haven't programmed in it in about 6 months though because I have been so concentrated on trying to learn some web programming. Now what I did was I went on Code Academy, finished the Web fundamentals, Jquery, and Javascript courses. 


I am at a point where I feel I have a grasp on how to program for the web, but no clue really how develop for the web. I can open a text editor, include the needed documents, and a bow grow when clicked, but where do I learn how to make an actual good looking website? Code Academy taught me how to do some neat things with my code, but never how to make a nice, full fledged website.


So I am at the point where I want to try making a small 3D sandbox game and a nice website to encase it. I know this will require WebGL, server side programming, maybe a few helper libraries, and website designing knowledge. I was wondering if someone could point me in the right direction of where to learn those skills. 




My Goal: 3D Web Sandbox Game


I have learned thoroughly:





I have sort of learned:






I want to learn:

Node.js or PHP? (Some server side language)

General Web design (I kinda know CSS but that doesn't mean I know how to make stuff look nice)


Three.js? (I have heard of this, not sure if I should learn it or WebGL, or both)


Any advice, links to great tutorials, or guidance on completing my goals would be greatly appreciated.


Thanks in advance! smile.png

Moving from C++/OpenGL to JS/WebGL

28 March 2013 - 08:48 PM

Hello all!


I am here today to ask for advice from all you wonderful people on this site. I have been programming in C++ and often use SFML and OpenGL to  make work on little projects and occasionally even make some small games and have been doing so for the past 3 years. Now I have had occasional success with C++ and these API's but I don't see myself making much of a profit from these tools (on my own) as I grow older. This is simply because the time and effort required to make a medium-small scale (profitable) game is too great. Considering that I can get nearly the same performance for these medium-small style games using JS and WebGL, I want to jump over to the web side of things.


Now I have just finished "Web Fundamentals" over on code academy and am going to start the JS course (then hopefully a WebGL tutorial from someone) but I don't know that these courses alone will prepare me for the task of making a few games with JS and WebGL and a nice site to house these games. Now the reason I say this is because the courses on code academy seem more like "Introductory" courses. They also seem to skip the design portion of web site creation.


So I was wondering, does anyone have any recommendations to sites/courses/tutorials/books that will assist me in learning the more "Intermediate" to "Advanced" sections of HTML, CSS, and JS. Also maybe a recommendation for a good WebGL tutorial and Web Site design course?




High School Student with High Goals -- Need Advice

19 January 2013 - 11:37 AM

Hello everyone,

I need some advice from you all. I have two problems, one is lack of money and one is lack of drive.

I am a Sophomore High School student who wants to be successful early and is able to go to Stanford. From what I understand Stanford is looking only for the best, so in order to be "the best" I am trying to hold a 4.1+ GPA, trying to make some video games that I can sell so Stanford can see that I show initiative and so that they can see that I can program, and I am trying to play sports at the same time to show that I am a well rounded student (and I enjoy them). I enjoy making games and programming. I like to use C++ and OpenGL and when I was learning and just messing around with that language and library in middle school, I had no problems (probably because I had more time and was less stressed). Now I have problems.

I am having problems with drive. I have this game idea that I like and have been working on but I think these high aspirations of mine are not allowing me to apply myself to programming because I am too busy (and stressed) with school and sports. I go to school at around 8 and I get home after sports at around 5:30. I have plenty of time till bed, but I just don't have the drive to work on my self produced projects (my game for example). Does anyone have any ideas as to why I can't seem to hop onto my computer and start programming? I always seem to drift to youtube and just start watching videos there. I just don't have any will power at this point in the day to push myself to start programming. If I ever do start, I enjoy it, but I just can't seem to start. Does anyone have any advice for me?

Also being a high school student and soon to be college student, I need money. I am looking to use my intermediate programming abilities to make some extra cash and my video game endeavors are not producing any income at the moment. I have looked at freelancing on freelancer.com but it seems as though the amounts are always low and the bids are always in before I even have a chance to compete. So is there any other site or way I can use my programming abilities to make some extra cash? I have looked locally but there isn't much.


Island Generation -- Problem with Duplicates

27 December 2012 - 12:09 PM

Hello all,


I have been working for the past few days on a perlin noise island generator (using libnoise). What I do is generate a terrain, and then apply an island mask to it.  I have added a seed to the island generation portion but I am getting similiar results each time even with a seed. Can someone help me so that I can generate a truely random island each time? Here is what I am currently getting (seeds in parenthesis):









So, as you can see, the maps are very similar. I really don't know why. If needed, here is my code: 

(Steps I take)

1st Generate terrain

2nd Generate island mask

3rd Apply island mask to terrain

4th Draw the terrain


//Little program to generate test map with only 0 and 1 tile

#include <iostream>
#include <libnoise/noise.h>
#include "noiseutils.h"
#include <stdlib.h>
#include <string>

using namespace std;
using namespace noise;

int main()

   module::Perlin myModule;

   utils::NoiseMap heightMap;
   utils::NoiseMapBuilderPlane heightMapBuilder;
   heightMapBuilder.SetSourceModule (myModule);
   heightMapBuilder.SetDestNoiseMap (heightMap);
   heightMapBuilder.SetDestSize (512, 512);
   heightMapBuilder.SetBounds (2.0, 6.0, 1.0, 5.0);
   heightMapBuilder.Build ();

   string seed;
   int iseed;
   //Add support for character conversion to ints and clip string to 8 numbers
   cout << "Please enter a seed: ";

   cout << seed << endl;
   iseed = atoi(seed.c_str());
   cout << iseed << endl;

   float islandMap[512][512];

   enum directions {LEFT = 0, UP, RIGHT, DOWN, NONE};

   for(int count = 0; count < 1; count++)

      //Initialize values for a new map
      for (int i = 0; i < 512; i++) 
         for (int j = 0; j < 512; j++) 
            islandMap[j][i] = 0;

      //Choose a random location, travel in random directions
      int xRand = 0,yRand=0;
      int xPos = 0,yPos=0;

      cout << iseed;

      xRand= rand()%512;
      yRand= rand()%512;

      xPos = xRand;
      yPos = yRand;

      islandMap[xRand][yRand] = 1;
      directions direction = NONE;

      for (int i = 0; i < 10000000; i++) 
         if(xPos == 511 || xPos == 0)
            xPos = rand()%512;
            islandMap[xPos][yPos] +=1;

         if(yPos == 511 || yPos == 0)
            yPos = rand()%512;
            islandMap[xPos][yPos] +=1;

         int oldValue;

         oldValue = islandMap[xPos][yPos];

         int temp;
         temp = rand()%4;
         direction = (directions)temp;
         if(direction == LEFT)
         else if(direction == UP)
         else if(direction == RIGHT)
         else if(direction == DOWN)

         if(oldValue >= islandMap[xPos][yPos])
            islandMap[xPos][yPos] +=1;


      //find max value for normalizing
      int max = 0;
      int min = 0;
      for (int i = 0; i < 512; i++) 
         for (int j = 0; j < 512; j++) 
            if(max < islandMap[i][j])
               max = islandMap[i][j];

            //cout << islandMap[i][j] << " ";

            if(min > islandMap[i][j])
               min = islandMap[i][j];

      //Multiply values of original by new maps generated
      for (int i = 0; i < 512; i++) 
         for (int j = 0; j < 512; j++) 
            float islandValue = (islandMap[i][j] - min) / (max-min);
            //cout << islandValue;
            float mapValue = (heightMap.GetValue(i,j) + 1) / (1+1);
            float newValue = (-1 + (2/1)*(islandValue*mapValue));
            heightMap.SetValue(i,j, newValue);

   utils::RendererImage renderer;
   utils::Image image;
   renderer.SetSourceNoiseMap (heightMap);
   renderer.SetDestImage (image);
   renderer.ClearGradient ();
   renderer.AddGradientPoint (-1.0000, utils::Color (  0,   0, 255, 255)); // shallow
   renderer.AddGradientPoint (-0.9701, utils::Color (  0,   0, 255, 255)); // shallow
   renderer.AddGradientPoint (-0.9700, utils::Color (  0, 128, 255, 255)); // shore
   renderer.AddGradientPoint (-0.9690, utils::Color (  0, 128, 255, 255)); // shore
   renderer.AddGradientPoint (-0.9689, utils::Color (240, 240,  64, 255)); // sand
   renderer.AddGradientPoint (-0.9601, utils::Color (240, 240,  64, 255)); // sand
   renderer.AddGradientPoint (-0.9600, utils::Color ( 32, 160,   0, 255)); // grass
   renderer.AddGradientPoint (-0.4991, utils::Color ( 32, 160,   0, 255)); // grass
   renderer.AddGradientPoint (-0.4990, utils::Color ( 0, 0,   0, 255)); // pines
   renderer.AddGradientPoint (-0.4987, utils::Color ( 0, 0,   0, 255)); // pines
   renderer.AddGradientPoint (-0.3986, utils::Color (96, 63,   0, 255)); // dirt
   renderer.AddGradientPoint ( 0.0000, utils::Color (96, 63,   0, 255)); // dirt
   renderer.AddGradientPoint ( 0.0001, utils::Color (128, 128, 128, 255)); // rock
   renderer.AddGradientPoint ( 1.0000, utils::Color (128, 128, 128, 255)); // rock
   renderer.EnableLight ();
   renderer.SetLightContrast (3.0);
   renderer.SetLightBrightness (2.0);
   renderer.Render ();

   utils::WriterBMP writer;
   writer.SetSourceImage (image);
   writer.SetDestFilename ("tutorial.bmp");
   writer.WriteDestFile ();

   return 0;


Thankyou for your help in advance!! :D


I need Segfault Help

23 December 2012 - 11:57 PM

Alright guys,


I am soo close to getting done with the Tile Rendering portion of my game, but I have run into a problem that seems unsolvable. I am running this code: 

sf::View view = App->getView();

   /* Culling code */
   int startX = (view.getCenter().x - view.getSize().x)/TILE_WIDTH;
   int endX = (view.getCenter().x + view.getSize().x)/TILE_WIDTH;
   int startY = (view.getCenter().y - view.getSize().y)/TILE_HEIGHT;
   int endY = (view.getCenter().y + view.getSize().y)/TILE_HEIGHT;

   if(startX > MAP_WIDTH)
      startX = MAP_WIDTH;
   if(startX < 0)
      startX = 0;

   if(startY > MAP_HEIGHT)
      startY = MAP_HEIGHT;
   if(startY < 0)
      startY = 0;

   if(endY > MAP_HEIGHT)
      endY = MAP_HEIGHT;
   if(endY < 0)
      endY = 0;

   if(endX > MAP_WIDTH)
      endX = MAP_WIDTH;
   if(endX < 0)
      endX = 0;

   for(int y = startY; y < endY; y++)
      for(int x = startX; x < endX; x++)
         m_Sprites[GetTile(x,y)].setPosition(x* TILE_WIDTH,y* TILE_HEIGHT);




I am getting a segfault when I try to draw the sprites. I also ran valgrind and found there was an invalid write of 4 bytes when I set the position of the sprite. I also found memory is leaking somewhere when I run it but I can't find where :/. I can post my whole .cpp file if need. Anyone have any ideas why I am getting a segfault in this portion of the program? If not, could any of you wonderful people please help me debug it?


Thankyou very much!!