Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Aug 2001
Offline Last Active Today, 06:05 AM

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

Posted by Glass_Knife on 18 July 2016 - 12:44 PM

unsigned int x, y;
for( y == bmp->height-1; y >= 0; y-- ){

This one got me 16 years ago, I believe this one was my very first head banging frustration session we coders have come to embrace as an significant part of our life. (I was quite new to coding at the time.)



These bugs are the worst.  Just yesterday I wrote:

// squirrel script

local x = 42

if( x = position || falling ) {
   // do something

I just look right over the bug and usually don't find it until I start adding logging statements that don't make sense

#5299660 What Language Is Best For Game Programming?

Posted by Glass_Knife on 07 July 2016 - 12:31 PM

So I've been thinking about game development, and have come to the conclusion that thats what I want to do with my life. Then, I decided that I should create one lol, and I looked at what I was going to be taking on, money, etc.


1. Please don't decide what to do with your life before you have tried it.  Never a good idea.

2. ApochPiQ's response is actually correct, so spend a little more time thinking about what it says.

3. You don't want to use different languages for different operating systems.


I get the sense that you do not have much programming experience?  How much programming have you done?


Making a game by yourself involves programming, game design, sound, music, art, writing, and a whole bunch of other things, so give it a try, but don't expect to make anything great the first time.  I do not know of ANY developer who's first game was any good.

#5299164 UI Design Layout

Posted by Glass_Knife on 05 July 2016 - 08:21 AM


#5298234 Why didn't somebody tell me?

Posted by Glass_Knife on 27 June 2016 - 08:02 AM

The reason I don't use std in games is because I just allocate all the memory up front and use that.  I don't want to overload new/delete or have allocations happening all over the place.  I'd rather write my own collections and know that if the game starts up, it will never have any memory problems.

#5297577 I need some help...

Posted by Glass_Knife on 22 June 2016 - 08:02 AM

Calling it a programming language is a misnomer.  It's not like learning a language.  If you learn German, but then everyone starts using Chinese for everything, then you would feel like you wasted your time, and you might think "Ah man, I should have learned Chinese."  But that's not what learning a programming language is like.  The langue is just a syntax.  A way to tell the computer what, where, when, and how to do something.  Someone who knows how to program can pick up a new language in a few days (or a few weeks, depending on how new/complicated it is).


Different languages exists to solve different problems.  But you have to start somewhere.  You can't just pick any language and learn it because you do not understand the core of programming: what, where, when, and how.  You learn that from any language.  Switching to new languages all the time without learning the foundation will keep you from making any progress.  In the past, I have used: C. C++, Java, python, Scheme, Go, Javascript, C#, and probably some others I don't remember.



Do not worry about learning the "right" language.  There is no right language, only the right langue for right now.  It changes all the time.  Python is a good choice because you can do Object Oriented, procedural, and functional.  Just stick with whatever you choose for at least a year.

#5297347 OpenGL like a PRO

Posted by Glass_Knife on 20 June 2016 - 12:57 PM

Why is the text so big???


There is a post for this: http://www.gamedev.net/topic/667482-modern-opengl-tutorials/

#5296700 Why didn't somebody tell me?

Posted by Glass_Knife on 15 June 2016 - 12:37 PM


Is this some GNU extension or actually part of the standard? o_O


EDIT: it's in C99, but not C++... https://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Designated-Inits.html


I have seen this in code exactly "one" time and I have no idea where it was, but I had no idea what was going on.  Since then I've written some "stb" style libraries with ANSI C, and I was amazed at how many things C++ does that I just assumed was also in C but isn't.  Also, there are C only things like this that I like.

#5296333 When you were starting out...

Posted by Glass_Knife on 13 June 2016 - 08:34 AM

I once took a class on doing taxes from the IRS.  His rule was: "If you haven't looked it up in the last five minutes, just look it up again."

A measure of a programmer is not being able to write a complete program on a white board from memory.  There may have been some changes to the API since you last used it.  Or something you use all the time changed awhile ago, and now there is an easier way to do it or a better code example that has extra stuff in it you've left out.


When I start coding, I always bring up the documentation to whatever I'm using before I start using it.  I've got MSDN, OpenGL, SDL, and a whole bunch of other stuff bookmarked waiting to be used.  The more you learn to read the documentation, the better you get at deciphering what it is trying to say.  Also, don't be afraid to download and link the source code for a library.  You can always read the source code, and you know it's up to date.

#5295968 Why didn't somebody tell me?

Posted by Glass_Knife on 10 June 2016 - 08:58 AM


Something I've known for a long time and thought everyone knew:


When using Chrome, you can press Ctrl-Shift-T to reopen tabs you've just closed.

I wrote this on the previous page! Post #122



I tried searching for "Chrome ctrl t" and nothing came up.  I guess the search isn't always great.

#5295863 Why didn't somebody tell me?

Posted by Glass_Knife on 09 June 2016 - 03:42 PM

Something I've known for a long time and thought everyone knew:


When using Chrome, you can press Ctrl-Shift-T to reopen tabs you've just closed.

#5293971 how to chose open_gl libary?

Posted by Glass_Knife on 28 May 2016 - 03:45 PM

Throw a coin.


EDIT: Omg I downvoted GlassKnife by mistake, sorry!  :unsure:


I am sadness

#5293652 how to chose open_gl libary?

Posted by Glass_Knife on 26 May 2016 - 01:46 PM

My latest OpenGL project, where I did all the graphics from scratch, used:


https://www.libsdl.org/ - SDL for window and input

https://github.com/nothings/stb - stb_image to save png files

http://glm.g-truc.net/0.9.7/index.html - glm library for math

http://glew.sourceforge.net/ - glew for loading the OpenGL version


I've had no problems with Windows, Linux, or Mac so far.  These things work well, but get out of your way and let you code.


As you learn more, you can replace these libraries with your own code if you really want to understand everything, but it's just too hard to start from scratch when you've never done this before.

#5293626 Can I write a browser game only using Java?

Posted by Glass_Knife on 26 May 2016 - 11:49 AM


Yes you can, using the built in Java Applet


 Please note that a lot of folks do not have Java enabled in their web browser.


I strongly advise against this. Java Applets are a huge security hole, not to mention the negative reputation they have. Much better just to go with LibGDX. Code everything in Java and deploy to HTML5/JS, Android, iOS, PC, Mac, Linux and who knows what else.


^^^ This


I wrote the book on Java game programming, and even I say don't try this.  Your time is better spent literally doing anything else.

#5293622 Are Third Party Game Engines the Future

Posted by Glass_Knife on 26 May 2016 - 11:03 AM

If the resource pipeline isn't in place when work starts, lots of stuff will have to redone to a format that works.  This can take a surprising amount of time.

#5293610 Are Third Party Game Engines the Future

Posted by Glass_Knife on 26 May 2016 - 09:58 AM

Also, remember that if you're one or two people, you can make your own tech.  But you can't just tell 50 people to go get to work while you make the engine.  What are the artists, composers, and game designers going to use?  They don't want to redo everything once the engine is done.