Coder Social home page Coder Social logo

settlersofcatan's Introduction

Settlers of Catan Build Status

Settlers of Catan Implementation in Java using LibGDX

Building

Linux and macOS

To build the game, navigate to the project directory and run the following command:

./gradlew build

Running

Linux and macOS

To run the game, navigate to the project directory and run the command:

./gradlew run

If the game has not already been built, this command will also build the game.

Hosting a Game

Clicking "Start Game" will bring up the menu for hosting new games.

From this menu the name of the human player or one of the AI players can be set.

If "Play as AI" is selected then the difficulty level of the AI can be selected.

The number of opposing AI players can be set as well as the difficulty of the AI opponents.

Clicking start will create a new game with the selected settings.

Single Player against AI

To play a single player game against the AI, set the value of "Number of AI opponents" to 3.

You can then select the difficulty level of the three AI players.

AI Only Game

To play a game with only the AI simply select the "Play as AI" option and select a difficulty level for the AI.

Host a Game Against Network Players

To host a multiplayer game with multiple human players, set the value of "Number of AI opponents" below three.

The game will then wait for other players to connect until there are a total of four players connected.

Other players connecting to the server must connect using the ip address of the host machine.

Joining a Game

Clicking "Join remote game" will bring up the menu for joining another server.

From this menu the name of the human or AI player joining the server can be set.

If an AI player is selected, the difficulty level of the AI can be selected.

To connect to a server, replace the text reading "Host" with the ip of the target server.

Clicking start will cause the game to attempt to join a remote game with the selected settings.

settlersofcatan's People

Contributors

keananf avatar bg3232 avatar jneiln avatar cak8 avatar

Watchers

 avatar  avatar  avatar

settlersofcatan's Issues

3D shit

  • Grain
  • Sheep
  • Shrink island
  • Dirt colour
  • Ports
  • Robber
  • Terrain models high
  • Brighter forest
  • Hidden buildings
  • Fix model shapes

Trigger renders on state updates

On:

  • building being built
  • robber being moved
  • our resources being updated
  • our dev cards being updated (bought or used)

game.getScreen().render(1)

Potentially dodgy thread shit

The constructor of client.Client starts a new thread before the constructor of any subclass of client.Client is run.

	public Client()
	{
		setUpConnection();
		thread = new Thread(this);
		thread.start(); // here
	}

New game beautification

  • Make text boxes act like text boxes
  • Make header look like a header
  • Have sane (i.e., single player) defaults

Not moving on to game Screen

When hex-event merged with Master the game screen stopped loading. Sometimes it waits forever for client setup waiting for game information.

Null Pointer Exception on Client Shutdown

Getting a NPE when trying to shutdown server.

// in catan.SettlersOfCatan
public void dispose()
{
	client.shutDown(); // here
	skin.dispose();
}
java.lang.NullPointerException
	at connection.LocalServerConnection.getMessageFromServer(LocalServerConnection.java:34)
	at client.EventProcessor.processMessage(EventProcessor.java:262)
	at client.EventProcessor.run(EventProcessor.java:41)
	at java.lang.Thread.run(Thread.java:745)

Offline Mode

Add the ability for offline mode, by allowing a server to be run locally with a client. This then means a server could have 3 local AIs and a local player, allowing for play without an internet connection.
To do this, the type of connection between a server and client must be abstracted over. Likewise, the Client must be generalised to allow for remote or local connection with the server.

HUD elements

Essential

  • Other player stats + trade button
  • Victory points
  • Robber
  • Resource counts
  • End turn button
  • Dev card counts (+ play)
  • Buy dev card button
  • Message system

Beta

  • Recipe hints
  • Dice roll
  • Your colour indicator
  • Hex chits
  • Current turn indicator (colour)
  • Pause menu + settings
  • Port labels

Alpha

  • Bank trade
  • Port trade
  • Player trade
  • Chat

User input during gameplay

  1. event listeners on board elements
  2. write turn state
  3. notify worker
  4. render options menu when exists

(Don't forget about trade and development cards!)

Ask for # Ai when hosting multiplayer server

When wanting to host a multi-player server, there should be a box which pops up prompting the user to indicate a number of AIs (0, 1, or 2) for the server to run, with the implication that the remaining positions will be filled by online players. This will aid in testing and demo-ing immensely, as we would only have to spin up 1 remote client (in the case of 2 Ai players), instead of 3 (in the case of 0). In the code, I just need a way of retrieving a number the user entered from a UI element, which I then pass to an initialisation function for one of our LocalServers. Super easy. Perhaps a check-box option or something?

Build "random walking" AI

Build a simple AI that will:
-Determine all possible legal moves.
-Randomly assign a rank to each move.
-Pick the move with the highest value and play it.

Basic main menu

  • Background
  • Title
  • Button to host game
  • Button to join existing game
  • Button to quit game

Client logging

I am not aware of any point at which Gdx.app == null. Have you seen this happen?

	public void log(String tag, String msg)
	{
		if (Gdx.app == null)
		{
			System.out.println(tag + ": " + msg);
		}
		else
			Gdx.app.log(tag, msg);
	}

Move validation on Client - UI

@lmcmenemie and @bg3232 , please not the method Client.sendMoves(Turn) will need move validation. Simply just forgot to do it. I'll add it in tomorrow.

Likewise, what do you need from me for retrieving valid move possibilities? I have the master list of all possibilities stored in Turn objects. Do you want it in a different format? I swear one of you said something about wanting to retrieve valid possibilities based upon a given clicked object? Either way just let me know, and I'll get it to you tomorrow. You can continue working assuming whatever it is that you'll need will be there.

Basic board graphics

  • Tile assets made
  • Board drawn (code)
  • Tiles drawn on board
  • Camera/viewport configured

UI issues

  • Minimum width and height
  • Stretch background on large window
  • Decide on chromeless window

Client worker

  • Finding possible moves given a turn thingy
  • Taking a complete action, building a protobuf and sending it to server

Implement Bank limits

Implement the bank on both the client and server side.

  • The server will prevent allocations / trades if there are no more resources. It will also prevent the building of settlements, roads, and cities if there are no more.

  • The client will maintain the status of the bank so that it will know when certain limits have been reached. Can be used for move validation for both AI and the client

Indicating initial game preferences / game display questions

Hey @lmcmenemie and @bg3232 , these were just a few things I was thinking about, and that would be needed from your end:

  • When wanting to join a remote game, there should be a way for the player to indicate the host and port for the server its connecting to. As of now, there hasn't been any discussion of a server discovery protocol between the groups, so I think its safe to assume this is adequate.

  • When wanting to host a multi-player server, there should be a box which pops up prompting the user to indicate a number of AIs (0, 1, or 2) for the server to run, with the implication that the remaining positions will be filled by online players. This will aid in testing and demo-ing immensely, as we would only have to spin up 1 remote client (in the case of 2 Ai players), instead of 3 (in the case of 0). In the code, I just need a way of retrieving a number the user entered from a UI element, which I then pass to an initialisation function for one of our LocalServers. Super easy. Perhaps a check-box option or something?

  • Is there going to be a HUD of some type (indicating basic player info like colour, number of resources, cities, dev cards, settlements, etc.)? Given that its a board game, it could be cool to have each player's info displayed in a corner of the screen, perhaps? I can tell you how all this data is stored in the client and how you can access it in a thread safe manner.

  • Do we have art assets for settlements, cities, roads, or dev cards? If not, how long will these take to make for each colour?

  • Do Node and Edge objects accurately correspond to the gaps between the hexes? If not, do you know if the coordinate conversion you use for hexes would work for both of them too?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.