1.0.31 • Published 13 days ago

homegames-core v1.0.31

Weekly downloads
149
License
ISC
Repository
github
Last release
13 days 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.0.31

13 days ago

1.0.29

3 months ago

1.0.28

3 months ago

1.0.26

3 months ago

1.0.27

3 months ago

1.0.19

7 months ago

1.0.18

7 months ago

1.0.17

7 months ago

1.0.16

7 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.22

7 months ago

1.0.21

7 months ago

1.0.20

7 months ago

1.0.25

7 months ago

1.0.24

7 months ago

1.0.23

7 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.15

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

1.0.3

10 months ago

0.9.92

10 months ago

0.9.93

10 months ago

0.9.91

10 months ago

0.9.9

10 months ago

0.8.0

10 months ago

0.7.78

1 year ago

0.7.83

1 year ago

0.7.80

1 year ago

0.7.82

1 year ago

0.7.81

1 year ago

0.7.77

1 year ago

0.7.76

1 year ago

0.7.75

1 year ago

0.7.72

2 years ago

0.7.71

2 years ago

0.7.70

2 years ago

0.7.62

2 years ago

0.7.61

2 years ago

0.7.60

2 years ago

0.7.55

2 years ago

0.7.11

2 years ago

0.7.54

2 years ago

0.7.57

2 years ago

0.7.56

2 years ago

0.7.12

2 years ago

0.7.51

2 years ago

0.7.5

2 years ago

0.7.53

2 years ago

0.7.52

2 years ago

0.7.59

2 years ago

0.7.58

2 years ago

0.7.49

2 years ago

0.7.10

2 years ago

0.6.54

3 years ago

0.6.53

3 years ago

0.6.52

3 years ago

0.6.51

3 years ago

0.6.5

3 years ago

0.6.35

3 years ago

0.6.32

3 years ago

0.6.33

3 years ago

0.6.31

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.5.58

3 years ago

0.5.55

3 years ago

0.5.56

3 years ago

0.5.57

3 years ago

0.5.3

3 years ago

0.5.5

3 years ago

0.5.26

3 years ago

0.5.25

3 years ago

0.5.24

3 years ago

0.5.23

3 years ago

0.5.22

3 years ago

0.5.21

3 years ago

0.5.20

3 years ago

0.5.17

3 years ago

0.5.16

3 years ago

0.5.15

3 years ago

0.5.11

3 years ago

0.5.14

3 years ago

0.5.12

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago