Simple HTML5 Wesnoth implementation

Discuss the development of other free/open-source games, as well as other games in general.

Moderator: Forum Moderators

Post Reply
Posts: 1
Joined: May 18th, 2010, 12:28 am

Simple HTML5 Wesnoth implementation

Post by apsillers »

Last year I worked on a pet project called "Lords of the Fey" which is a re-implementation of some of Wesnoth multiplayer in a browser using HTML5. Code is at, with a test server up at

So far I've only implemented a tiny fraction of Wesnoth functionality: Rebel and Northerners factions, some terrain types, recruiting, combat, villages. There's no animations, fog of war, multi-turn move planning, sound, damage calculator, terrain transitions, etc. (I'm interested in the possibility of pulling in functionality from wesnoth-tiles to handle map-drawing.) I was waiting to share this until at least some of those were completed, but I think this project will never be in a place that I feel is "ready to share" so I thought I might as well share it now. (I haven't done any work on it several months.)

My long-term goal for the project is to make a persistent, large world map, which player can fight over by playing games of Wesnoth. (Think of the board game Risk, but instead of rolling dice, you play complete games of Wesnoth.) As it stands right now, though, the game is just a simple implementation of Wesnoth-like gameplay in the browser.

One feature I did implement that I like a lot is the ability to send a link to a game that immediately grants control of a player without logging in. Only one person needs to make an account and great a game, and then the creator can invite friends to play without forcing them to create an account first. For instance, in the game at ... feb8864cfb, player 1 is a logged-in player, but you can control player 2 - 4 by visiting the links

* Player 2: ... 4662872851
* Player 3: ... 5804156214
* Player 4: ... 1396288574

You can only do anything as a particular player if it's their turn, so only one of those links will allow you to control units at any given time. (Advance move planning during your off-turn is not implemented.)

Note that this implementation isn't compatible with the real game, because it uses a JSON representation for units, factions, and moves, rather than WML. If I had a WML parser written in JavaScript, it might be possible to actually use data files directly from BfW (and -- even more far-off -- potentially communicate with a BfW game sever).
User avatar
Posts: 1005
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands

Re: Simple HTML5 Wesnoth implementation

Post by bumbadadabum »

Wow this is really cool.
User avatar
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: Simple HTML5 Wesnoth implementation

Post by ancestral »

Neat! Reminds me of my prototype Wesnoth-Canvas project. (Feel free to pilfer or steal whatever you like from it.)
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
Exp. map viewer
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: Simple HTML5 Wesnoth implementation

Post by Shadow_Walker »

Don't make my mistake, please start using pixi.js as early as possible. It gives you the power of WebGL, so your 2d game will run draw much faster, and it will allow you to use GL effects for things like fog of war.
Post Reply