Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 6

Author Topic: Web Fortress  (Read 38560 times)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Web Fortress
« on: June 05, 2014, 09:12:35 am »

I had to try to do this:)
Proof of concept of a light-weight web interface with support for tilesets (but not creature graphics yet), grid resizing to follow browser window size, optimised updates and rendering of changed tiles only for near-native fps and low network traffic.
It's too early to share any binaries, and I want to sleep...



Home Page / Sources -- Latest Release -- Report an Issue

scamtank

  • Bay Watcher
    • View Profile
Re: Web Fortress
« Reply #1 on: June 05, 2014, 09:19:46 am »

oh god what the fuck are you a wizard.
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Web Fortress
« Reply #2 on: June 06, 2014, 10:34:00 am »

http://54.237.198.210:8888/webfort.html

Each visitor is given 15 minutes to play (or until network problem or 3 min idle), others wait in line and watching. Have no idea how many connections it can handle. Just reload page if want to skip turn. When you're playing, grid size adjusts for your browser window size, but not when you're watching, obviously.
Speed will greatly depend on your location in the world, the server is in US. Not tested in IE, but possibly will work, may have issues with key bindings. Refresh page if it's stuck on "loading...".

Will run until Monday or until crashes or something else :)

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Web Fortress
« Reply #3 on: June 06, 2014, 10:47:10 am »

I just get a red banner that says that is is "disconnected" across the top.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: Web Fortress
« Reply #4 on: June 06, 2014, 10:59:11 am »

We can now set up some arena fights live now!
I kinda jump into arena for a splint...
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

lethosor

  • Bay Watcher
    • View Profile
Re: Web Fortress
« Reply #5 on: June 06, 2014, 02:53:23 pm »

Wow. How did you manage to keep the client-side interface from lagging? (Edit: more specifically, are you rendering every tile in-browser or using raw screen data?) It even gets 3 FPS on mobile, something I've never managed with my own attempts. Can I steal implement this in Dfterm3 (and on the wiki)?
Also, how are you passing input to DF (assuming you're doing this on OS X)? I've tried implementing a SDL_PushEvent hook on OS X, but never managed to get it to work.
« Last Edit: June 06, 2014, 02:59:36 pm by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Barrow

  • Bay Watcher
    • View Profile
Re: Web Fortress
« Reply #6 on: June 06, 2014, 02:56:46 pm »

I would be very interested in getting my greasy mitts on this. It would also be really cool to see the source, if you're into that kind of thing.

Even if neither of the above happen, very cool project. Thanks for sharing it.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Web Fortress
« Reply #7 on: June 06, 2014, 03:20:18 pm »

I just get a red banner that says that is is "disconnected" across the top.
It's possible the data connection is being firewalled - you need to permit outgoing connections on port 1234.

Is there any way to specify a custom tileset (preferably one that's plain ASCII and not restricted to a particular aspect ratio)?
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: Web Fortress
« Reply #8 on: June 06, 2014, 05:01:10 pm »

kinda wish there's a chat for folks to use while using webfort
Wait this is built in with dfhack?
« Last Edit: June 06, 2014, 05:05:55 pm by Rumrusher »
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Walter Sullivan

  • Bay Watcher
    • View Profile
Re: Web Fortress
« Reply #9 on: June 06, 2014, 05:50:59 pm »

PTW.

This looks really awesome, great work! One of the features that I missed the most from dfterm was the tileset stuff(I like to play with the Jolly Bastion tileset) and you managed to create a program that is able to use tilesets, probably by using some kind of witchcraft or by sacrificing people in the name of Armok. And you are the same person who made the Text Will Be Text plugin. You can't be human.
Logged
"The man in black fled across the desert, and the gunslinger followed" - The Dark Tower

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Web Fortress
« Reply #10 on: June 06, 2014, 06:00:06 pm »

Wow. How did you manage to keep the client-side interface from lagging? (Edit: more specifically, are you rendering every tile in-browser or using raw screen data?) It even gets 3 FPS on mobile, something I've never managed with my own attempts. Can I steal implement this in Dfterm3 (and on the wiki)?
Also, how are you passing input to DF (assuming you're doing this on OS X)? I've tried implementing a SDL_PushEvent hook on OS X, but never managed to get it to work.

It's actually hard to tell the max possible FPS because it redraws only when there are changes, so the FPS meter is quite useless.
And that's the secret (plus some canvas optimisation) - I appreciate the work on dfterm3, but it's little bit crazy to send and draw entire screen every time..

This server is running on Windows, but on OS X PushEvent works just fine. I actually used dfterm3 code as a reference as I didn't work with SDL events before.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Web Fortress
« Reply #11 on: June 06, 2014, 06:13:51 pm »

I'll soon publish the sources and shut down the server next week (it's a paid server which is fine for several days but not longer).
The thing is that I needed my previous two plugins to play comfortably myself, but I'm not so interested personally in playing remotely.

I'll possibly try to add a chat and also to spawn several DF processes to run several games at once (that would be really fun I think and only a question of server resources). But then I don't think I'll have time to work on this.

Adeon

  • Bay Watcher
  • Obey.
    • View Profile
Re: Web Fortress
« Reply #12 on: June 07, 2014, 05:43:01 am »

Eep, credible competition. I guess I have to start developing again.

Dfterm3 doesn't send all the screen data every frame. The plugin and server do that between themselves but the communication is 100% local so it doesn't really matter. I expect that the bandwidth usage between server and the browser is low in Dfterm3.

Of course we at Dfterm3 HQ will happily steal and plunder study how you manage the tiles themselves once you release the code.
Logged
I make dead people. Dfterm3

Reelya

  • Bay Watcher
    • View Profile
Re: Web Fortress
« Reply #13 on: June 07, 2014, 05:52:55 am »

I know it wouldn't be possible to have a true multi-player dwarf fortress, but would it be possible for one player to be using the main screen whilst someone else can e.g. change dwarfs job placements via a different interface?

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Web Fortress
« Reply #14 on: June 07, 2014, 07:15:55 am »

Dfterm3 doesn't send all the screen data every frame. The plugin and server do that between themselves but the communication is 100% local so it doesn't really matter. I expect that the bandwidth usage between server and the browser is low in Dfterm3.

Oh sorry then. Anyway I'm a fan of minimalist solutions and using information about changed tiles that DF already provides to its renderer seems to be more natural and fast solution then transferring entire screen (well, locally but it's still encoding/decoding, etc.) and finding changes manually.
It just requires hacking into the renderer which is not part of dfhack, but because I did that anyway for twbt, I decided to write this thing.

Of course we at Dfterm3 HQ will happily steal and plunder study how you manage the tiles themselves once you release the code.

But you can look at html page you get in browser even before I publish sourced for server side. There's nothing else except the webpage and a dfhack plugin responding to several commands/sending screen data.
Pages: [1] 2 3 ... 6