Maybe it is a bit exaggerated but supporting both desktop environments and embedded environments can be tricky. I would rather advise him to stick with computers before aiming Android.
morgancj, in my humble opinion, you should start with a smaller project first. If you don’t like Pong, choose something as simple as it but less challenging than the one you mention in your first post. Why not making an offline text based turn based card game first? Then, you can turn it into an offline graphical turn based card game and after that, you can turn it into an online graphical turn based card game. If you don’t mix up everything, using a networking framework later won’t require tons of changes.
Good luck with that, as you actually can not make any GUI in java without using a library. So embrace libraries.
Also, please don’t say you have researched quite a bit, it is quite a bit obvious you have not researched that thoroughly into the subjects at hand.
The card game doesn’t have to be that hard actually, in some ways its easier than pong, and it is multitudes easier than a multiplayer pong game as it is state based. avoid animation keep it really simple with GUI stuff. I would recommend libGDX for something this simple.
Look into using Sockets, TCP fits state based games better. Since it is state based you can create the game in a single player type mode first than move on to a multiplayer mode with networking without much re write, assuming you know how to write relatively clean, modular code.
For now, it will of course be, PC only. (probably not Windows, I work on mainly linux machines)
I said in my original post that I would start with a text based game, until I learn graphics, that only makes sense, right?
I can do the game, I’m only seeking advice for structure. For instance, "Keep blah in a separate class from bleh, but in the same class as bluh. That way when you add server/client … " any experienced positive advice is helpful!
The only real question is whether or not I should start with a singleplayer, since I don’t want to end with a single-player. I don’t want to code a competitive AI, but would it be in my best interest to program a simple AI that can follow the rules of the game?
I have researched. I’ve looked into socket programming and what not. Not too extensively, but some. I figured it would be best to get the basics of the game down first, then learn more about the graphics and the networking.
I know some libraries are required. I want to use as few as possible, because I am learning, and most of my assignments require us to write as much code ourselves without using libraries.
I just wanted experienced advice. I can do the game. Just wanted to save myself any potential headaches in the future.
I’m not dumb. I have a high GPA and am in the honors programming course. I will figure this out. Was simply looking for advice. Not alternatives.
Me neither. You’re not planning to write Quake or Civilization or anything! You sound like a can-do kind of person who knows that a simple card game cannot be that hard. It isn’t! Don’t listen to posters trying to make out there are a million things you need to know before you can get started.
Depending on what you’re most interested in I would either:
Start with the text-only card game where players take turns on the same screen (or you play against yourself of course), then extend it later for net connected players, and/or AI players which is a somewhat similar kind of extension, assuming you have a “Player” class which the game core interacts with. This way you get a playable game soonest.
Start with a simple client/server chat system to get the net code - find server, connect, join table etc. - working (remember to check a version of the code at this point into your repository as you can reuse it for other games later!) Then add the card game onto that as something the clients can do other than chat. The downside is network code is a bit fiddly for a beginner (although for a simple card game not nearly as difficult as for a realtime game, which is what some of the links posted above will concentrate on).
If it ever comes to a GUI, despite what people have said, the most rudimentary graphics available on whatever platform you write clients for will be able to show card pictures and buttons for “hit” or whatever just fine. The trade-off with learning to use a third-party layer like libGDX is it’ll support more client platforms with the same code. But if you’re a beginner you need to keep it simple - assuming you’re coding on a desktop machine, just use the simple built-in Swing graphics.
Avoiding libraries is only going to hinder you. It is not possible that you finish your project and find you did not learn enough. Having never created a game, you have an enormous amount to learn. Trying to do everything from scratch is going to slow you down considerably. It is a much better idea to get some (a lot) of general experience first before thinking about what happens at a low level. It’s the same reason people are suggesting to make a simpler, non-networked game first. You may not like this advice, but you asked for experienced advice and that is what you got.
My advice: use libgdx, specifically scene2d.ui for the UI and SpriteBatch for drawing. Don’t use scene2d for the game, only for the UI. Use KryoNet for networking. Organize your code using loose MVC, this will allow you to develop the game as text and later make it graphical, as well as allow you to easily serialize game state and generally keep your code sane.
Maybe what I wrote was confusing, sorry. What is tricky is the support of iOS for a beginner. I didn’t understand why you advised the original poster to target only Windows whereas targetting GNU Linux, OpenIndiana and Mac would require (almost?) no effort, especially if he just makes a fat JAR (even though it isn’t the “smartest” solution).
morgancj, you should at least separate the representation of the data from the data and implement a bot. This bot would probably force you to structure your code in a way that would allow you to replace the (silly?) bot by a real player.
I disagree a bit with Nate. Don’t try to do too much things but using middle and high level libraries from the very beginning is only one viable option, it’s not the single one. It depends on what you want to learn. For example, as I decided not to learn OpenAL, I just use Paul Lamb Sound Library with its JOAL plugin and I preferred learning JOGL before using lots of 3D Java engines. It depends on how you learn, maybe Nate’s suggestion would be more efficient in your case, only you can know that. There are some experienced developers here, some of them don’t go “deep”, some do, some of them started by using high level APIs first, some did the opposite.
Until someone bright sorts out the whole end-to-end thing with Java… it’s still back where it was in 2002 as far as games is concerned. Almost zero movement in 12 years.
Another vote for LibGDX. If your goal is to eventually be cross platform, LibGDX handles all of that for you. From one code base you can compile to Java SE for desktop (which covers Windows, Linux, and Mac), HTML5, Android, Blackberry, and iOS (but you need a Mac for that unfortunately and I believe you may even need to be an “iOS developer” but I’m not positive on that).
LibGDX was recommended to me when I ran into some animation problems with Java SE and it was the best move I ever made.
Advanced warning…the initial setup is kind of a nightmare, but it’s definitely worth it!
It all depends on what you value most: the result and a community of players, or the learning experience across the whole process. It is appealing to start by mining your own sand, but not if you actually expect to love the first few castles you build.
You won’t find a lot of formal teaching materials, but there are a bunch of open source frameworks you can either use or just study.
There is nothing wrong in the do it all yourself approach (I am doing it myself :)), but be prepared for a long project. Also be prepared for lots of diversions because you will be taken in a lot of directions and you will end up re factoring your code a lot as you learn more things. (A lot is an under statement)
What you ask sounds quite simple but to do what you want to do you will need to understand graphics, networking, controls,threading, sound, physics (maybe), game design, resource loading, etc and in each of these categories there are quite detailed sub categories. That is quite a lot to take in all at once.
If you are still keen on doing it this way,you might want to start with code that people have already done, ie using libraries (lot of good suggestions here already), and then slowly replace bits that these libraries do with your own code. The one thing you aren’t going to understand when you first start is what its going to look like at the end, people who wrote the libraries do so learn watching others.
Also it looks you are quite lite on Java experience (apologies if this is not the case) and this is also going to hinder you at the beginning because just knowing how to program in java won’t make you a good programmer, it takes a lot of learning from experience.
But don’t let all of this scare you too much, use it to your advantage and I am sure you will get to your goal eventually, good luck. Keep us posted on your progress!
Yeah, I was referring to the stuff that comes after the Gradle setup. Such as not being able to get graphics to load on all platforms unless you put your graphics into the “Android/assets folder” (due to some kind of LibGDX backwards compatibility thing with Android) and then point your entire project to that folder. It’s little things that you do get used to once you use LibGDX, but it takes some research to get working because it’s not really intuitive. My first time setup took a while just to be able to get the stock default program that displays the LibGDX image to run. And then I ran into more problems when I tried to get Android working…but that may have just been an Eclipse issue as I ended up uninstalling Eclipse and the Android SDK I had downloaded separately and used the Eclipse+Android bundle instead.
I haven’t tried Android, but in my experience the libGDX project setup (including gradle, note I have no experience there either) was a painless 30 second procedure from opening the gui to having the libGDX default program running.
I believe you can use any asset folder you want for the desktop version, but if you’re also building for Android then your entire project has to point to Android otherwise Android will not work. My purpose for using LibGDX was to develop for mobile devices, so that’s probably why I had a more difficult setup since I was fighting with Android right from the start. LOL
Ah, ok. But if you don’t know to use the Android/assets folder then it makes for some head scratching and research to figure out why things aren’t working when it seemed like they should be.
The other problems I had were specifically related to Android and after trying several things to get Android to work, installing the Eclipse+Android bundle was the key to making it work finally. Then I had to update several things (Android libraries, maybe? Can’t remember exactly, it’s been a few months since my initial setup) and configure the build path inside of Eclipse to select an Android version.
It just seemed to take quite a while before I was finally all up and running.