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!


Glass_Knife

Member Since 08 Aug 2001
Offline Last Active Yesterday, 08:29 PM

#5231673 Moving beyond Arcade Style Games

Posted by Glass_Knife on 29 May 2015 - 09:29 AM

The key search term you're looking for is serialization.  https://www.google.com/#q=c%2B%2B+serialization+library

 

But it is never that easy.  Start simple, and build it up.  




#5231457 Where to begin developing?

Posted by Glass_Knife on 28 May 2015 - 06:27 AM


Do I need to write my own engine at some further point?

 

Read this: "Write games not engines"

http://www.geometrian.com/programming/tutorials/write-games-not-engines/index.php




#5231112 Where to begin developing?

Posted by Glass_Knife on 26 May 2015 - 01:23 PM

http://www.gamedev.net/page/resources/_/technical/game-programming/how-do-i-make-games-a-path-to-game-development-r892

 

When I was in college, one of the most important projects I ever did was a Tetris, in the vein of a project above.  It was completely self-directed (not for a class or anything), and took me a few weeks/months.  It was the kind of thing I could work on when I had some down-time - or needed to distract myself from schoolwork for a few hours, while still doing something productive.

 

It wasn't so much a coding challenge as it was a challenge to create, perfect, and integrate every part (every piece of artwork, music, high score list, demo mode, etc.).  The end result wasn't a 3D game or even a complicated sidescroller, but it had so much polish, that I'm as proud of it as anything I've ever done.

 

A completely finished, polished game like that - no matter how simplistic - will not only teach you more, it'll be more impressive to people who matter than any half-completed, unpolished 3D shooter or other, more complicated game.

 

Challenge yourself to at least take yourself to the "Pac-Man" stage of the above article (as a student, your studies should be your top priority, so I think a finshed, polished sidescroller might be too much).  Complete all the graphics.  Integrate music and sound effects.  Add a demo/attract mode.  A high score list.  An intro cinematic.  A credits scroll.

 

^^^ This.

 

Tetris is a really good game to start with, as the article explains.  It contains very simple art (squares), the real game is available to study, and a working version contains user input, collision detection, win/loose checks, score, increasing difficulty (speed increase), sound effects, background music, high score saved to a file, and a whole bunch of other things I can't even remember.

 

You will be amazed how much you can learn from a single clone like this.




#5230685 Need some help...

Posted by Glass_Knife on 24 May 2015 - 09:36 AM

Welcome.  

 

Start with the FAQ: http://www.gamedev.net/page/reference/faq.php/_/for-beginners-r1

 

Is there a specific language you need to use to make the 2D game?




#5230683 Signed-Distance Field Font

Posted by Glass_Knife on 24 May 2015 - 09:33 AM

Here's one that I'm going to explore when I have more time:

 

http://liu.diva-portal.org/smash/get/diva2:618269/FULLTEXT02.pdf




#5230445 Academic programmer wants to make a game

Posted by Glass_Knife on 22 May 2015 - 12:14 PM

I think SDL will low-level enough for you without you needing to do all the OS-specific stuff yourself.

 

http://www.libsdl.org/

 

Also, read this:  http://web.archive.org/web/20051104034215/http://www.lupinegames.com/articles/path_to_dev.html

 

It might be the needle you're looking for.




#5230432 glDrawArrays is called, but nothing is rendered

Posted by Glass_Knife on 22 May 2015 - 10:12 AM

 

I almost forgot: Listen to L. Spiro.  He knows what he's talking about.  ph34r.png




#5230431 glDrawArrays is called, but nothing is rendered

Posted by Glass_Knife on 22 May 2015 - 10:10 AM

Also, I recommend apitrace.  https://github.com/apitrace/apitrace

 

Debugging graphics is one of the hardest challenges game programmers face.  Having someone do it for you won't help you develop the skill you need when your problem is so strage that no one can do it for you.




#5230152 Signed-Distance Field Font

