Making a browser version of wesnoth?

General feedback and discussion of the game.

Moderators: Forum Moderators, Developers

enclave
Posts: 885
Joined: December 15th, 2007, 8:52 am

Re: Making a browser version of wesnoth?

Post by enclave » July 4th, 2018, 7:05 am

ForestDragon wrote:
July 3rd, 2018, 4:08 pm
Do you mean the add-on? Yeah, that's actually a good idea. I suppose I might reupload it once it's not an unplayable mess.
it's not that bad :) better leave it, maybe somebody can pick it up and remake.. less work than making it from scratch, just make version 0.x.x to show it's not functional... my opinion. As far as I remember it's partly working, so it's at least fun to try.

User avatar
ForestDragon
Forum Regular
Posts: 1494
Joined: March 6th, 2014, 1:32 pm

Re: Making a browser version of wesnoth?

Post by ForestDragon » July 4th, 2018, 7:09 am

enclave wrote:
July 4th, 2018, 7:05 am
it's not that bad :) better leave it, maybe somebody can pick it up and remake.. less work than making it from scratch, just make version 0.x.x to show it's not functional... my opinion. As far as I remember it's partly working, so it's at least fun to try.
ok.
Co-creator of Era of Magic
Creator of Tale of Alan (1.12 abandoned),The Golden Age (1.12/1.13, abandoned),XP Bank (1.14),Alliances Mod(1.14), with a large add-on in development
"Real life is like a hyper-realistic VR game, but with permadeath and boring gameplay"

dagnelies
Posts: 9
Joined: June 2nd, 2018, 7:47 am

Re: Making a browser version of wesnoth?

Post by dagnelies » July 7th, 2018, 7:40 pm

Hey guys, take it easy! I wouldn't like this thread to derail into a fist fight. ;) It would be nice to keep a courteous tone.
I'm clearly realizing rewriting Wesnoth is a herculean task. It's always difficult to assess such big projects, and for now it was just an idea I toyed with.
I made a mini prototype to read maps and display them, to parse the WML and transform it into JSON, etc. ...but, it's complex, there is no denying it. I also have the impression the WML is "overcomplexified" in many places, but is hard to change because of compatibility reasons.
Lastly, one key factor for undergoing such a project is also long term support. If I saw many dozens of posts like "Hey, yeah, we want that!", it would be more motivating. However, apparently, there is indeed very little interest.

enclave
Posts: 885
Joined: December 15th, 2007, 8:52 am

Re: Making a browser version of wesnoth?

Post by enclave » July 8th, 2018, 11:51 am

yeah.. I dont think you would get much support for creating something that already exists in existing community.. It would only be useful for people who never tried wesnoth, and possibly you dont get a huge support from developers either because it will kind of be not their project and they will have none/few control over it.. Yeah it would benefit, but nobody will shout about it unfortunately.. just me whispering :D

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

Re: Making a browser version of wesnoth?

Post by Pentarctagon » July 8th, 2018, 2:29 pm

If something working and playable was eventually produced, I would sticky the thread for it here on the forums, at the least. And while I obviously can't speak for other developer support, I would say that it partially depends on if you make something that can be contributed into the Wesnoth Project itself or if you create it as something entirely separate.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

gfgtdf
Developer
Posts: 1104
Joined: February 10th, 2013, 2:25 pm

Re: Making a browser version of wesnoth?

Post by gfgtdf » July 8th, 2018, 5:01 pm

dagnelies wrote:
July 7th, 2018, 7:40 pm
Hey guys, take it easy! I wouldn't like this thread to derail into a fist fight. ;) It would be nice to keep a courteous tone.
I'm clearly realizing rewriting Wesnoth is a herculean task. It's always difficult to assess such big projects, and for now it was just an idea I toyed with.
I made a mini prototype to read maps and display them, to parse the WML and transform it into JSON, etc. ...but, it's complex, there is no denying it. I also have the impression the WML is "overcomplexified" in many places, but is hard to change because of compatibility reasons.
Lastly, one key factor for undergoing such a project is also long term support. If I saw many dozens of posts like "Hey, yeah, we want that!", it would be more motivating. However, apparently, there is indeed very little interest.
I think you should not worry too much about compatibility, if you have an browser version of this game (even if it expects a different data format) , then that already a very good archivevent while on the other hand a compatibility converter for a game that does not exist doesn't really give you anything.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

