Giter VIP home page Giter VIP logo

core's Introduction

Legend of the Green Dragon (Core)

Tests

Legend of the Green Dragon is a text-based RPG originally developed by Eric Stevens and JT Traub as a remake of and homage to the classic BBS Door game, Legend of the Red Dragon, by Seth Able Robinson. You can play it at numerous sites, including http://www.lotgd.net/.

After checking out the developer forums at http://dragonprime.net, it seemed that development had stalled, and specifically, any movement toward more modern technologies and decoupling the game from its web UI was non-existent.

Thus, we sought to create our own rewrite, codenamed Daenerys :)

Goals

  • Headless LotGD: instead of coupling the game with a specific UI, this core game functionality is meant to be wrapped in the interface of your choice.
  • Modular for easy extension.
  • Modern web technologies: PHP 7 since it's familiar to existing LotGD developers, with an appropriate ORM, etc.
  • MVVMC architecture.
    • Model. Of course, we access data through models.
    • View. I lied, there is no view for this core LotGD library! See Headless LotGD goal above.
    • View Model. Instead of a view, we'll have a view model with all the required information to build a view, in a structured format (i.e., in a class).
    • Controller. Game actions and state transitions occur through controllers.
  • Well-documented with as many type hints as PHP 7's limping type system will allow.
  • Well-tested. The only hope of keeping such a large codebase to a low bug count is unit tests. See tests/.

Non-Goals

  • Backward compatibility. It may be controversial since it would mean existing admins can't upgrade to this version, but keeping the old database schema would be seriously limiting to the quality of the codebase. If we actually finish this, then writing an importer wouldn't be too hard.

Learn More

Read more about the game at our wiki.

Here are some good articles to get you started:

  • Gameplay Summary: if you're unfamiliar with the original Legend of the Red Dragon or Legend of the Green Dragon, learn more about what kind of game this is :).
  • Architecture Overview: Get a high-level overview of the pieces of a LotGD game, based on a simple example realm.

Contributing

Looking to help us? Awesome! Check out the Help Wanted Issues to find out what needs to be done, or reach out on Slack.

Lots of communication is happening on our Slack channel. Reach out to austenmc by opening an issue or contacting @austenmc on Dragon Prime.

Some notes:

  • Pull requests cannot be accepted that break the continuous integration checks we have in place (like tests, for example).
  • Please include tests for new functionality. Not sure how to test? Say so in your PR and we'll help you.
  • Our git workflow requires squashing your commits into something that resembles a reasonable story, rebasing them onto master, and pushing instead of merging. We want our commit history to be as clean as possible.

Workflow should be something like:

# Start this flow from master:
git checkout master

# Create a new feature branch, tracking origin/master.
git checkout -b feature/my-feature-branch -t origin/master

# Make some awesome commits and put up a pull request! Don't forget to push your branch to remote before creating the PR. Try something like hub (https://hub.github.com/) if you want to create PRs from the command line.
...

# If necessary, squash your commits to ensure a clean commit history.
git rebase -i

# Edit the last commit message, saying you want to close the PR by adding "closes #[PR number]" to the message.
git commit --amend

# Rebase to ensure you have the latest changes.
git pull --rebase

# Push to remote.
git push origin feature/my-feature-branch:master

# Delete your feature branch.
git branch -D feature/my-feature-branch

Contributors

Leads

Other Contributors

core's People

Contributors

austenmc avatar cousjava avatar dependabot[bot] avatar gaeakat avatar vassyli 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core's Issues

Implement a possibility to parse values within Scene-related values

It would be a great addition if variables could be used within scene descriptions, titles, and maybe actions too. I suggest to maybe rely on twig or at least use a similar syntax, we might be able to use their code:

You enter the shop of {{ Scene.Property.VendorName }}. 
They look at you,
 {% if Character.Property.Race == "dwarf" %} and start to smile. "A fellow dwarf, I see", they mumble
 {% else %} and look at you with distrustful eyes {% endif %} 
as they show you their wares.

cascade=delete does cause a DBAL exception "no such column"

During the changes for the modules and preparation of release 0.2, I've found that doctrine throws a DBAL Exception if a scene gets deleted which has connection groups associated.

