Coder Social home page Coder Social logo

jerenaux / westward Goto Github PK

View Code? Open in Web Editor NEW
125.0 7.0 40.0 308.18 MB

A collaborative MMORPG made in Javascript

Home Page: http://www.westward-online.com

License: MIT License

CSS 2.95% HTML 1.10% JavaScript 95.91% Dockerfile 0.03%
game javascript online-game mmorpg phaser3 phaserjs nodejs

westward's Introduction

Westward

Westward is an open-source aspiring MMORPG written in Javascript. The game is not online at the moment as the project is not actively maintained anymore.

Disclaimer: Westward began as a closed-source project, and has grown that way for more than 2 years. As a result, the current codebase is messy and not very collaboration-friendly. Documentation is sorely missing, the tests are a mess, and the code itself looks like what a 2+ years codebase maintained by one guy can look like. You can make that change! I invite you to point out where the code is particularly unclear and where the lack of documentation is particularly painful. I will give top priority to addressing these feedbacks.

Vision

As a game, Westward aims to be a collaborative MMORPG where the players have to build a nation, starting from scratch and progressively settling a large continent. A more lengthy description can be found on the description page of the game.

As an open-source project, Westward aims to be a great collaborative experience for contributors of all sorts. The goal is also to be a learning experience, for me as well as for developpers interested in gamedev. I hope the contributions and the community will grow into a space for us to learn and have fun improving that game.

For more insight into the evolution of the project, check out the dev logs.

Community

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. At some point a Docker image should be rolled out to facilitate that process (feel free to contribute on that front if that's your area of expertise!)

Prerequisites

  • A recent version of Node.js
  • A MongoDB instance listening on port 27017

Installing

Clone this repository, then navigate to it and install the dependencies:

npm install

You should also create a file called .env at the root of the directory. This is where the dotenv package will be looking for environment variables. Your local version doesn't need to define any environment variables, but dotenv will complain if that file is missing.

touch .env

Running the game

The most straightforward way ton run the game server is to do:

node dist/server.js

Then navigate to localhost:8081 to play the game.

If you make modifications to the game, don't forget to rebuild it using webpack, which you can do by running:

npm run webpack

Alternatively you can run webpack-dev-server to automatically watch for changes and rebuild when changes are detected. You can do so by running:

npm run watch:webpack

The file package.json defines all the npm run ... commands that are available. Feel free to add more if you think that would be useful!

Using Docker

Alternatively, you can use the Dockerfile to create a container with all the necessary components already installed. You need to have Docker installed. Then, in the directory where you clones the project, run:

docker-compose build
docker-compose up -d

The default port when using the Docker way is 80, so you need to navigate to <IP_of_your_Docker_machine>:80 to be able to access the game (e.g. 192.168.99.100:80).

Running the tests

Some tests have been set up, mainly focusing on testing the client/server API and some internal server functions. They can be run as follows:

npm run test

These tests could be improved in a million ways, by being better documented, being more clean, or simply by adding more tests. In an ideal world, the tests could act as a gateway to the codebase, providing a clear view of what is going on and helping contributors dive in. It's not the case yet, but feel free to contribute on that front!

Deployment

The master branch of this repository is deployed on an AWS EC2 instance maintained by myself. I will not elaborate too much on that aspect since it doesn't impact contributions, but I can provide more information if there is demand for it.

Built With

  • Phaser 3 on the client side - The best Javascript game engine
  • Node.js on the server side
  • MongoDB for the database

Contributing

Please read CONTRIBUTING.md for details on the process for submitting contributions.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Thanks

Many thanks to the following people for supporting Westward on Patreon:

  • Sean Pope
  • Flavius Poenaru, currently working on Kaetram, an open-source 2D HTML5 adventure

Donate

If you are interested in Westward and want to see it grow, I invite you have a look at my Patreon page where you can find a listing of rewards for various levels of recurring contributions. Even the smallest contributions can go a long way as a signal of your interest and your support.

westward's People

Contributors

dependabot[bot] avatar jerenaux avatar mikemnd avatar olegon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

westward's Issues

Variable belt capacity

The number of slots in a belt should not be limited to 3. Better belts should be able to hold more items.

In practice, the capacity of quick slots should become flexible and be affected by the currently equipped belt.

When first entering a building, actions cannot be performed.

When first entering a lumbermill, I can't take the lumber. The buttons work, and I can hear the clicky sound, but it doesn't do anything. Same with when I first enter the workshop. The problem is fixed when I leave and come back though.

I also can't place a lumbermill anywhere. The squares turn green, and I know it's next to a forest, but when I click, nothing happens.

Add tests

Only parts of the codebase is currently covered by tests. Adding new tests would be valuable to:

  • Catch bugs early, especially as multiple people start working on the code
  • Help the documentation effort since good tests are small chunks of code that illustrate specific functionalities in action

Add sound effects

The atmosphere of the game could be improved by adding sound effects where they are lacking or improving the ones already present.

Weapon durability

At the moment, all weapons are infinitely durable, meaning they can't break. Having breakable weapons could have the following effects:

  • Increase the demand for resources that go into crafting weapons
  • Create demand for higher-tier weapons (possibly made from rarer materials) that break less easily
  • Increase the need to plan ahead and to carry multiple weapons just in case
  • Make the ability to equip weapons from the belt in battle more useful
  • Open the door for crafstman abilities that impact the durability of crafted weapons

Variable backpack capacity

The number of slots in a the inventory should not be limited to 20. Better backpacks should be able to hold more items.

In practice this would require:

  • Introducing a new equipment slot for the backpack, which cannot be empty (a default basic backpack would be always equipped unless a better one is equipped)
  • Taking into account the currently equipped backpack when computing maximum capacity
  • Handling edge cases (e.g. dealing with item surplus when equipping a lower-capacity backpack)

Add 'new' marker to character menu icon

The character menu contains a log of events relevant to the player. When a new such event occurs, a 'new' symbol (or something similar) should be displayed near the menu icon to prompt the players to open that menu.

About go to place for character

Hi @Jerenaux, first of all thanks for sharing this.
I’m looking on the game and first thing i though, let’s click around more and more and see what’s happening. It’s getting a bit confused about where to go.
Might be nice to give a half or quarter second for to have another place to go ❔

Make tutorial text boxes draggable

Tutorial text boxes are currently displayed at hard-coded locations, and remain there. The user experience might be improved if these could be moved around.

Variable gold pouch capacity

The amount of gold that players can carry is unlimited at the moment. A new equipment type, the gold pouch, could be introduced, which would limit the amount of gold carried. Different pouches would allow to carry more or less gold.

In practice this would require:

  • Introducing a new equipment slot for the gold pouch, which cannot be empty (a default basic pouch would be always equipped unless a better one is equipped)
  • Putting and enforcing a cap on the gold amount based on the equipped pouch

Add docstrings

Most methods in the codebase lack proper docstrings explaining

  • What the method does
  • When/by what is it usually called
  • What are arguments
  • What is the returned value

Eventually, all methods should be documented that way! If you want to contribute but are not sure about some methods, feel free to ask on one of the community channels.

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.