shevegen
Posts: 199
Joined: June 3rd, 2004, 4:35 pm

Re: Making a browser version of wesnoth?

Post by shevegen » July 8th, 2018, 10:08 pm

> I also have the impression the WML is "overcomplexified" in many places, but is hard to change because of compatibility reasons.

I am glad to see that I am not the only one.

However had, deprecation does not necessarily have to happen in a brute way. For example, one could try to find an alternative
to WML, with less complexity, simpler syntax and so forth, and then slowly transition into it. Ideally to be even able to transition
all the campaigns into this.

The problem is trying to come up with a simpler syntax. In some ways lua is simpler; on the other hand, it's a real programming
language designed to be embeddable from the get go.

I've noticed quite a few interesting campaigns. The largest add-on campaign is probably the best of all times. But there are
a few bugs or rather, oddities ... in one scenario I got lua-warnings for example.

Changing all that towards any simpler format is difficult. Perhaps the easiest way would be to design an alternative, and
then go to use that as an ALTERNATIVE syntax, e. g. where developers can choose which variants to use slowly,
and transition towards that. Lots of things can be re-used, like images; code logic obviously can not too easily be
re-used (and using WML as a programming language is madness, IMO ... denoting if clauses in [] tags is a bad
idea). But I digress from the main topic at hand, so ...

Bottom line is: it would be great if we could find or design a simpler language for describing a campaign. But it should
not happen in an exclusive manner, IMO, but a co-supportive one.

dagnelies
Posts: 9
Joined: June 2nd, 2018, 7:47 am

Re: Making a browser version of wesnoth?

Post by dagnelies » July 18th, 2018, 7:14 pm

OMG, lua is way more complex! I don't want to interpret a whole programming language, I just want to parse some data! ;)

I have no grudge with the WML format itself. The basics are even quite good IMHO. It's more that parts of the macros is abused. Like having macros in macros in macros. Then, you add named parameters, optional parameters, multi-line stuff, nested parentheses, fancy other pre-process flags, [+tags] to merge with the previous, etc.
It's not simply a "data format" anymore, the WML evolved into a fairly complex pre-processing machinery ...and most of the "advanced" stuff are used only in a few files for questionable benefits.

Additionally, some things look IMHO unnecessarily complex/fat in how WML is declared.

For example, the music of a scenario (example picked from HTTT/scenarios/01_The_Elves_Beseiged.cfg):

Code: Select all

[scenario]
	...
	[music]
		name="revelation.ogg"
	[/music]
	[event]
		name=prestart
		[music]
			name="battle.ogg"
			immediate=yes
			ms_after=2000
		[/music]
	[/event]
	[+event]
		[music]
			name="casualties_of_war.ogg"
			append=yes
		[/music]
	[/event]
	[+event]
		[music]
			name="knolls.ogg"
			append=yes
		[/music]
	[/event]
	[+event]
		[music]
			name="siege_of_laurelmor.ogg"
			append=yes
		[/music]
	[/event]
	[+event]
		[music]
			name="suspense.ogg"
			append=yes
		[/music]
	[/event]
	[+event]
		[music]
			name="the_city_falls.ogg"
			append=yes
		[/music]
	[/event]
Couldn't this have simply be declared as a one liner?

Code: Select all

[scenario]
	...
	music="revelation.ogg", "battle.ogg", "casualties_of_war.ogg", "knolls.ogg", "siege_of_laurelmor.ogg", "suspense.ogg", "the_city_falls.ogg"
This is just one example of many, but there are traces of verbose things that could be simple all over the place.

Tad_Carlucci
Developer
Posts: 317
Joined: April 24th, 2016, 4:18 pm

Re: Making a browser version of wesnoth?

Post by Tad_Carlucci » July 18th, 2018, 10:29 pm

Your replacement changed behavior by over-simplifying the problem.

You're trading maintainability and readability for a tiny improvement in parse/load time and file size.

That said, yes, WML is a mess. And, yes, Lua-only solution is better in some ways and worse in others.

