Hi again,

Sorry it took so long for me to get a chance to write this email. I
understand the desire to reuse the existing GUI client. A lot of time has
gone into it and it would be easier to build networking into an already
existing app than to start something new from scratch. However, I think this
is a short-term win at the cost of larger long term gains. Instead, I think
that if we agree on a JSON format that contains all the data the player can
know and we make it completely client agnostic then it will be a lot easier
to do things such as make an Android client or a web client or even bots. Or
make viewing games interactive, so watchers can look at inventory, explored
levels, etc. To that end, I think even putting code in show_map() is too
specific.

What I propose we do is:
1) Define a very strict format to describe game state
2) When the game state is changed (near the end of world_reacts() possibly?)
query all the different state objects to fill out that JSON blob and send it
over
3) Build an extremely light parser for that which can pass the data back to
the gui client or a website.

This way, we can spend some time agreeing on how #1 should look and then one
of us can focus on #2 while another focuses on #3.

This seems like it yields the best end result.

Thoughts?

-- Henry

On Wed, Mar 30, 2011 at 8:53 PM, Henry Cipolla <hcipo...@gmail.com> wrote:

> Jeff, I have notes and progress on this. Give me a couple hours and I will
> send something detailed.
> On Mar 30, 2011 8:32 PM, "Jeff Johnson" <jeffjohns...@gmail.com> wrote:
> > Hello All,
> >
> > I was looking into working on an online Tiles version somewhat according
> to
> > the ideas of henryci from his email on 2010-10-28. I've created a very
> > simple Javascript page here to test out some ideas:
> > http://dcssjsc.99k.org/Page1.htm
> >
> > All it does is parse some hard-coded JSON to display tiles in mostly the
> > correct locations. The current state of that page looks vaguely like a
> > starting Crawl screen. You may have to press a key or press the 'Get More
> > Data' screen to have it show the graphics.
> >
> > To get the JSON data, I hacked up some printf's into the TileBuffer.add()
> > function to get the data. My question is this: where's the right place to
> > put the printf()'s to get the GUI data?
> >
> > I'm thinking that I'd like this online version to match the GUI of the
> Tiles
> > version. Henryci suggested adding the data to viewmapcc::show_map(), but
> > that seems too high level and would mean recreating some of the Tiles GUI
> in
> > the JavaScript client. Also TileBuffer.add() seems too low level, as it
> > doesn't really have enough information about where the tile should be
> placed
> > (e.g. which layer, region location, etc). In my sample above, I made some
> > assumptions to get it to look right. I'd like to hear your suggestions as
> > my head is swimming in this code and getting nowhere. :)
> >
> > Best Regards,
> >
> > Jeff
>
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Crawl-ref-discuss mailing list
Crawl-ref-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/crawl-ref-discuss

Reply via email to