Use Chromium as a vessel to deliver warzone

For code related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Use Chromium as a vessel to deliver warzone

Post by aubergine »

This idea popped in to my head in another topic but it was very much off-topic there hence this new topic :)

The general concept is this:

Use a cross-platform, open source browser such as Chromium as a vessel for delivering warzone.

Warzone would effectively become a sort of 'web server' (for main computational stuff) and a 'browser plugin' (for the 3D in-game stuff) bundled with a tweaked Chromium browser (which from this point on I'll refer to as WZBrowser) that users download to their computer.

WZBrowser would have it's tabs, menus and other UI stuff that's not relevant to WZ hidden (that stuff could be displayed if WZBrowser is launched in developer mode).

When user loads WZBrowser, a default web page is shown - basically a HTML/JS version of the Main Menu. All of the standard screens in Warzone would be deployed this way - single player, multi-player, tutorial, options, etc. This would allow extreme customisation of all the 2D "screens" in WZ.

WZBrowser would make some useful objects/functions/etc, available to scripts running on the pages.

For example, an "options" object:

Code: Select all

// pseudo code

warzone.options = {
  game: {
    difficulty: <getter/setter>,
    scrollSpeed: <getter/setter>,
    .... etc ....
  },
  graphics: {...},
  video: {...},
  audio: {...},
  mouse: {...},
  keyboard: {...}
}
As you can see, all the various warzone settings in a handy object structure. The properties would all be getter/setter (accessor properties) - so any "web page" (eg. main menu or any other) could get or set a game setting. Instantly people can completely customise the way options work.

When it comes to launching a game (from a web page that lets the user set up the game), it's just a simple call to:

Code: Select all

warzone.newGame(
  map, // URL to map
  players[...], // an array of players and their starting positions
  NO_SCAVENGERS,
  LOW_OIL,
  CAMP_BASE,
  ALLIANCES_TEAMS
);
Warzone then displays a full-window browser plugin that delivers the 3D game to the user.

Scripts running during a game would be launched in their own browser tabs. This might seem insane at first, but consider that this allows, in developer mode (where tabs are visible to user), AIs and other scripts to render out status information as HTML. It lets the developer use Chromium's profiling and debugging tools and JS console on their scripts = much faster script development, debugging and tuning.

Furthermore, outside of a game, scripts could come with their own "set-up screens" (a web page showing options relevant to the script) allowing users to customise various script settings via a nice UI. Want to change the research path on that AI you've been playing against?

Now, a browser brings lots of other stuff to the table as well...

For example, a screen could display a custom view of the add-ons database at addons.wz2100.net and allow single click install/upgrade/uninstall. It could make it nice and easy for users to rate and comment on add-ons, directly from within WZBrowser.

Forums could be displayed directly within WZBrowser, the guide could be showin in WZBrowser. WZBrowser would be your one-stop-shop for all things warzone, blending seamlessly the stuff you've got on your local machine (the game itself) and online stuff (forums, addons, etc).

Browsers obviously have a herd of networking stuff built in - a ready made platform for replacing the current netcode?

WZBrowser would also need a "file server" bundling with it. I put that in quotes because actually it would be a very simple web server that is only capable of serving files up to WZBrowser, and enabling WZBrowser to save files to it. This would facilitate the way mods are handled, and storing of savegames, etc. It would do that sort of "mods overlay" thing - where a mod in my user directory sort of overrides files of the same name in the same folder locations in base.wz.

It sounds insane concept on first read. But have a think about it... it starts to make more and more sense IMHO.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Use Chromium as a vessel to deliver warzone

Post by aubergine »

Uhm, and browsers just happen to have plentiful support for video/audio playback too - including support for OGG (just drag any .ogg file in to a Google Chrome browser window to see it in action). So it would be trivial for people to play sounds and videos in the 2D part of the UI (menus, etc). Want a load of MP3's from your music library added to the background music? Just dump your mp3's in to the relevant folder and the browser will happily play them (I think - if not a flash plugin for playing mp3 is easy enough to create).

And, if it's possible to overlay html elements on top of the "warzone browser plugin" (basically the 3D bit of the game, as a plugin running in a web page) then all of the in-game UI (reticule buttons, research list, etc) could be customised via HTML/CSS/JS as well! Oooh, canvas support too...
Last edited by aubergine on 26 Jan 2012, 05:27, edited 1 time in total.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Use Chromium as a vessel to deliver warzone

Post by aubergine »

The "VAULT" feature I'm developing in my EggPlant AI (like a big data store of game and custom objects) could be rendered out as HTML in my AI's browser tab. I could then access info in that store using jQuery. I could bind events to HTML elements. It would be like a visual representation of my AI - insane, but so much potential to do crazy awesome stuff!
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Use Chromium as a vessel to deliver warzone

Post by lav_coyote25 »

so what all do you require. as long as it is warzone 2100 at the end of it all. then go ahead. sounds like it would be a hoot. :)
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Use Chromium as a vessel to deliver warzone

Post by Safety0ff »

Sounds like it would be bandwidth intensive with respect to transfering assets (e.g. if you clear your browser data regularly).
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Use Chromium as a vessel to deliver warzone

Post by aubergine »

It's not going to be pulling warzone, the menus, etc., from the internet all the time - all that stuff would still live in a base.wz, etc., bundled with the WZBrowser download. After downloading WZBrowser, you could disconnect from the internet and happily load the game, go through the menus, set up a skirmish and play against AIs.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Use Chromium as a vessel to deliver warzone

Post by cybersphinx »

Don't know much about it, but wouldn't the native client stuff work for that, instead of shipping a custom modified browser?
We want information... information... information.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Use Chromium as a vessel to deliver warzone

Post by aubergine »

What do you mean by "native client stuff" - are you referring to a vanilla built chromium, and then just deliver some sort of warzone pluign for it? I imagine that would work too, but it would likely be more cumbersome for end users, no?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Use Chromium as a vessel to deliver warzone

Post by cybersphinx »

We want information... information... information.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Use Chromium as a vessel to deliver warzone

Post by aubergine »

Uhm, in that case, Yes. I think... Maybe? I don't know.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Terminator
Regular
Regular
Posts: 1077
Joined: 05 Aug 2006, 13:46
Location: Ukraine
Contact:

Re: Use Chromium as a vessel to deliver warzone

Post by Terminator »

It would be very nice to make warzone_log like a battlelog for batlefield3. Similar - ESL web interface, but it doesn't need to be installed.
Death is the only way out... sh*t Happens !

Russian-speaking Social network Group http://vk.com/warzone2100
User avatar
Emdek
Regular
Regular
Posts: 1329
Joined: 24 Jan 2010, 13:14
Location: Poland
Contact:

Re: Use Chromium as a vessel to deliver warzone

Post by Emdek »

Forked web browser is bad idea, there are better or worse alternatives:
- create own simple web browser, for example using QtWebKit;
- use WebGL and other modern web technologies (example);
- create browser plugin.
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.


Beware! Mad Qt Evangelist.
Post Reply