The problem, as I see it, is that WML needs to be both a data-definition language (for cases like your example) and a Turing-complete procedural language. There are few, if any, examples of such languages.
I forked real life and now I'm getting merge conflicts.

enclave
Posts: 885
Joined: December 15th, 2007, 8:52 am

Re: Making a browser version of wesnoth?

Post by enclave » July 19th, 2018, 11:38 am

wml is too great for beginners.. wesnoth would have a lot less custom content if there was no WML... not many people are ready to programm straight into proper languages like lua.. most survivals etc would never happen.. well to be honest I probably wouldn't start making add-ons either (despite i was familiar with programming languages before). Well idk to be honest.. maybe if lua had great documentation and tons of examples then it would be a different story.

dagnelies
Posts: 9
Joined: June 2nd, 2018, 7:47 am

Re: Making a browser version of wesnoth?

Post by dagnelies » July 20th, 2018, 6:51 pm

...and why would we need a "Turing-complete procedural language"? I have the feeling that exactly this makes the WML needlessly complex. Every time I see for loops and such things in WML, I think it's something that should be inside the code, while instead providing a simple declarative tag for WML users.

That said, I understand there are times where you want to do something really specific, but it's also uncommon. Perhaps adding a simple tag like
[script]src=myscript.lua[/script]
would be more adequate for such cases. There, you could do fancy stuff, leveraging all programming constructs, while keeping the declarative WML simple & tidy.

Tad_Carlucci
Developer
Posts: 317
Joined: April 24th, 2016, 4:18 pm

Re: Making a browser version of wesnoth?

Post by Tad_Carlucci » July 21st, 2018, 12:28 am

Let me re-phrase your statement:
Why do we need Javascript? This is exactly what make web programming needlessly complex. Every time I see something like for loops and such in a web page, I think it's something that should be inside the browser, instead, providing a simple declarative HTML tag for web designers.
You need the Turing-complete language, like Lua, precisely because doing it in WML is such a pain. But, at the same time, you want that language to be a first-class citizen instead of an adopted child (like Javascript in a browser, or our use of Lua).

All this is, of course, a discussion for Wesnoth-NG because we can't drop what we now have unless we want to completely re-write all mainline campaigns and force all UMC to be completely re-written.

If you want to do a ground-up redesign of a browser-based Wesnoth-like game, have at it. But don't look to any Wesnoth assets for assistance. You might be able to scrape a few images but that's about it.
I forked real life and now I'm getting merge conflicts.

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

Re: Making a browser version of wesnoth?

Post by Pentarctagon » July 21st, 2018, 2:48 am

Tad_Carlucci wrote:
July 21st, 2018, 12:28 am
All this is, of course, a discussion for Wesnoth-NG because we can't drop what we now have unless we want to completely re-write all mainline campaigns and force all UMC to be completely re-written.
I think this was more or less what wesnoth2 was effectively proposing. IIRC the anura engine's scripting has a much clearer separation between structural elements and logic, though I also only briefly looked into it back when it was first brought up, and wesnoth2 at least is abandoned.
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
The_Gnat
Posts: 1603
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Making a browser version of wesnoth?

Post by The_Gnat » July 21st, 2018, 3:53 am

I personally think that this would be a good idea. It would take a lot of effort but if it could be ported I believe I know quite a few people who would be interested in playing it.

enclave
Posts: 885
Joined: December 15th, 2007, 8:52 am

Re: Making a browser version of wesnoth?

Post by enclave » July 21st, 2018, 12:57 pm

im not sure if there is a point to completely copy the WML into web version.. I think that's something that might be added with later development, after completely new web core is complete.
I understand it that making it fully identical means that you potentially could use all existing add-ons and maps/scenarios in web version without need to rewrite them, so by doing more work on cloning WML u could save work on rewriting scenarios.
But.. it will probably take ages and ages to copy WML into web as it is.. Maybe you could just do it semi-compatible? Like making a completely new web core, but keep basic WML tags (exclude the loops and macros at first and leave it for later development), this would probably make it work for most core maps/scenarios and maybe even some Campaigns since loops and macros are only used in advanced add-ons I think..
just my views :D

Post Reply