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

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
afwbkbc
Pupating Mass
Posts: 96
Joined: Tue Mar 14, 2017 10:47 am

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

#1 Post by afwbkbc » Fri Apr 07, 2017 1:22 pm

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.

L29Ah
Space Floater
Posts: 37
Joined: Thu Oct 06, 2016 3:19 pm

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

#2 Post by L29Ah » Fri Apr 07, 2017 1:35 pm

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.
Team S.M.A.C.: play multiplayer with us!

User avatar
afwbkbc
Pupating Mass
Posts: 96
Joined: Tue Mar 14, 2017 10:47 am

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

#3 Post by afwbkbc » Fri Apr 07, 2017 5:03 pm

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.

o01eg
Space Kraken
Posts: 166
Joined: Sat Dec 10, 2011 5:46 am

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

#4 Post by o01eg » Fri Apr 07, 2017 5:07 pm

You are welcome to implement it.
Gentoo Linux x64, gcc-7.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.3, boost-1.65.1
Welcome to multiplayer server at freeorion-test.dedyn.io.Version 0.4.8
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
afwbkbc
Pupating Mass
Posts: 96
Joined: Tue Mar 14, 2017 10:47 am

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

#5 Post by afwbkbc » Sat Apr 08, 2017 7:54 pm

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.

User avatar
Vezzra
Release Manager, Design
Posts: 4657
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

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

#6 Post by Vezzra » Sun Apr 09, 2017 8:54 am

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.

User avatar
afwbkbc
Pupating Mass
Posts: 96
Joined: Tue Mar 14, 2017 10:47 am

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

#7 Post by afwbkbc » Sun Apr 09, 2017 10:00 am

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?

User avatar
Vezzra
Release Manager, Design
Posts: 4657
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

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

#8 Post by Vezzra » Sun Apr 09, 2017 10:44 am

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...?

jollasims
Space Krill
Posts: 1
Joined: Fri Aug 25, 2017 7:04 pm

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

#9 Post by jollasims » Fri Aug 25, 2017 7:26 pm

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.

o01eg
Space Kraken
Posts: 166
Joined: Sat Dec 10, 2011 5:46 am

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

#10 Post by o01eg » Sat Aug 26, 2017 9:21 am

There are possible to write web-server-2-freeorion-client proxy same way it done in freeciv-web.
Gentoo Linux x64, gcc-7.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.3, boost-1.65.1
Welcome to multiplayer server at freeorion-test.dedyn.io.Version 0.4.8
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

Ophiuchus
Vacuum Dragon
Posts: 539
Joined: Tue Sep 30, 2014 10:01 am

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

#11 Post by Ophiuchus » Mon Aug 28, 2017 10:03 am

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.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
The Silent One
Graphics
Posts: 712
Joined: Tue Jul 01, 2003 8:27 pm

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

#12 Post by The Silent One » Mon Aug 28, 2017 6:58 pm

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 :)
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

Post Reply