Building a football game (Need advice)

Blue_Coyote

Junior Member
Jan 21, 2018
3
0
1
What's up everyone,

I'm working on building a simple football match simulator, using JCreator. I'm a beginner in programming, so sorry if I use the wrong terminology. I know how to use the most basic concepts i.e. conditionals, iterations, sequential operations, arrays and creating objects, give them attributes and then use them in the main class.

I can build a simple match engine based on what I know, and print it out in text on a console window. My final goal is that the game can be played in a GUI window where the user first picks his players, customizes their looks/stats etc. then as the match engine recites events at certain minutes, a small animation is displayed of that event (ex: a tackle, a goal, a dribble). It's gonna look something like this:

gfs_17576_1_4.jpg


I had 2 questions: 1- Should I start by building the match engine while learning about GUI, then after it's finished I start implementing the graphics. Or should I learn GUI first, in case it might radically change the way I have to write the engine? (I should point out that the engine only simulates highlights of the match, not the full 90 minutes)
2- There are many resources out there. Any recommendations for a beginner learning GUI on JCreator?

Thanks
 

Cogman

Lifer
Sep 19, 2000
10,286
147
106
  • Don't use JCreator. I'm familiar with a lot of Java dev environments and until this post I had never heard of JCreator. That is a bad sign. Eclipse, Netbeans, Intellij. Those are the 3 ide's you should be looking at for Java. (arguments can be made for emacs/vim/nano/VS Code, but generally the dev experience with the 3 I listed will be superior)
  • You can get REALLY bogged down with UI and java. Are you doing a lot of animation? If not, then the simplest thing is probably going to be just using a canvas in swing and painting to it. (easy) Looking for something with a little more meat? Then I would suggest looking into gdx. (medium) Want more power? Then you are going to probably need to leave java and look at C/C++ and OpenGL bindings. (hard)
  • Your UI shouldn't depend too heavily on your game code. Ideally, you can run your game completely without having any UI attached to it at all. Instead, you should be writing views and adapters for your game logic to pump it out to the display logic.
  • This is probably too advanced for a simple game, ECS's are really popular for game development. You might want to read up on them to help inform you on HOW to structure a game ( https://en.wikipedia.org/wiki/Entity–component–system )
  • Finally, if you are willing to experiment with languages, I would suggest also considering and looking into Unity. AFAIK, it is pretty simple to get up and running while simultaneously being extremely powerful.
Good luck!
 
  • Like
Reactions: Blue_Coyote

Blue_Coyote

Junior Member
Jan 21, 2018
3
0
1
Thanks for the advice. I learned JCreator in university for a couple of years. I'm still hesitating to choose between Netbeans and Eclipse, mind you. I've downloaded Netbeans but the installer exe won't work cause it can't find my jdk.

The animations are all there in that game's screenshot I posted and I plan to rip them off it (ECS is too advanced for my skills and aim). It'll be like playing a short video at intervals of the match just to give a visual of the event. Example of animations:

(It looks silly, but it's my dream)


I plan to start simple (i.e. the teams' jerseys all look either red or blue, all the players look the same; the focus is that the right animation plays for its event). And if that works, then I plan to take it a step further by colorizing the teams' shirts based on the input. And the final stage -if I'm being optimistic- is to customize the players' stats (easy) and their looks (i.e. hairstyle and hair color)

That's the goal (no pun intended).
Appreciate the help, keep up the support.

Main idea of the engine (NOT an algorithm)
  • Add and compare a few values of each team's players
  • Decide which team will be getting more shots
  • Divide the 90 minutes (+ extra time) over the total number of shots to get the interval between each event and the next
  • Display a "shot on goal" event in each interval and based on GK's stat, decide whether if it's a goal or blocked
  • End match, show statistcs, ask to replay
 
Last edited:

purbeast0

No Lifer
Sep 13, 2001
53,659
6,536
126
I'm just curious - why does this have to be in Java?

As mentioned above, if I were starting a game from scratch, I'd use Unity. I've created a game in Unity as well as Cocos2D. Cocos2D was for iOS though whereas Unity can be deployed to multiple platforms.

However Unity is written in C# or Javascript (unless things changed since I used it 3 years ago). I'd recommend doing it in C# though. I started in Javascript and ended up porting everything to C# and that was the first time I ever used C#. I did so because of 3rd party libraries I started using and they were mainly written in C#, and trying to get dependencies working with JS was a hassle due to order.

If you know the concepts of Java then C# won't be very hard to play with and get up and running in Unity.

I do think though that this is going to be a lot more involved and difficult than you think it's going to be.
 

Blue_Coyote

Junior Member
Jan 21, 2018
3
0
1
I'm just curious - why does this have to be in Java?
It doesn't. I appreciate the advice but I'll draw the line there since the game won't be built from scratch. It's text-based with a couple of animations, so using Unity for it is overdoing it imho.

The engine I've written before several years back, so it's no problem rewriting it. The animations barely qualify to be called that since they're basically pre-made videos whose colors you can customize, I'm keeping it as simple as possible. After I finish the engine, I'll be taking baby steps to implement the GUI. That is, as soon as I figure out why Netbeans' installer can't find my jdk.