Author Topic: WebGL soldat map renderer  (Read 14723 times)

0 Members and 1 Guest are viewing this topic.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
WebGL soldat map renderer
« on: March 06, 2015, 04:47:40 pm »
I was really bored so I did a webgl map renderer:

http://urraka.github.io/soldat-map/#ctf_Ash
http://urraka.github.io/soldat-map/#Airpirates
http://urraka.github.io/soldat-map/#Cambodia

All the default maps are uploaded there for testing, just change the name in the URL.

Source code is here: https://github.com/urraka/soldat-map
urraka

Offline %%%%%%%

  • Soldier
  • **
  • Posts: 205
Re: WebGL soldat map renderer
« Reply #1 on: March 06, 2015, 06:04:01 pm »
Cool, cool, cool.

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5036
Re: WebGL soldat map renderer
« Reply #2 on: March 06, 2015, 08:51:47 pm »
You forgot making scroll wheel zoom in and out. Good otherwise.
There are other worlds than these

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #3 on: March 06, 2015, 10:05:17 pm »
You forgot making scroll wheel zoom in and out. Good otherwise.

You can still zoom in and out with +/- keys. My mouse wheel is always broken so I don't bother to think about it anymore...


Edit: ok, I added mouse wheel for zooming now (hopefully it's not backwards)
« Last Edit: March 06, 2015, 10:53:42 pm by PerroAZUL »
urraka

Offline Bistoufly

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 782
Re: WebGL soldat map renderer
« Reply #4 on: March 07, 2015, 01:00:36 am »
Awesome!

Offline homerofgods

  • Soldat Beta Team
  • Rainbow Warrior
  • ******
  • Posts: 2029
  • We can do better!
Re: WebGL soldat map renderer
« Reply #5 on: March 07, 2015, 04:11:59 am »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: WebGL soldat map renderer
« Reply #6 on: March 07, 2015, 05:57:20 am »
This is quite, well, awesome, as others have said! This reminds me of when I wanted to make a heatmap of where people die or kill, among other things. I still find the idea fascinating.

I see zooming convention be different between programs. I personally like the way zooming is, but I think that is the less common convention of the two conventions (may be I am wrong here?).

Offline Moroes

  • Soldier
  • **
  • Posts: 165
    • Soldat-Game.eu
Re: WebGL soldat map renderer
« Reply #7 on: March 07, 2015, 07:10:57 am »
More than a map preview. Brilliant!
I'd love a switch to polygon view and spawns/flags but this is good enough :D. PW can do the rest.

BTW: Zooming with scroll wheel works just fine.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #8 on: March 07, 2015, 08:48:56 am »
This reminds me of when I wanted to make a heatmap of where people die or kill, among other things.

That's a very interesting idea indeed

I'd love a switch to polygon view and spawns/flags

With "switch to polygon view" do you mean to show only polygons? or some kind of wireframe mode?
urraka

Offline Izzy Rose (PL)

  • Soldier
  • **
  • Posts: 118
  • I am tank! Get out my way!
Re: WebGL soldat map renderer
« Reply #9 on: March 07, 2015, 11:19:31 am »
This awesome thing can be used for map databases to make them more comfortable to use! No more test-downloading maps due to shitty preview screenshot! :D
Ingame known as just Izzy
[Barret]/
+

Offline Fawkzy

  • Major(1)
  • Posts: 36
  • :^)
Re: WebGL soldat map renderer
« Reply #10 on: March 07, 2015, 01:57:54 pm »
this is truly sexy

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5036
Re: WebGL soldat map renderer
« Reply #11 on: March 07, 2015, 07:23:38 pm »
This reminds me of when I wanted to make a heatmap of where people die or kill, among other things.

That's a very interesting idea indeed

Someone did that for one of the gather communities a long time ago. Something makes me feel Toumaz was involved.

