Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Glass_Knife

Member Since 08 Aug 2001
Offline Last Active Yesterday, 05:41 PM
-----

#5062887 row major vs column major and multiply direction

Posted by Glass_Knife on 18 May 2013 - 03:44 PM

http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-4-geometry/conventions-again-row-major-vs-column-major-vector/

 

The above article will explain it better than I can!

 

Enjoy.




#5061860 Looking for learning tools

Posted by Glass_Knife on 14 May 2013 - 02:35 PM

Eclipse will be fine.  As for tutorials, start with all the Java tutorials.  You will be way ahead...

 

http://docs.oracle.com/javase/tutorial/




#5060285 Another X vs. Y thread: Java + GWT vs. JavaScript

Posted by Glass_Knife on 08 May 2013 - 07:27 AM

I would like to point out that if you create the game with javascript, you can run it in the browser. If you go with something like libGDX then you are writing it in Java and converting it into javascript, so there are more layers to confuse you, but you can support many different platforms.

However, this doesn't address the problem of creating a fun game. I am of the belief that if your prototype game with crappy graphics and hacked UI is not fun, no amount of polish is going to help. So going with a framework like libGDX or GameMaker to prototype as easily as possible is a good idea. Once you have the game it is a lot easier to port it to different platforms. Until you know what you've got you might not even be sure which platforms should be supported.

Just my two cents.




#5059542 Java and graphics APIs

Posted by Glass_Knife on 05 May 2013 - 01:30 PM

If you want to do the input and sound yourself, check out

 

http://jogamp.org/jogl/www/ - OpenGL for graphics

http://jogamp.org/joal/www/ - OpenAL for Sound

https://java.net/projects/jinput - JInput for Input

 

This is what LWJGL is doing behind the scenes if you wanted to learn it all yourself.




#5059523 Java and graphics APIs

Posted by Glass_Knife on 05 May 2013 - 12:14 PM

Java 2D out of the box is a good API, but will not have the things you need for game programming.  It is lacking input and sound.  As for 3D, you can use JOGL with OpenGL, but I would suggest using a 3d party library.

 

http://www.slick2d.org/

http://www.lwjgl.org/

http://libgdx.badlogicgames.com/

 

Depending on your requirements, one of the above libraries should suit you just fine.




#5058073 Pure Java or LWJGL?

Posted by Glass_Knife on 30 April 2013 - 08:33 AM

LWJGL is a good choice.  The reason is not OpenGL, which is easy to use JOGL and just set stuff up yourself.  The reason is the JInput and OpenAL integration.  There is very poor support for keyboard and mouse and none for other controls with straight Java.  As for sound, the Java sound support is so terrible that you'll be switching.  Rather that learn Java2D, OpenGL, JInput, and OpenAL all by yourself, starting with a wrapper API is a good idea.

 

Having written straight Java2D games and tutorials about it, I can tell you that learning one of these wrappers is time well spent.

 

If you goal, however, is to learn how all these things work, and you are not trying to crank out a game, then by all means give them a shot by hand.




#5056978 Platforms in a 2D platform game

Posted by Glass_Knife on 26 April 2013 - 09:05 AM

http://www.gamedev.net/page/resources/_/technical/game-programming/the-guide-to-implementing-2d-platformers-r2936

 

There was an article just added about this...




#5054183 3d tutorials and learning resources

Posted by Glass_Knife on 17 April 2013 - 08:08 AM

http://www.scratchapixel.com/

 

Stumbled across this a few months ago.  While they are still porting their docs to the new format, there are lots of articles and code example for coding 3D graphics from scratch.




#5043403 Am I a bad programmer?

Posted by Glass_Knife on 15 March 2013 - 09:23 AM

http://scientificninja.com/blog/dont-write-tutorials - Here's a link to an article people have referenced again and again about not writing tutorials when you don't know what you are talking about.

 

What I really love about this is the update link added three years later, where the author has to update his explanation.  So the quick tutorial about why making tutorials is wrong... was wrong.

 

Great tutorial writers make mistakes.  That's how people learn.  The only failure would be giving up and not learning from your mistakes.
 




#5040823 Help me understanding the MVC model

Posted by Glass_Knife on 08 March 2013 - 08:23 AM

Without wanting to labour the point too much, these are both reasonable architectures to use, but they aren't what the original MVC was designed for.

 

Yes, I agree with this.  I think it is important to point out that patterns are a way to study complex systems.  Many programs have been written re-writing the same structure, so some really smart guys (the gang of four) cataloged and named them so there would be a common language when discussing them.  Now I can say I used a Factory Method, and other programmers will know what I mean (hopefully).

 

More important than how you make a MVC is why.  You can structure the code in many ways, you can remove one of the three MVC objects, and you can allow or prohibit the objects from knowing about each other, and each configuration probably has some different name.  But the reason you structure your code this way is so that it is easy to evolve the system with the minimum amount of change.

 

By having a data object that knows about the data, and observers that can listen for changes to the data, you allow new observer to the data to be added later without updating the data object.  This way your objects are loosely coupled.  This is great for a GUI that waits for user input.  Some data  objects may be observed by dozens of different views when the program gets really large.  

 

