# Stock Ticker: Insider Knowledge

* Programmer: Eric Pietrocupo
* Artist:     Eric Pietrocupo

* Software License: [GNU General Public License v3 (GPL-3.0)](https://www.gnu.org/licenses/gpl-3.0.txt)
* Asset License: 
  - [CC-BY 4.0  Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)
  - [Pixabay Content License](https://pixabay.com/service/license-summary/)

Artificial intelligence was used during the research and development of this game, including research, debugging, design, and partial code generation. Insider card descriptions were generated with AI, and the game rules and the readme file were corrected with AI assistance. For more details, refer to the chat logs when they become available.

## Introduction

This is a digital implementation of the classic Stock Ticker board game (1937), with support for several rule variants, local multiplayer, and AI agents. No artwork and rule text is included from the original game.

The objective is to provide a free game so people can test and experiment with my Glymmer library. It also serves as an example project that developers can use to create their own games.

Most game rules are implemented using SQL scripts, and save games are SQLite databases. This makes the game moddable and hackable.

## Downloading the software

The game files can be downloaded from multiple platforms, including my website. Windows and Linux versions should be available.

* Personal Website:  [Artifact Depot] (http://lariennalibrary.com/ArtifactDepot/stockticker/)
* Gaming platform
  - [Itch.io] (https://lariennalibrary.itch.io/stock-ticker-insider-knowledge)
  - [Game Jolt] (https://gamejolt.com/games/stock-ticker-insider-knowledge/1067746)

Unzip the files into a folder of your choice. Then double-click the `stockticker` or `stockticker.exe` binary file to run the game.

## Building the software

The source code can be downloaded from git repository located here: 

* [Gitlab] (https://gitlab.com/larienna/stockticker)

You can build the software yourself if you want to modify the code or test the build process. At the moment, the CMake build system is used to compile and cross-compile the software.

Building software can unfortunately be complicated, so I hope it works smoothly for you. The process below may not be foolproof. Use the Yoda principle: "Patience you must have".

### Dependencies

The following libraries are required:

* Raylib: Video game library
* SQLite: Database library for query dialogs 
* Glymmer: My graphical user interface library

No worries — I have scripts to download and build these dependencies. You need the following software installed to build the project:

* C compiler (`gcc`, `mingw`, etc.)
* CMake: Build system
* Ninja: Build system

These are the minimum packages required:

```sh
sudo apt-get update && sudo apt-get install -y \
    build-essential \
    pkg-config \
    cmake \
    curl \
    wget \
    ninja-build
```

Depending on your system, you may also need some graphical packages. If compilation fails, try installing these:

```
libx11-dev libxext-dev libxfixes-dev libxrender-dev libxi-dev \
libxcursor-dev mesa-utils libglu1-mesa-dev libxrandr-dev \
libxinerama-dev
```

I have not tested compilation under Windows, and I did not have time to provide batch files. The easiest option may be to use a Linux command-line environment such as Cygwin or WSL and follow the cross-compilation procedure.

You will need the MinGW-w64 (64-bit) cross-compiler. Here is the install command:

```
sudo apt-get update && sudo apt-get install -y \
    build-essential \
    pkg-config \
    mingw-w64 \
    g++-mingw-w64-x86-64-posix \
    mingw-w64-tools \
    pkg-config-mingw-w64-x86-64 \
    mingw-w64-sqlite3 \
    cmake \
    ninja-build
```

To download and build the dependencies, run the following script with the platform name, either linux or windows.

Example for Linux:

```
sh/get_dependencies.sh linux
```

This may take a long time, especially for Raylib. If this step works, the rest is likely to work as well.

The libraries and include files will be installed into the project folder:

```
deps/linux
deps/windows
```

### Construction

Once the dependencies are installed, you can build the software using the following script with the platform name:

```
sh/build.sh linux
```

### Installation

To install the software on Linux, you will likely need administrator privileges using sudo. This is usually not necessary on Windows

```
sudo cmake --install build-linux
```
OR
```
sudo cmake --install build-window
```

### Downloading the assets

The game requires a series of images and sounds located in the assets/ folder.

Binary distributions already include the assets, but if you build from source, you need to download them using this platform-independent script:

```
sh/download_assets.sh
```

The game should now be ready to run.

If the libraries cannot be found, the .so and .dll files are located in:

```
deps/linux/lib
deps/windows/bin
```

Copy these files to the root folder of the project beside the Stock Ticker executable.



### Running the game

You can double-click the executable or run it from the command line.

```
./stockticker
```

```
stockticker.exe
```


## Road map

I copied the most important items currently in the to-do list for the next milestone. The project is designed to evolve alongside the Glymmer library.

* Upgrade the user interface as Glymmer gains new dialogs, especially for new game configuration and menu systems.
* Add multilingual support for French and English.
* Create an AI game simulator for testing and ranking personalities.
* Improve AI behavior so it considers cards in hand and rule variants.
* Extend configuration file options, such as toggling fullscreen and windowed mode.
* Animate the game board (for example, sliding disks instead of teleporting them).
* Compose music for the game.
* Add special icons for dividends, crashes, and splits beside stock names.
* Add name input for human players.


