Advertisement Jump to content
  • Advertisement

Son of Cain

  • Content Count

  • Joined

  • Last visited

Community Reputation

480 Neutral

About Son of Cain

  • Rank
    Advanced Member
  1. I've been hitting these forums for a long time, and I guess I remember you - always messing with network stuff, aren't you? :D Sounds nice, for learning purposes. When you, lil' rookie reading this, get the grip of NIO with his code, then you'll be ready to either 1) improve over it, or 2) start using Apache MINA knowing what it actually does for you ;) Nice of you to share your code and efforts, much appreciated. Kudos!
  2. Son of Cain

    [java] XML and database resources

    What is the problem that you're trying to solve with JDBC and applets? Chances are there is a better way to do whatever you may be trying to do. Let us know and we can advise you better. As for the problem at hand, make sure the JDBC driver is in your applet's classpath. To extract data from XML, you need a good parser - such as JDOM. There are tons of these parsers available on the web, many claiming to do something better and faster than each other. I am very fond of higher levels of abstraction, the kind that JAXB can give you, but that wouldn't be my choice for an applet. Rodrigo
  3. Netbeans is a gret tool, very productive, and it indeed tries to do a lot of things for you. But as with any dangerous toy, you gotta know your ground when playing. I use it since it was no better than notepad, with crap performance, and most recently (since version 4.x), I dumped Eclipse for it, without regrets. My bet is the same as Glass_Knife - it is most likely a library problem. I suggest you write yourself a good ant build file (if you haven't already), and always use that to build jars, classpath' resources, etc.. Post some code, if you can. That can help us identify what might be going wrong.
  4. Cool game. I agree with Dancin Fool, it is a bit weird to walk around like that ;) To me, it wasn't slow at all, worked fine and nice. Using JDK 6, U3, on a fairly poor machine at work. - I was able to continue playing after the "Game Over" message; - No collision detection with other "players"; - The players can walk off the map; If those are known issues for the prototype, then forgive me for pointing them =D Son Of Cain
  5. I was thinking about AA. I don't know what else they can do, from the top of my head. Check the docs, there's information there about the capabilities you can enable.
  6. Can't RenderingHints help you here? Try to set them using the Graphics2D reference you have. I'm sure you can at least draw better lines and pixels with them, not sure about buffered images though.
  7. Son of Cain

    [java] Java Security

    There are several structs and classes declared in the JNI API, which you can use to "convert" references on the C/C++ side to references on the Java side. Wheter the Java side receives a copy of the reference or the actual reference of the value in memory, is beyond me right now. But if you want to share state between the caller code and the native code, that's how you do it. Parameters on the java side (such as Object instances) are received as a jobject* parameter in your native method. Plus, you must use the jnienv* reference that every JNI method has in order to actually "commit" such exchange. More details in the Sun's official JNI tutorial. Rodrigo
  8. My guess: setRGB() is faster, because it deals with an image that is hardware accelerated. Buffer strategy is used mainly for double buffering.
  9. Son of Cain

    [java] Java Security

    Did you write the header file yourself, or generated it with the JNI tool that comes with the SDK? It's been a while since I last toyed with JNI, but I believe that header files for the functions accessed from java side must be generated using the jni tool. Rodrigo
  10. Son of Cain

    [java] java morpg

    Project DarkStar, indeed. But it is well beyond the needs our friend here might have for his project. Unless he would want to use it to learn more about DarkStar-related APIs. Otherwise, I wouldn't advise using that. And "revolutionize" is kind of a strong word... it is a great project indeed, but it is not revolutionary. It is, at the most, a great asset for any company that develops serious games to evaluate and use. And, it opens a nice door for any seasoned Java developer into the game industry, should it have any success ;)
  11. Son of Cain

    [java] Java Security

    Print the stack trace, dude. As I see it, you're having trouble loading native libraries. I assumed you were past that in your previous post, since you mentioned a security exception. If that is indeed a native library problem, put the .dll and the rxtx .jar file where your code can see. Don't forget to set -Djava.library.path property, pointing to the directory where your native library is. This is a requirement when using JNI. Rodrigo
  12. Must you use "pure" Java? OpenGL seems more suitable to the task at hand. Either write a simple JNI function to update a JPanel, or use a OGL binding, such as JOGL or LWJGL. Although, as of JDK 6, usage of hardware accelerated images isn't the pain it used to be ;) Rodrigo
  13. Son of Cain

    [java] Java Security

    Java's security sandbox is a bit complex when you first look at it ;) First off, the environment where your application executes is important. Local applications use the standard policy file settings, located at the JRE, which has a single line giving the user ALL PERMISSION upon its resources. If you received such exception when executing local code, you may have tried to access a resource that is denied to the JVM itself. Please provide some more code or information about your problem, so that we might help you out. As the above paragraph implies, when you're outside your own (server's) environment, you must deal with .policy files and signed jars (applets). Signing a jar means adding a public key to it, that matches a private key in a keystore. Your applet/jar is then deployed with a certificate (truststore). The only cost involved is when you use certs from entities like VeriSign, etc. You can create a keystore for your own server, and generate truststore for authorized code to use against it. Using an entity's cert means your server underwent a complex process of security auditing (i.e, you paid their bill :p) ROdrigo
  14. Quote:Original post by ddyer (Strictly as a bystander, I have no intention of entering) The thing that grates about this contest is that it encourages really bad programming, just to keep the size of the code down. -- the saving grace being that in only 4K, there's not enough room to be all that bad. Hey... you guys missing the point of it. Contests shouldn't have the responsibility of 'teaching the kids about good practices in programming'. Contests are for fun! Well, at least this one is. J4K does not aim to stablish any standard of any sort, or spread the evil of ultra-compression in sacrifice of good programming practices. It never had any purpose other than fun. And, since squeezing a good game in 4K isn't the type of thing a junior programmer can do, so people that enter the contest are already beyond the temptation of sacrificing good practices of programming for some performance in *real* projects (i.e, those they do not throw at contests =) Rodrigo PS: I know I've just said in the post above that anyone could participate, despite their level of expertise. I was just advertising their good wiki content, that might get you started if you're having trouble figuring out how to squeeze a game in 4k.
  15. Son of Cain

    [java] Changing the applet splash screen

    Sign the applet, and use a .policy file (along with doPrivileged() calls, if I'm not mistaken).
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!