Posted by Glass_Knife on 20 May 2015 - 06:06 PM

You need to generate the glyph at a really large size, calculate the distance field and then scale down. In Valve's paper I think they do it at 4096x4096 pixels, or something like that. I was having exactly the same problem as you until I generated the glyph at a huge size, performed the distance field calculation at *that* size, and then scaled down. Then suddenly everything started rendering nicely. Note that the edge threshold value still needs to be adjusted depending on the size you render at.

 

^^^ This.  I rendered my fonts to a 4096x4096.  Make sure you don't use the freetype antialiasing.  You want the monochrome bitmap, with only two values.  I think my naive SDF algorithm took about 40 minutes to process the 4096x4096.  But it needs to be that size to get the fidelity around the edge.  If the source image is too small it doesn't work. 

 

I tried a source image of 796x796, and it was way different.




#5230080 Signed-Distance Field Font

Posted by Glass_Knife on 20 May 2015 - 12:19 PM


While doing so, I check to see if the current sample is > 0. If it isn't, it stays as 0. If > 0, I check all adjacent pixels to that sample. If all adjacent pixels are > 0, then the sample is INSIDE the glyph, and gets a value of 255, otherwise, it's an EDGE and gets a value of 127.

 

This doesn't sound right.  the edge should be 0.5, but not every pixel in the image is 1.0 (or 255).  The min and max distance to an outside pixel will be mapped to 0.5 - 1.0.  For example, if you have a text image of half black and half white, the alpha signed -distance values of a single row would look something like:

 

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

 

It shouldn't be 0.0 0.1 0.2 0.3 0.4 0.5 1.0 1.0 1.0 1.0 1.0  <- is this what you're doing for the "inside" pixels?




#5229376 Dot Product 101

Posted by Glass_Knife on 16 May 2015 - 05:55 PM

and why is this not a Gamedev article too?  It looks really nice, by the way.  




#5229220 When you realize how dumb a bug is...

Posted by Glass_Knife on 15 May 2015 - 03:51 PM

 


Do you see it?

 

I thought it would be that 'y * w * x' should be 'y * w * n', missed the shadowing. smile.png

 

 

That was just a fat finger from typing it in on a different computer.  But at least that bug I would have found.




#5229207 When you realize how dumb a bug is...

Posted by Glass_Knife on 15 May 2015 - 02:09 PM

 

I turned off -Wshadow because there were tons of warnings with Glew and glm.

I usually write a few wrapper headers in my project, that do things like this:

#pragma GCC diagnostic push 
#pragma GCC diagnostic ignored "-Wshadow"

#include "GL/glew.h"
#include "glm/glm.h"

#pragma GCC diagnostic pop

 

It amazes me how much there is to learn about software.  I'll be adding this soon.




#5229199 When you realize how dumb a bug is...

Posted by Glass_Knife on 15 May 2015 - 01:05 PM

I turned off -Wshadow because there were tons of warnings with Glew and glm.  Damn!!!




#5229190 When you realize how dumb a bug is...

Posted by Glass_Knife on 15 May 2015 - 12:21 PM

So I just spent two+ days fighting with a C/C++ bug.

// in some function
int w, h, d, n; // width, height, depth, count
w = 256;
h = 256;
d = 128;
n = 2;

... much code

double rmin; // radius minimum
double rmax; // radius maximum
vector v; // some vector
double tmax = screen_height;

for( int z = 0; z < d; ++z ) {
   for( int y = 0; y < h; ++y ) {
      for( int x = 0; x < w; ++x ) {
         double t = v.length();
         double n = t/tmax;
         double r = (1.0 - n) * rmin + n * rmax);
         int index = z * h * w * n;
         index += y * w * x;
         index += x * n;
         data[index] = r;
         data[index + 1] = r*2;
      }
   }
}

Do you see it?  Because I didn't for two days.  Why doesn't the compiler warn me that double n is shadowing int n???






PARTNERS