Author Topic: WebGL soldat map renderer  (Read 10255 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: 5033
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: 5033
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: 5033
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: 1907
    • 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."

Offline themangokid

  • Major(1)
  • Posts: 11
Re: WebGL soldat map renderer
« Reply #20 on: March 08, 2015, 03:40:15 pm »
awesome!!! :D!! more of this:)

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5033
Re: WebGL soldat map renderer
« Reply #21 on: March 08, 2015, 07:58:29 pm »
http://soldat.thd.vg/en/gather << this "still exists". :P

Except that "web app" I made with MM in ~2010 no longer has the soldat servers or the backend daemons running.
There are other worlds than these

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1907
    • TransHuman Design
Re: WebGL soldat map renderer
« Reply #22 on: March 09, 2015, 04:49:34 am »
http://soldat.thd.vg/en/gather << this "still exists". :P

Except that "web app" I made with MM in ~2010 no longer has the soldat servers or the backend daemons running.
Hence quotes around "still exists". I wasn't sure if it's even playable. And btw, you have been working on it with me. I was your alpha/beta tester. :P
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #23 on: March 09, 2015, 11:35:02 am »
The map viewer now has some options to switch scenery, polygons, wireframe, etc

http://urraka.github.io/soldat-map/

I also have in mind adding options to highlight specific polygon types (deadly, etc) and to show objects (spawn points, flags, etc).

By the way, anyone knows what the "active" field means in the PMS format? (check here http://wiki.soldat.pl/index.php/Map). Some structs like PMS_PROP have this field. Should I not render stuff that is not "active"?
urraka

Offline duz

  • Flagrunner
  • ****
  • Posts: 586
  • Old nick: HunterZ
Re: WebGL soldat map renderer
« Reply #24 on: March 09, 2015, 12:40:15 pm »
The map viewer now has some options to switch scenery, polygons, wireframe, etc

http://urraka.github.io/soldat-map/

I also have in mind adding options to highlight specific polygon types (deadly, etc) and to show objects (spawn points, flags, etc).

By the way, anyone knows what the "active" field means in the PMS format? (check here http://wiki.soldat.pl/index.php/Map). Some structs like PMS_PROP have this field. Should I not render stuff that is not "active"?


How hard is to put a player with the same Soldat movement, 3 weapons (auto, m79, barret) +secondary and the network things?
2002-2007 / 2009-2012
HunterZ The Movie I / II / III
Awards

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #25 on: March 09, 2015, 12:49:47 pm »
How hard is to put a player with the same Soldat movement, 3 weapons (auto, m79, barret) +secondary and the network things?

VERY hard :)
urraka

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5033
Re: WebGL soldat map renderer
« Reply #26 on: March 09, 2015, 03:41:10 pm »
How hard is to put a player with the same Soldat movement, 3 weapons (auto, m79, barret) +secondary and the network things?

VERY hard Challenge accepted. :)

Fixed that for you :P
There are other worlds than these

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #27 on: March 09, 2015, 05:01:01 pm »
Haha very funny. I think it would be easier to find a way to compile soldat source to javascript. It's a trend to compile things to javascript these days.

On a different note, mr. %%%%%% noted me that the wireframe mode is barely visible when polygon texture is disabled, so I made it render darker when texture is unchecked.


Edit: added options to highlight specific polygon types
« Last Edit: March 09, 2015, 07:17:06 pm by PerroAZUL »
urraka

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #28 on: March 10, 2015, 08:47:07 pm »
Added options to switch colliders and object spawns http://urraka.github.io/soldat-map/

Only thing missing is the bot waypoints, but it doesn't sound like a very useful thing.
urraka


Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: WebGL soldat map renderer
« Reply #30 on: April 02, 2015, 03:58:03 pm »
Bit of a bump. Hi.

I did the heatmap stuff a looong while back for #soldat.realistic. Since that site won't be online for much longer, here's a generated image for posterity's sake.

If anybody wants to play around with some data for heatmaps or the like, I've attached a CSV with about five million game events. Columns are map, event, team, x, y, weapon. Feel free to do whatever you like with it.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #31 on: April 02, 2015, 08:39:26 pm »
That's pretty cool, I might try something with that stuff later. Thanks for the data!
urraka

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5033
Re: WebGL soldat map renderer
« Reply #32 on: April 02, 2015, 09:18:54 pm »
Bit of a bump. Hi.

I did the heatmap stuff a looong while back for #soldat.realistic. Since that site won't be online for much longer, here's a generated image for posterity's sake.

If anybody wants to play around with some data for heatmaps or the like, I've attached a CSV with about five million game events. Columns are map, event, team, x, y, weapon. Feel free to do whatever you like with it.

Knew it was you! Thanks for those links.

Also, welcome back. xD

Also also, I'll give you free web hosting to keep that online. That's cool as hell.
« Last Edit: April 02, 2015, 09:22:24 pm by jrgp »
There are other worlds than these

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: WebGL soldat map renderer
« Reply #33 on: April 03, 2015, 03:24:36 pm »
If anybody wants to play around with some data for heatmaps or the like, I've attached a CSV with about five million game events. Columns are map, event, team, x, y, weapon. Feel free to do whatever you like with it.

In addition to this, here is an attachment with same data in a format of SQLite database.

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Macellan
Re: WebGL soldat map renderer
« Reply #34 on: April 17, 2015, 04:57:10 am »
That's a lot of hard work, great. So what is next, web based Soldat game? :P
CoFounder / CTO @ Macellan
Founder Turkish Soldat Community

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: WebGL soldat map renderer
« Reply #35 on: April 17, 2015, 08:12:39 am »
That's a lot of hard work, great. So what is next, web based Soldat game? :P

I'm almost there! http://urraka.github.io/estampida/


(not really)
urraka