1.4.3 • Published 7 months ago

homegames-core v1.4.3

Weekly downloads
149
License
ISC
Repository
github
Last release
7 months ago

Homegames Core

Homegames core contains Homegames server stuff. The Homegames server is responsible for providing game sessions clients can connect to.

Setup

Note: You probably don't want to run homegames-core directly if you're just trying to play games. The best way to do that is via the executables available at homegames.io

Requirements:

  • Node.js >= 18
npm install
node index.js

By default, this will run a Homegames game server on port 7001. You can override this in your config.

Games

Built-in games are located in src/games. Downloaded community games are in different places depending on your operating system.

Windows: C:\Users\<username>\AppData\homegames\hg-games

MacOS: ${HOME}/Library/Application Support/homegames/hg-games

Linux: /path/to/home/.homegames/hg-games

Config

Homegames will look for a config.json file in the root project directory. If present, it will override defaults. Here's an example config.json:

{
    "LINK_ENABLED": true,
    "HOMENAMES_PORT": 7400,
    "HOME_PORT": 9801,
    "LOG_LEVEL": "INFO",
    "GAME_SERVER_PORT_RANGE_MIN": 8300,
    "GAME_SERVER_PORT_RANGE_MAX": 8400,
    "HTTPS_ENABLED": false,
    "BEZEL_SIZE_X": 9,
    "BEZEL_SIZE_Y": 9,
    "DOWNLOADED_GAME_DIRECTORY": "hg-games",
    "LOG_PATH": "homegames_log.txt",
    "PUBLIC_GAMES": false,
    "ERROR_REPORTING": true,
    "ERROR_REPORTING_ENDPOINT": "https://api.homegames.io/bugs",
    "START_PATH": "/Users/josephgarcia/weed-smoke-willie/index.js",
    "TESTS_ENABLED": true,
    "ERROR_REPORTING_ENDPOINT": "https://api.homegames.io/bugs"
}

Dashboard

By default, the Homegames core server will serve the Homegames dashboard on HOME_PORT. If you're developing a game locally and want to start it directly instead of navigating through the dashboard, set START_PATH in your config.json.

The dashboard is rendered like any game but has special knowledge about game sessions and players.

Game Session

A game session (src/GameSession.js) will run a Game on a given port. It handles all of the networking and input stuff as well as Homegames-specific logic like rendering the frame around a game and letting users update their names.

The game session is responsible for:

  • Instantiating a HomegamesRoot which is responsible for stuff like the Homegames frame
    • src/homegames_root
  • Creating a Squisher and notifying players when updates occur
    • The squisher comes from our game library - squishjs
    • It's responsible for serializing ("squishing") game state.
  • Managing player connections to the session

Homenames

Homenames is an HTTP API that runs alongside a Homegames core instance. It maintains an in-memory map of player IDs to player names and settings. This allows a client to say "hey I'm player ID x" and a game session can say "I know you, you're booty slayer and you want sound muted."

1.2.0

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.1.2

7 months ago

1.4.3

7 months ago

1.4.2

7 months ago

1.4.0

7 months ago

1.0.33

8 months ago

1.0.32

8 months ago

1.3.6

7 months ago

1.3.5

7 months ago

1.3.0

7 months ago

1.0.31

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.26

1 year ago

1.0.27

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.3

2 years ago

0.9.92

2 years ago

0.9.93

2 years ago

0.9.91

2 years ago

0.9.9

2 years ago

0.8.0

2 years ago

0.7.78

2 years ago

0.7.83

2 years ago

0.7.80

2 years ago

0.7.82

2 years ago

0.7.81

2 years ago

0.7.77

2 years ago

0.7.76

2 years ago

0.7.75

2 years ago

0.7.72

3 years ago

0.7.71

3 years ago

0.7.70

3 years ago

0.7.62

3 years ago

0.7.61

3 years ago

0.7.60

3 years ago

0.7.55

3 years ago

0.7.11

3 years ago

0.7.54

3 years ago

0.7.57

3 years ago

0.7.56

3 years ago

0.7.12

3 years ago

0.7.51

3 years ago

0.7.5

3 years ago

0.7.53

3 years ago

0.7.52

3 years ago

0.7.59

3 years ago

0.7.58

3 years ago

0.7.49

3 years ago

0.7.10

3 years ago

0.6.54

4 years ago

0.6.53

4 years ago

0.6.52

4 years ago

0.6.51

4 years ago

0.6.5

4 years ago

0.6.35

4 years ago

0.6.32

4 years ago

0.6.33

4 years ago

0.6.31

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.5.58

4 years ago

0.5.55

4 years ago

0.5.56

4 years ago

0.5.57

4 years ago

0.5.3

4 years ago

0.5.5

4 years ago

0.5.26

4 years ago

0.5.25

4 years ago

0.5.24

4 years ago

0.5.23

4 years ago

0.5.22

4 years ago

0.5.21

4 years ago

0.5.20

4 years ago

0.5.17

4 years ago

0.5.16

4 years ago

0.5.15

4 years ago

0.5.11

4 years ago

0.5.14

4 years ago

0.5.12

4 years ago

0.5.1

4 years ago

0.5.0

5 years ago