Irdya - Wesmere Reference Implementation

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

Moderators: Forum Moderators, Developers

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Irdya - Wesmere Reference Implementation

Post by fendrin » November 26th, 2015, 1:30 pm

I want to use this thread similar to a weblog covering the development of a Wesnoth clone.
Comments and suggestions are of course very much welcomed.

So Wesmere is a bunch of protocols, apis and conventions.

Irdya is a first attempt to establish those by implementing a game that is very similar to Wesnoth.
Related to this is the WSL thread.

There is a repository at github but don't expect it to be of any use
if you are not interested in early development.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

User avatar
Pentarctagon
Forum Administrator
Posts: 4050
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Irdya - Wesmere Reference Implementation

Post by Pentarctagon » November 26th, 2015, 8:54 pm

So Irdya is the Wesnoth clone, and Wesmere is... another name for WSL? Or it's a particular implementation of WSL?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Re: Irdya - Wesmere Reference Implementation

Post by fendrin » November 27th, 2015, 8:48 am

Pentarctagon wrote:So Irdya is the Wesnoth clone, and Wesmere is... another name for WSL? Or it's a particular implementation of WSL?
Wesmere is more like a framework.

Every Wesmere Game Client is supposed to work with every other Wesmere Game Server.
Wesmere Modules (or short WesMods) are supposed to work with every WesGameServer.

So yes, WSL is part of the Wesmere thing.

Irdya is currently a WesGameServer in early development.
I have also some ascii art map display code, but the focus is on implementing a server.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Re: Irdya - Wesmere Reference Implementation

Post by fendrin » November 28th, 2015, 4:36 pm

I am busy with implementing everything that comes with WSL.

There are a lot of actionWSL functions to implement for example.

One bizarre thing I stumbled upon is the [lua] tag.
It allows to execute lua code as actionWML.

Although Irdya is implemented in Lua (or MoonScript) itself and only deals with Lua content, this actionWML tag seems to be impossible to translate.

Supporting it natively would mean that WSL needs a subset implementing Wesnoth's Lua api.

I have never used Lua much to get things done in Wesnoth.
Wesnoth's Lua api never appealed to me much.

I wonder how many add-ons actually make heavy use of the Lua API and if it is worth to make some efforts to support it or to make translation easier.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

User avatar
Pentarctagon
Forum Administrator
Posts: 4050
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Irdya - Wesmere Reference Implementation

Post by Pentarctagon » November 28th, 2015, 7:46 pm

Given how limited WML is in some aspects, such as string manipulation, using lua is all but required. I don't know how many embed it directly, but lua is used widely even in mainline to define WML action/conditional tags.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Re: Irdya - Wesmere Reference Implementation

Post by fendrin » November 29th, 2015, 12:06 am

Pentarctagon wrote:Given how limited WML is in some aspects, such as string manipulation, using lua is all but required.
Yeah, I can't agree more.
I don't know how many embed it directly, but lua is used widely even in mainline to define WML action/conditional tags.
Indeed, that is the question.
How many people embed it directly?
-- since every other form of using it indirectly is already covered by the WSL api.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

User avatar
Pentarctagon
Forum Administrator
Posts: 4050
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Irdya - Wesmere Reference Implementation

Post by Pentarctagon » November 29th, 2015, 4:22 am

If every other way of using it indirectly is covered, and given that turning embedded lua into indirect lua such as a WML tag definition is rather easy (though crude), I would say that it doesn't really matter. WSL is already meant to replace WML entirely, so any added effort to indirectly use lua rather than embed it is really rather small by comparison.

Also, I don't know if there's any way to batch download from the add-on server, but if there is it wouldn't be overly difficult to write a shell script to decompress/untar/grep them all looking for the [lua] tag.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Re: Irdya - Wesmere Reference Implementation

Post by fendrin » November 29th, 2015, 9:20 pm

Pentarctagon wrote:... Also, I don't know if there's any way to batch download from the add-on server, but if there is it wouldn't be overly difficult to write a shell script to decompress/untar/grep them all looking for the [lua] tag.
Good idea.

