Freeciv-Web WebGL/Three.js prototype

Web version of freeciv at play.freeciv.org
louis94
Hardened
Posts: 227
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Freeciv-Web WebGL/Three.js prototype

Postby louis94 » Sat Dec 17, 2016 2:09 pm

Memory usage is indeed lower (down to 700MB on my desktop). It's still too much for my tablet, though. (Intel Atom Z3560-based Android system with 2GB RAM and a PowerVR Rogue G6430 GPU.)

The two biggest objects are an array and an object, both around 150 MB. They are allocated during the map model generation, but I don't know much more (yet). The third one is a 100 MB ArrayBuffer, maybe the trees.

Louis

User avatar
AndreasR
Elite
Posts: 702
Joined: Thu May 02, 2013 10:26 pm
Location: Norway

Re: Freeciv-Web WebGL/Three.js prototype

Postby AndreasR » Sat Dec 17, 2016 8:18 pm

We really need to get the 3D WebGL version working on mobile devices with just 2GB RAM. There are lots of popular devices with 2GB RAM, such as most recent iPhone models. (It works on iPhone 7 plus which has 3GB RAM).
I have released a new version to the live server, could you please try it with your tablet? It reduces the map size on mobile devices to 1000 tiles - this should significantly reduce the RAM usage even more. In my test on a mobile device it just used 300MB.

Andreas

louis94
Hardened
Posts: 227
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Freeciv-Web WebGL/Three.js prototype

Postby louis94 » Sun Dec 18, 2016 12:37 am

AndreasR wrote:I have released a new version to the live server, could you please try it with your tablet?

Still crashing Firefox, but now Chrome too (don't know exactly since when) :(
Maybe it's because of x86 Android or the driver…

Louis

User avatar
AndreasR
Elite
Posts: 702
Joined: Thu May 02, 2013 10:26 pm
Location: Norway

Re: Freeciv-Web WebGL/Three.js prototype

Postby AndreasR » Tue Dec 20, 2016 5:54 am

Louis, could you please open about:crashes and get the crash id, then report the crash id here: https://bugs.chromium.org/p/chromium/is ... ?id=675479

Thanks!

louis94
Hardened
Posts: 227
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Freeciv-Web WebGL/Three.js prototype

Postby louis94 » Tue Dec 20, 2016 5:30 pm

AndreasR wrote:Louis, could you please open about:crashes and get the crash id, then report the crash id here: https://bugs.chromium.org/p/chromium/is ... ?id=675479

There is no crash id :(. Chrome crashes (or gets killed) as a whole, not just the webpage.
New info:
I restarted my device because of some processes that were using a lot of memory. Afterwards, I had 1GB of free memory (400MB before), which I assume should be enough to run the game… I played a few turns in Chrome (basically setting all units to autoexplore and hitting End Turn) before taking a look at Firefox. The game was very slow (seconds to move the map) and the browser finally crashed.

Louis

User avatar
AndreasR
Elite
Posts: 702
Joined: Thu May 02, 2013 10:26 pm
Location: Norway

Re: Freeciv-Web WebGL/Three.js prototype

Postby AndreasR » Wed Dec 21, 2016 9:28 pm

Image

I have released yet another update of the WebGL version. It uses less memory by loading flags on demand, and also fixes several bugs. Oh, and the 3D WebGL version made it to Slashdot.

Louis, I wonder if you could please try the latest version of Freeciv-web WebGL on your Arch Linux machine, and report the most important things that you think could be improved there?

Andreas

louis94
Hardened
Posts: 227
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Freeciv-Web WebGL/Three.js prototype

Postby louis94 » Thu Dec 22, 2016 12:11 am

If you see "b.data is undefined" errors in your logs, they're coming from my game. I didn't tweak anything.

The game is actually playable :). I miss rivers, borders and all the information the 2d renderer draws on the map. Oh, and fog of war too…
Just wondering: do planes take off or do they remain stuck on the ground?

I think the great job you did deserves a blog post.

Louis

User avatar
AndreasR
Elite
Posts: 702
Joined: Thu May 02, 2013 10:26 pm
Location: Norway

Re: Freeciv-Web WebGL/Three.js prototype

Postby AndreasR » Thu Dec 22, 2016 10:29 pm

>Just wondering: do planes take off or do they remain stuck on the ground?

The planes are pretty much stuck on the ground. Do you have a suggestion about how to improve it? Perhaps add a very distinct shadow to the air units?

I will try to focus on rivers, borders in 2017 then. 8-)

User avatar
AndreasR
Elite
Posts: 702
Joined: Thu May 02, 2013 10:26 pm
Location: Norway

Re: Freeciv-Web WebGL/Three.js prototype

Postby AndreasR » Fri Dec 23, 2016 8:42 pm

Louis, do you have any suggestions about how to implement rivers? It is quite hard to make the rivers look good.

User avatar
AndreasR
Elite
Posts: 702
Joined: Thu May 02, 2013 10:26 pm
Location: Norway

Re: Freeciv-Web WebGL/Three.js prototype

Postby AndreasR » Wed Jan 04, 2017 5:49 pm

Image

I've added support for multiple city sizes to the 3D WebGL version of Freeciv-web.