Edit: ok, I added mouse wheel for zooming now (hopefully it's not backwards)

Perfection. Now it's as good as browsing with Polyworks.

With "switch to polygon view" do you mean to show only polygons? or some kind of wireframe mode?

Open Polyworks and look at the little window with the checkboxes that determine how to render the map. You can choose between full polygons rendered with texture (how your web app currently is), polys without texture but with shading, polys without shading or texture which is just wireframe which is probably what Moroes is asking.

Also, Could you add some sort of progress bar for loading the map elements? Staring at a black screen for a few seconds while the map loads is less than ideal.

Additionally, put the PMS filename in the <title> tag so it's easy to discern a bunch of tabs open at once.

Another edit: now that I've played with it for a bit, can you make it so zooming in uses the position of the mouse cursor?
« Last Edit: March 07, 2015, 07:30:13 pm by jrgp »
There are other worlds than these

Offline Puure

  • Major
  • *
  • Posts: 68
Re: WebGL soldat map renderer
« Reply #12 on: March 07, 2015, 07:33:13 pm »
wtf? empty links..

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5036
Re: WebGL soldat map renderer
« Reply #13 on: March 07, 2015, 08:08:11 pm »
wtf? empty links..

If you're talking about the black screen, you have to wait a few seconds for the map to load, fuckstick.
There are other worlds than these

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #14 on: March 07, 2015, 11:31:42 pm »
Also, Could you add some sort of progress bar for loading the map elements? Staring at a black screen for a few seconds while the map loads is less than ideal.

Additionally, put the PMS filename in the <title> tag so it's easy to discern a bunch of tabs open at once.

There's a loading indicator now, and the map name shows in the title.

I'll play with the zoom stuff tomorrow and maybe I'll work on adding some switches to show/hide stuff like PolyWorks does.

wtf? empty links..

Also note that this stuff won't work on shitty old browsers. I only tried it on Chrome and Firefox. Internet Explorer has a long history of being shitty so I wouldn't be surprised if it doesn't work there. I don't have the newer one so I can't really tell though.


Edit: did the zoom to cursor position stuff already
« Last Edit: March 08, 2015, 01:21:46 am by PerroAZUL »
urraka

Offline Moroes

  • Soldier
  • **
  • Posts: 165
    • Soldat-Game.eu
Re: WebGL soldat map renderer
« Reply #15 on: March 08, 2015, 02:49:53 am »
Yes, jrgp is right. I'd love a wireframe showing the map structure in a well arranged way. Polygons should be coloured according to their types (normal, deadly etc.)
Something like this: https://db.tt/MKA5mYtd

Zooming is even better now and map loading is sexy. It loads even the biggest "maps".  :D
http://morko.cz/#rce_freetime

Got just one problem. Fancy climb maps are always black. Doesn't it load textures of size of hundreds of kBs, or is it a server/filename problem?
http://morko.cz/#SS_Juice
http://morko.cz/#ctf_vir_coop10

I am attaching the map files in case you wanna test that.

Thanks much for the renderer ;)

Offline Puure

  • Major
  • *
  • Posts: 68
Re: WebGL soldat map renderer
« Reply #16 on: March 08, 2015, 08:04:38 am »
If you're talking about the black screen, you have to wait a few seconds for the map to load, fuckstick.
I have white screen xDDD

Also note that this stuff won't work on shitty old browsers. I only tried it on Chrome and Firefox. Internet Explorer has a long history of being shitty so I wouldn't be surprised if it doesn't work there. I don't have the newer one so I can't really tell though.
I'm using Firefox :p

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #17 on: March 08, 2015, 09:31:24 am »
Got just one problem. Fancy climb maps are always black. Doesn't it load textures of size of hundreds of kBs, or is it a server/filename problem?

Yesterday I noticed some maps would fail to load because the file name casing in the PMS was different from the real file. So I renamed all images to lowercase and made it always load as lowercase. A bit hacky but just wanted to make it to work. Blame windows file system for not being case sensible.. Anyway, I thought that could be the problem there but I just noticed it's something else. Looks like WebGL requires power of two sizes for textures that have a repeat wrapping. Still, if you try custom maps make sure all the image files are lowercase until I figure out a better way to fix that.

Btw, if you have access to a bash console in your server you can use commands like this to rename images to lowercase:

Code: [Select]
cd soldat-map/data
find scenery-gfx/ -name '*[A-Z]*' | while read f; do lc=$(echo "${f}" | tr A-Z a-z); mv "$f" "$lc"; done
find textures/ -name '*[A-Z]*' | while read f; do lc=$(echo "${f}" | tr A-Z a-z); mv "$f" "$lc"; done

I'm using Firefox :p

Well, first I would make sure that WebGL actually works on your end. You can test that here https://get.webgl.org/.

If that works fine you can try checking for errors in the map renderer. Just open the console (ctrl+shift+k) and see if there is some message in there. If there's nothing refresh (with the console open), and check again just to make sure.


Edit: fixed the power of two problem
« Last Edit: March 08, 2015, 09:59:14 am by PerroAZUL »
urraka

Offline duz

  • Flagrunner
  • ****
  • Posts: 586
  • Old nick: HunterZ
Re: WebGL soldat map renderer
« Reply #18 on: March 08, 2015, 12:27:48 pm »
http://web.soldat.pl - Now you can play Soldat using your browser, like Quake Live.


Oh, no. It's a dream :(
2002-2007 / 2009-2012
HunterZ The Movie I / II / III
Awards

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: WebGL soldat map renderer
« Reply #19 on: March 08, 2015, 03:24:21 pm »
http://soldat.thd.vg/en/gather << this "still exists". :P
"My senses are so powerful that I can hear the blood pumping through your veins."