I guess one could write a small script around the python add-on client to do so.
Sadly the amount of network traffic I can use is limited currently.

But I keep the idea in mind.
Making a decision about how to handle [lua] is not urgent yet.

Looks like a good idea to give an overview about the current state of the project.

The code for registering WSL functions and loading WesMods is already in a usable state.
Starting a scenario already works but the side and unit creation is not final yet.

The Kernel is already able to do the event handler execution.
I have implemented about half of the actionWSL functions and translated some of the macros into functions.

There is no display client yet, only some rough code for displaying the map in ascii art.
First I planed to implement the ascii client first to have a better method of testing everything.

But in the meantime it seems to be better to go with unit tests first.
This means every Kernel feature and all actionWML functions are supposed to be automatically tested by the suit.

I think the project has now reached a level of maturity in which it makes sense to choose a free license for it and to invite fellow developers to join.

There is no use for c++ coders yet,
only Lua (MoonScript is so similar that it can be subsumed) skills are needed.
Last edited by fendrin on December 30th, 2015, 12:29 am, edited 1 time in total.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

User avatar
Elvish_Hunter
Forum Moderator
Posts: 1394
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Irdya - Wesmere Reference Implementation

Post by Elvish_Hunter » December 3rd, 2015, 5:27 pm

fendrin wrote:
Pentarctagon wrote:... Also, I don't know if there's any way to batch download from the add-on server, but if there is it wouldn't be overly difficult to write a shell script to decompress/untar/grep them all looking for the [lua] tag.
Good idea.

I guess one could write a small script around the python add-on client to do so.
Sadly the amount of network traffic I can use is limited currently.
... or one can just use wget to create a local mirror of the add-ons server (only 1.8, 1.10, 1.11 and 1.12, as Lua wasn't supported in past), then use bzip2 and tar to unpack the add-ons, then run grep.
That won't solve, however, the bandwidth problem. :(
Also, while the project seems interesting, I sincerely hope that players won't end up playing Wesnoth in a Terminal screen and text-only mode! Or at least, that's what the repository seems to imply. Will this reimplementation get, sooner or later, a proper GUI?
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author), Wesnoth Lua Pack
1.12: Children of Dragons

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Re: Irdya - Wesmere Reference Implementation

Post by fendrin » December 3rd, 2015, 11:52 pm

Elvish_Hunter wrote:Also, while the project seems interesting, ...
:D
...
I sincerely hope that players won't end up playing Wesnoth in a Terminal screen and text-only mode! Or at least, that's what the repository seems to imply. Will this reimplementation get, sooner or later, a proper GUI?
The Wesmere protocols specifying how client (display) and server (game mechanics) communicate only call for a unit and what is supposed to happen with it but not how.

For example the server requests from the client to move the unit from 12/08 to 14/09.
Depending on the kind of client it might just change some ascii characters, animate current Wesnoth images or use some fancy 3d meshes.

I hope that people are going to start projects implementing Wesmere Display Clients soon.

A cheap way of producing a working display client would be to fork the Wesnoth codebase, remove or disable everything done by the game server now and adjust it to use the Wesmere protocol.

This procedure leads to a playable Wesmere experience soon but is a dead end.
If forking the old and spoiled codebase would be a good idea on the long term I would have done that for sure.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Re: Irdya - Wesmere Reference Implementation

Post by fendrin » December 18th, 2015, 12:31 pm

During the last 2 weeks a lot of grunt work has been done.

After discovering that iceiceice already ported a good part of the actionWML into Lua space it makes a lot more sense to support Wesnoth's Lua api.

So I ported nearly almost everything of Wesnoth that is already written in Lua into MoonScript.
Converted both, the Lua API and the WML API into either ldoc (tool for generating api documentation) or (in case of the WML API) into tables defining their syntax.
Those tables can be used to generate API documentation for WSL and for checking the syntax of a WSL function's argument table.

