Skip to content

Explore the dual worlds of Cob's Farm, an action RPG where farming tranquility meets dungeon adventure. Alpha stage game featuring diverse activities like farming, fishing, and combat, enhanced by community interaction and open-world exploration.

License

Notifications You must be signed in to change notification settings

jacobhuberdotme/looperlands

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LooperLands

Local development

Install some dependencies.

sudo apt-get install jq
sudo apt-get install docker-compose

Build a map

./build_maps.sh main.tmx

The following script will build the client and server and run them locally, so you do not have to run the above steps.

./run-local.sh

To kill it, press Ctrl+C.

To get a new session run:

./local-session.sh

This will print out a URL and open up the URL in your browser

Using docker-compose watch

Docker compose watch automatically will rebuild the gameserver when you make local changes. In one terminal run:

docker-compose -f docker-compose-local.yml watch

In another, run the following to view logs:

docker-compose -f docker-compose-local.yml logs -f

Set XP Multiplier

The following endpoint multiplies the experience gained by multiplier for duration. Post to /setxpmultiplier with the following body:

{
    "multiplier": y,
    "duration": x
}

Where Y is an integer, and X is seconds. The following example will double the experience for 60 seconds after posting to the endpoint:

curl -X POST -H "Content-Type: application/json" -H "x-api-key: $LOOPWORMS_API_KEY" -d "{\"multiplier\": 2, \"duration\":60}" http://127.0.0.1:8000/setxpmultiplier

Activate/deactivate trigger

The following endpoint activates/deactivates triggers (for example event doors). Post to /activateTrigger or /deactivateTrigger with the following body:

{
    "triggerId": "triggerId",
    "mapId": "mapId" // mapId is optional = defaults to main!
}

The following example will activate the doors with triggerId = Fight Night:

curl -X POST -H "Content-Type: application/json" -H "x-api-key: $LOOPWORMS_API_KEY" -d "{\"triggerId\": \"Fight Night\"}" http://127.0.0.1:8000/activateTrigger

Announcement

The gameserver accepts announcements per map. Not including maps will send to all maps. Not including timeToShow seconds will display the announcement until the user clicks exit.

 curl -X POST http://localhost:8000/announce      -H "Content-Type: application/json"      -d '{"message": "Server maintenance will start at 8 PM.", "maps" : ["taikotown"], "timeToShow": 5}' -H "x-api-key: placeholder"

Add a mob

  • Add each scale image to client/img/n
  • Create a sprite.json under client/sprites for the mob with the same name as the scale image. Make sure the ID inside the JSON matches
  • Add sprite.json (with the correct name) to sprites.js
  • Add the new id to game.js array this.spriteNames
  • Add new mob entity to gametypes.js
  • Add a new mob class in mobs.js
  • Add the new entity factory in entityfactory.js
  • Add the new mob to properties.js
  • Add the mob to mobset_oa.png. Reopen tiled and note the id.
  • Add the mob to the .tmx file noting the id in tiled.

Performance profiling

This is useful to determine bottle necks.

  1. Edit the Docker file to have this command (note the --prof):
CMD node --prof server/js/main.js
  1. Run the game server
  2. docker ps to find its id
  3. docker exec -it <id> /bin/bash where id from step 3. Then run ls in the terminal to find the .log file
  4. docker cp <id>:/opt/app/isolate<find real path from step 4>.log ~/isolate.log to copy the .log file from the container to your host
  5. Process the .log file to human readable (make sure node version is modern):
node --prof-process isolate.log > isolate.out
  1. Read your version of isolate.out

About

Explore the dual worlds of Cob's Farm, an action RPG where farming tranquility meets dungeon adventure. Alpha stage game featuring diverse activities like farming, fishing, and combat, enhanced by community interaction and open-world exploration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.8%
  • Python 13.7%
  • CSS 1.2%
  • Other 0.3%