danbuis / ArmadaAIEngineNew

Revisit of an old project to create an AI for Star Wars Armada
1 stars 0 forks source link

Game loop v2 #23

Closed danbuis closed 3 years ago

danbuis commented 3 years ago

Happy New Year.

Got the backbone in place for the game. Basically its all the boring boilerplace code in place to get things going.

All it does right now is draw a 3x3 map to the screen.

It does however have a TON of code drawing from my BBDGameLibrary codebase, so feel free to ask any questions you might have before merging.

To ask about a specific chunk of code you can go over to the "files changed" tab and then click and drag the approriate line numbers to highlight. This will open up a comment box attached to those lines and make it super easy for me to see what you are asking about.

Before merging though, I want you to verify that you can import this into intelliJ and get it to run correctly without any fuss. IntelliJ is my current Interactive Development Environment (IDE) of choice for java.

Sobonis01 commented 3 years ago

Looks good

danbuis commented 3 years ago

I see it in lines 30 to 33 of the file

danbuis commented 3 years ago

Don't forget you can comment directly on the code. You can go to the Files changed tab up there and highlight the code to attach comments directly to the lines in question. That will also give me the ability to comment directly o that thread.

So this file is just to warm up the BBD Game library engine? Assuming you are talking about the ArmadaAIMain class, yes. The BBDGamesLibrary.Engine class is the entry point into things to handle rendering, handling input, setting up update loops and tieing them all together. We can make classes that fit into its expectations and it will handle a lot of things behind the scenes.

This file will be to hold the game itself, like the AI? Assuming you are talking about ArmadaGame, then yes, with an asterisk. That class will likely be the bucket that holds everything and has a way to access all objects on both sides. The asterisk is because we are so early in the process that everything is subject to change.

Can we use the Vassal interface for the non AI side? We can do anything we want. We aren't constrained by vassal at all. I figure we'll need some sort of submit/final answer/set/whatever thing. The "Set" in vassal has its roots in circa 2014 in x-wing vassal. Don't feel tied to anything at all in vassal.

danbuis commented 3 years ago

@Sobonis01 also please make sure that when you open this branch in your IDE you can get it to run correctly. This will prove to me that I set things up right and got the right dependancies etc in there.

I'd super like for this one to be merged in the next 7ish days so that I can get things upgraded to the next version of BBDGamesLibrary before we start getting more things that depend on what will soon be outdated code.

danbuis commented 3 years ago

@Sobonis01 regarding the DefenseTokens on the squad text file...

No. Line 82 is grabbing the correct key and then setting a variable equal to the value.

We don't need to have a perfect match between text file and constructor because Java doesn't really work that way. We have to tell it where things need to go. Line 84 sets the class variable for the SquadronFactory, which is then passed into the constructor later.

Java doesn't have "keyword" constructors, it has positional constructors. Ie we don't type new Squadron(hull=4, speed=5) Java assumes as long as the types are the right quantity and order than this must be the function we want to use.