Page 1 of 1

Let's move freeorion from C to HTML5/JS/Canvas/WebSockets

Posted: Fri Apr 07, 2017 1:22 pm
by afwbkbc
So, why not?
I clearly see numerous advantages of this:
1) no need to compile, just download and play
2) freeorion client can be ran from external webserver, so no need to even download
3) crossplatformity/portability guaranteed by browsers
4) FPS increase (canvas is really fast in modern browsers, unlike current UI)
5) no need to have ugly python scripts and having to parse them in C - loading js script by js engine is dead simple
6) development speed increase (js is simpler language, also no need to recompile = huge boost)
7) no memory bugs will be possible anymore (only if there's bug in browser, but it will be fixed by browser maintainers anyway)
8) easier to participate in development for newcomers (js is easier to use)

Disadvantages?
1) some initial effort needed to migrate

So, let's discuss.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Fri Apr 07, 2017 1:35 pm
by L29Ah
afwbkbc wrote:4) FPS increase (canvas is really fast in modern browsers, unlike current UI)
6) development speed increase (js is simpler language, also no need to recompile = huge boost)
Good joke // fuck off.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Fri Apr 07, 2017 5:03 pm
by afwbkbc
L29Ah wrote:
afwbkbc wrote:4) FPS increase (canvas is really fast in modern browsers, unlike current UI)
6) development speed increase (js is simpler language, also no need to recompile = huge boost)
Good joke // fuck off.
Please be constructive.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Fri Apr 07, 2017 5:07 pm
by o01eg
You are welcome to implement it.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Sat Apr 08, 2017 7:54 pm
by afwbkbc
o01eg wrote:You are welcome to implement it.
There is no point to implement it until core developers agree to move this path. If freeorion-js will have to be constantly patched to match updates in C or python scripts (forever) - maintenance overhead will easily outweight the benefits. So, I need developers' assurance that they will consider continuing development in js (and drop C/python) after its implemented initially.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Sun Apr 09, 2017 8:54 am
by Vezzra
afwbkbc wrote:There is no point to implement it until core developers agree to move this path.
The lack of any comments by said core devs should already give an indication about how seriously they take this proposal.

Without going into detail wrt to all the points you see as advantages (judging by your past ideas and the following discussions you very obviously assess things very differently than the rest of us does), I'm only going to refer to this: you practically ask us to throw out the entire codebase and reimplement everything from scratch in another programming language. The effort of which you assume to be:
afwbkbc wrote:some initial effort needed to migrate
Which, IMHO, is so far out of touch with reality it isn't funny anymore. Some initial effort - seriously???

So, to spare you wasting your time: not going to happen. Sorry.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Sun Apr 09, 2017 10:00 am
by afwbkbc
you practically ask us to throw out the entire codebase and reimplement everything from scratch
Not really. Existing codebase already have all algorithms and game logic ready, we just need to copy these algorithms and logic to js (so no need to invent or design anything). Well, maybe there are some exceptions, but overall copying existing product is far easier than creating something out of nothing.
And there are lots of C++ to JS compilers available which we can use for initial migration.
And we can also reuse all existing art and sounds, which saves TONS of time.
Some initial effort - seriously???
Well, maybe a week.
Let's imagine I do it, will we continue developing (new features, etc) on JS after that?

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Sun Apr 09, 2017 10:44 am
by Vezzra
afwbkbc wrote:Existing codebase already have all algorithms and game logic ready, we just need to copy these algorithms and logic to js
You essentially want to convert FO into a browser game. Implementation something as a browser app is, let's say, somewhat different from implementing the same thing as a traditional C program. So "just need to copy these algorithms and logic to js" probably isn't going to cut it - at all.

I expect you to diagree on that assessment, but I guess we'll have to settle for agreeing to disagree at this point.
And there are lots of C++ to JS compilers available which we can use for initial migration.
I don't think they'll work for a program as complex as FO.
And we can also reuse all existing art and sounds, which saves TONS of time.
Even if we had to, these would be the least of my concerns.
Well, maybe a week.
A week. You seriously expect we could turn FO into a browser game within a week. Don't be offended, but... to me that sounds utterly insane.

To put it more mildly: I think your estimation to be far off the mark.
Let's imagine I do it, will we continue developing (new features, etc) on JS after that?
Well, a long answer would require discussing the various points you list in favor of such a change, and seeing how far different our assessments are on already quite simple things I don't have the time and nerves to go through that with you. I already know the outcome: we'll have to agree to disagree. So I'm just giving the short answer: no. If anyone of the core devs disagrees with my decision, they may speak up. Not that I expect any of them to actually do that...

Just a simple question, out of curiosity: you do know that there are a lot of applications/programs out there (actually, AFAIK, it's the majority), which are not implemented as browser apps in HTML5/JS, right? If you believe JS to be so universally superior, have you ever wondered why...?

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Fri Aug 25, 2017 7:26 pm
by jollasims
Have to agree with Vezzra that there has to be a consensus among core developers to migrate the project. But I agree with you that JS has a lower leaning curve than C and maybe more developers can contribute to the project. However, just because a language is inherently easier does not make it inherently good.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Sat Aug 26, 2017 9:21 am
by o01eg
There are possible to write web-server-2-freeorion-client proxy same way it done in freeciv-web.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Mon Aug 28, 2017 10:03 am
by Ophiuchus
I dont think it makes sense to reimplement freeorion server in js.

That said it would be a nice project for somebody learning programming the web stack to implement a freeorion client in html/js.
(I also understand that none of the current devs would work on it.)

The main project maybe would need to work on the communication protocol between client and server, but that probably would be a good thing.

One could start without graphics but giving only a minimal or textual representation.
  1. connect with freeorion server
  2. get the client gamestate and show some info (or other empire wide info like PP/RP)
  3. show the research queue
  4. list the systems and their planets and their info
  5. add some actions
  6. make it complete ;)
another even smaller project which would be very useful could be a html interface for the encyclopedia, we could put it on the project homepage, or one could use a tab next to the computer to look up stuff.

@afwbkbc are you interesting in learning programming? (or you know someone who is?) you could team up with one of your buddys and start this as a project. I/we could help with the connection to the server and you might find a local hacker space or programming meetup for guidance.

Re: Let's move freeorion from C to HTML5/JS/Canvas/WebSocket

Posted: Mon Aug 28, 2017 6:58 pm
by The Silent One
Ophiuchus wrote:@afwbkbc are you interesting in learning programming? (or you know someone who is?) you could team up with one of your buddys and start this as a project. I/we could help with the connection to the server and you might find a local hacker space or programming meetup for guidance.
afw... is a troll who was banned afaik. He only made mock proposals and never contributed anything of value. Don't waste your time on him :)