This is a retro style top down multiplayer client/server game engine. The application acts as the server (which can be networked or just run locally) and the gameplay takes place in a web browser. Greatly inspired by ZZT this project is an attempt to recreate some of the simplistic experiences of character driven graphic games.
For those who prefer to not install all sorts of dependencies on their development system Docker may be used.
To start the app server container and postgres container, run:
docker compose up
To launch an interactive iex shell running the app (with the ability to run and hit the application server at some point) run:
docker compose run --rm --service-ports dcrawl
Or to run a bash shell (and allow iex to be started manually) start postgres then run app:
docker compose run --service-ports --use-aliases --rm -d postgres
docker compose run --rm --use-aliases --publish 4000:4000 app bash
(The app service route, for the first time you will need to run docker/init.sh
manually to get erlang, elixir, node, etc)
If its your first time, this can be a lengthy process if building the image.
To clear destroy the containers and remove the dcrawl image:
docker compose down --rmi local
To also remove all the volumes (ie, delete all the DB data, downloaded mix deps, etc)
docker volume rm dungeon_crawl_asdf dungeon_crawl_build dungeon_crawl_deps dungeon_crawl_node dungeon_crawl_postgres dungeon_crawl_static dungeon_crawl_tmp
When running docker there are many ways. After setup, simplest is
docker compose up
Or, as mentioned above a docker compose run ...
described above may be uesd. This
could be convenient if needing to also run tests or troubleshoot npm or debug.
The postgres container will need to be running - if running the dcrawl container, this will be started.
If going the app
service route, be sure to run docker compose run --rm -d postgres
to start the postgres
container first, otherwise you'll get DBConnection.ConnectionError
should postgres not be up.
Now you can visit localhost:4000
from your browser.
There are several dependencies needed. Many of these can be found in the Dockerfile or init.sh
.
Depending on your local OS installation may differ.
asdf
is used for language version management https://github.com/asdf-vm/asdfpostgres
is the database used
Other setup
- Install dependencies with
mix deps.get
- Install Node.js dependencies with
npm install
in theassets
directory
To Start the app:
mix phx.server
or
iex -S mix phx.server
to have an interactive shell running with your server. This ties a console to the running server, and you can also create execute elixir statements without having to start a separate console.
Now you can visit localhost:4000
from your browser.
The database will need setup via mix ecto.create && mix ecto.load
, or
mix ecto.create && mix ecto.migrate
if you prefer taking your time.
You'll want to iex -S mix
and create a super use for yourself, and load the asset seeds.
DungeonCrawl.Account.create_admin(%{name: "Admin", username: "Admin", password: <changeme>, user_id_hash: :base64.encode(:crypto.strong_rand_bytes(24)), is_admin: true})
DungeonCrawl.TileTemplates.TileSeeder.seed_all
DungeonCrawl.Sound.Seeder.seed_all
DungeonCrawl.Equipment.Seeder.seed_all
# You can create a Joinable dungeon with this, or just import one of the json exports in the root path.
DungeonCrawl.Dungeons.generate_dungeon(DungeonCrawl.DungeonGeneration.MapGenerators.ConnectedRooms,
%{autogenerated: false, active: true, name: "Seeded Joinable Dungeon"},
%{width: 40, height: 20},
true)
Ready to run in production? Please check our deployment guides.
- Official website: http://www.phoenixframework.org/
- Guides: http://phoenixframework.org/docs/overview
- Docs: https://hexdocs.pm/phoenix
- Mailing list: http://groups.google.com/group/phoenix-talk
- Source: https://github.com/phoenixframework/phoenix