Jump to content

  • Log In with Google      Sign In   
  • Create Account

Glass_Knife

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

#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

http://rhope.retrodev.com/repos/blastem/file/4db1a2e5d8e6/render_sdl.c#l557

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.  




#5293218 Spaghetti code

Posted by Glass_Knife on 24 May 2016 - 09:15 AM

I'm pretty sure the best "spaghetti" environments are:

  1. Matlab
  2. Visual Basic
  3. Javascript
  4. Simulink
  5. Labview

Sadly, you're only 5th.   :cool:




#5292390 How should I organize Java Classes?

Posted by Glass_Knife on 18 May 2016 - 06:56 PM

The exact details are unique to every project. Naming things is a hard problem in computer science.

 

The two hardest problems in computer science:

1. Naming things

2. Cache invalidation

3. Off-by-one errors

 

But seriously, with Java, there is a crazy convention with many libraries to have a com.org.package.module.ClassName.  Don't worry about it.  Do what Frob says, and learn how to search for classes, objects, methods, and instances with your IDE of choice.  That makes finding things very easy, no matter where you put them.




#5291768 Learning from Other's Code

Posted by Glass_Knife on 15 May 2016 - 10:22 PM

If you're reading other people's code, you will see stuff done in a way you've never seen it before.  Maybe it's a new algorithm, or C++ trick, or just understand how they structure their header files and code, resources, and build scripts.

 

If you are just copying other's code, you aren't learning anything.






PARTNERS