The view displays the data.  If you are doing a game, then there will be an input module polled or sampled every frame for the data.  But a GUI application doesn't work that way.  Each view is the object that receives the user input.  In this situation, the view needs a reference to the controller to pass on the user commands.  

 

The controller knows what to do when the user input is received.  Sometimes it will do things with the data, and sometimes it needs to affect the view, such as enabling or disabling controls.  So to just decree that the view doesn't know about the controller, or that the controller only operates on the data and not the view, isn't practical when you start trying to make a program that actually does stuff.

 

Think of these patterns like the "Pirate Code".  They are guidelines, not rules.  Use them as an example of structuring you code so that you code is loosely coupled enough to be extendable without adding too much complexity.




#5031910 How to run a Java jar file without a MS DOS batch file

Posted by Glass_Knife on 13 February 2013 - 11:48 AM

what exactly does "-cp" mean?

The -cp flag is short for -classpath, which tells the java command where to look for the class files. If you didn't put *.jar file in the classpath, then Java would not be able to find the code.

The source files do not have anything to do with the jar file working. A jar file is just a *.zip file renamed to *.jar. You could create the jar file as a zip file by hand, including the source code, and then change the extension to *.jar.

However, most people, for creating jar files like this, either do it from the command line or use http://ant.apache.org/

Something looks weird with your class files. They need to be in the package folders in the jar, and you shouldn't be using classes without at least one package. In the past, I have had trouble getting code without any packages to work like this. It seems like something is wrong, because I see your game is called Game, but I also see a Game folder in the jar screenshot.

One thing, is that the main class needs the fully qualified java name. For example, a typical manifest for my games looks like this:

Main-Class: tim.game.app.ReallyAwesomeGame

// ReallyAwesomeGame.java
package tim.game.app; // VERY IMPORTANT!!!

When compiled there with be a folder for each package level, and the Really AwesomeGame file must be in the package structure inside the jar file.

tim
- game
- app
ReallyAwesomeGame

If this stuff isn't exactly right, it won't work.


#5029489 Java Networking help to understand sockets

Posted by Glass_Knife on 06 February 2013 - 01:10 PM

the server has hold of the clients what? output stream or input stream? and what does the client have a hold of on the server? the servers output stream or input stream?

Don't get confused here. The Java Server Socket library is a wrapper for using TCP/IP networking communication. Any socket, whether a client or server socket, has both an input stream and an output stream. It reads data "in" from the input stream and writes data "out" to the output stream. But the server or client doesn't hold a stream from the other code. You can write a client that talks to a Google server and gets the home page. You have no idea what language or operating system Google is using, and that's the point. The TCP/IP protocol handles all that crap for you so you can just write code. And all the (really) low level code is wrapped up in the ServerSocket library.

If you write data to an output stream, then the server would need to read from the output stream if is held a reference to the same stream. But it doesn't work that way, because that would get really difficult. It is client output the input? This stuff's hard enough without something like that to worry about.

Start you server, and accept() a connection, which will block waiting for someone to connect.
Start your client, and try to connect to the server.
The server's accept() will return, and allow the client to connect.
Now the server reads some data. Since there is no data to read (because the client hasn't sent anything) it will block.

Then the client will be connected, and can send data. After sending data, the client will attempt to read() the response, which will block.
The Server will get the request, do something with it, and return a response. The server then tries to read some more data().

The client then reads the response. And so one. I suggest trying to get a simple client that connects to www.google.com and pulls some data before trying to write the server too. Once you know you've got the client working, if it is broke, it's the server.

Have Fun!


#5026157 Need help displaying name of window

Posted by Glass_Knife on 27 January 2013 - 12:59 PM


package falling; <- this is fine

// Note, convention is to use a Capital letter for class names
// Window, not window.  Not an error, just what everyone does 
public class window { <- start window class definition


   this.setTitle("Falling"); <- this code isn't in the right place.  Try a constructor or a method.

} <- end window class definition

// This code below the comment doesn't belong to the window class.  It doesn't belong to any class.
// Fix this :)
if(false)
{
   this.setExtendedState(this.MAXIMIZED_BOTH)  <- somthing missing here
 
}
else
{
   this.setSize (1024, 768) <- somthing missing here
   this.setLocationRelativeTo(null) <- somthing missing here
   this.setResizable(false) <- somthing missing here
}



#5025773 Sound Programming from Scratch

Posted by Glass_Knife on 26 January 2013 - 09:35 AM

I will be checking it out.  Thanks.  ph34r.png




#5025758 Sound Programming from Scratch

Posted by Glass_Knife on 26 January 2013 - 08:25 AM

Not sure if this question is better asked here or in the programming forum.  I've been playing with sound programming, but I find the APIs hide too much stuff.  When I learned 3D graphics, I started by learning from scratch.  I would like to know if anyone has any resources (books or online) that teach audio programming from scratch.  Much like writing a software renderer from scratch to learn about the algorithms.

 

I've googled and amazoned, but I don't really know enough about the subject to make a decision if the books I found are any good.  And man, I though software books were expensive.  Audio books are not cheap.  :)

 

Thanks,

 






PARTNERS