Doctrine\DBAL\DBALException: An exception occurred while executing 'DELETE FROM scene_connection_groups WHERE scene = ? AND name = ?' with params [null, "lotgd\/module-village\/outside"]:

SQLSTATE[HY000]: General error: 1 no such column: scene

Rename fk columns in entities to omit the _id part

Most of our fk columns in our entities have the snaky _id at the end. This seems to sometimes cause troubles with doctrine during remove cascade. In future, all fk column names need to be identical to their PHP property name.

Fixing this contributes to #86

Incomplete collection of daenerys commands to change database entries

Currently, administration of Daenerys is difficult as the core does only offer a limited range of console commands.

I suggest the addition of the following features:

  • Possibility to create new scenes from the cli, and connect existing ones
  • Game configuration
  • Message threads and messages
  • Edit Module properties
  • Message of the day

TimeKeeper->isNewDay checks for null argument which is not allowed by type hint

    public function isNewDay(DateTime $lastInteractionTime): bool
    {
        if ($lastInteractionTime == null) {
            return true;
        }
        $t1 = $this->gameTime();
        $t2 = $this->convertToGameTime($lastInteractionTime);
        $d1 = $t1->format("Y-m-d");
        $d2 = $t2->format("Y-m-d");
        return $d1 != $d2;
    }

$lastInteractionTime cannot be null, yet the function checks for this value.
Suggested fix: Change DateTime to ?DateTime.

Make daenerys command line tool to run maintenance tasks

Build this on top of Symfony's console library (https://packagist.org/packages/symfony/console).

Brainstorming initial commands:

daenerys modules:validate: check the existing module setup for issues (like event subscriptions).
daenerys modules:freshen: setup any uninitialized modules and repair any issues found (like event subscriptions).

Hmm, I need to think about this since I want this command to also be used by module developers to automate tasks. Might just defer those issues until later.

Allow scenes to have properties

Currently, characters and modules have properties. Both have them to allow arbitrary values, an important point when writing modules for Daenerys. Scenes should also get their own properties for the same reason: It would allow upon the creation of a scene to set scene-specific values. These values could be used for:

  • Specific settings for that Scene, such as the name or the inventory list of a vendor. Imagine Pegasus and MightyE to be the same scene template!
  • Scene-specific states. Examples might be a simple fountain scene were players could donate money, with the current amount being fountain-specific.

Make bin\daenerys extensible

Make bin\daenerys extensible so that crate's can take that console application and extend upon it. It's desirable that, if a crate wants to offer additional console commands, that it can extend upon the core's console application to have a common interface for the end-user.

Fix library dependencies to be more flexible

lotgd/core requires monolog/monolog to be of version 1.16.0 which is incompatible with symfony 3.1 which accepts ^1.12. monolog/monolog 1.16.0 contains a missing method which is why it's incompatible.

Module::handleEvent needs access to it's properties.

We should supply handleEvent as well with the module entity in order to access properties. This already is the case for onRegister/onUnregister. There are 2 possibilities:

  • we provide the module in the context array
  • we provide an additional parameter just as with onRegister/onUnregister. The function signature should be compatible as long as we add a parameter to the end of the function.

Additional module features

It's time to improve the module system.

  • Track module versions, and offer an upgrade path
  • Offer a module:config command that modules can utilize.
  • Add the possibility to deregister an existing module, making it self for removal.
    • Maybe prevent composer from removing if not deregistered. Doable?

Dragonprime

Hello, please can you get 'timmyboyox' approved on DragonPrime.
Waiting for admin approval and been contacting for days but no one is answering or accepting!

Migrate to PHPUnit 7

Since PHPUnit 7 is out for a while, we'd like to use it instead of PHPUnit 5.7 due to it being up to date with PHP7. However, direct migration is impossible since test recognition relies on extending from the correct base class (which, in this case, still is PHPUnit 5.7). Additionally, some dependencies seem to rely on PHPUnit 5.7 still and don't work together with PHPUnit 7.

Build a logger and add relevant log statements

Build a $game->getLogger() method that returns an instance of Monolog.

Initially, make a rotation file logger (pick one of Monolog's built-in ones).
Set up an environment variable called LOG_DIR or something to specify where the logs should go.

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.