The remaining tasks to have a working Wesmere Game Server are:
Implement the wesmere API.
Port what I already implemented before (of WSL) to use the wesmere API.
Implement those WSL functions which have neither been implemented by me yet or have already been implemented by ice³ or other Wesnoth developers.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

User avatar
Pentarctagon
Forum Administrator
Posts: 4050
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Irdya - Wesmere Reference Implementation

Post by Pentarctagon » December 26th, 2015, 7:26 am

Are there any plans by you or someone else to make a Wesmere Display Client? Not to put too fine a point on it, but if there isn't anything being displayed then I doubt the server will be used a whole lot.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
iceiceice
Developer
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Irdya - Wesmere Reference Implementation

Post by iceiceice » December 26th, 2015, 5:59 pm

I'm interested in making a nice display client for the system, and I have been tinkering with it a bit. However, it's still pretty experimental and I'm not really ready to announce anything. Nor am I necessarily committed to it -- it depends how the experiments go.

If other people want to take a stab at making a display client, by all means I encourage you to, probably they can all interoperate if we are all based on fabi's system :D

User avatar
iceiceice
Developer
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Irdya - Wesmere Reference Implementation

Post by iceiceice » January 1st, 2016, 7:44 pm

I should clarify though, what I am making would not be "for" this system, so much as, able to support this system, in addition to others.

It depends also if fabi will eventually write some much better documentation and examples, I mean, right now I like the idea but the repo is very difficult for anyone who isn't fabi to make sense out of. It really needs, for starters, some installation and usage instructions. :whistle:

fendrin
Posts: 31
Joined: September 10th, 2009, 10:45 am

Re: Irdya - Wesmere Reference Implementation

Post by fendrin » February 18th, 2016, 11:11 am

Pentarctagon wrote:Are there any plans by you or someone else to make a Wesmere Display Client? Not to put too fine a point on it, but if there isn't anything being displayed then I doubt the server will be used a whole lot.
I don't plan to implement a full featured Wesmere Display Client myself.
However, the simple asci art client is still on my TODO.
iceiceice wrote:I'm interested in making a nice display client for the system, and I have been tinkering with it a bit. However, it's still pretty experimental and I'm not really ready to announce anything. Nor am I necessarily committed to it -- it depends how the experiments go.
That is nice to hear. :)
If other people want to take a stab at making a display client, by all means I encourage you to, probably they can all interoperate if we are all based on fabi's system :D
Yeah, that is my idea as well. A few different approaches which might or might not merge later at some time.
iceiceice wrote:I should clarify though, what I am making would not be "for" this system, so much as, able to support this system, in addition to others.
Sounds like a good approach as well.
It depends also if fabi will eventually write some much better documentation and examples, I mean, right now I like the idea but the repo is very difficult for anyone who isn't fabi to make sense out of. It really needs, for starters, some installation and usage instructions. :whistle:
Yes, I have been back in the planing phase for some time.
As always the first plan did not hold and needs to be refined some more.

So I think after some more time with Lua and Moonscript that just offering regular Lua/Moonscript modules is the most flexible way for the users.
A user in this context would be a coder of a WesmereGameServer.

I still have to figure out how this is done properly, help from Lua coders is very much welcomed.

I need some time to refactor the current codebase into modules (maybe about 2 weeks),
then a first draw of instructions will be inlcuded.

It comes down to write a WesmereGameServer Lua host in any programming language supporting Lua you want.
Irdya will be such a host written in Moonscript.

There you
local wesmere = require "wesmere"
and use it to handle every network request the host receives from Clients and pass them to wesmere.
On the other side will wesmere most likely force you to implement some functions in your host which it uses to communicate to the clients in the other direction.
You see that my ideas how this part of the project should work are not very stable yet.
Any ideas?

Everything (or most) the coder needs to know can be extracted from the generated html api documentation,
I will see that there is a online version when it is stable enough to make any sense.
"Wesnoth has many strong points but team and users management are certainly not in them." -- pyrophorus
"The thing a project in the true spirit of open source has to fear is not forking, but clean-room re-implementation. When that happens, you know something is wrong."

Post Reply