Which Frontend Technology for an Online Game of Risk? SVG Maps?

Discussion in 'Ruby' started by Mariano Kamp, Aug 21, 2006.

  1. Mariano Kamp

    Mariano Kamp Guest

    Hi,

    I am currently *thinking* about implementing a Risk, the boardgame,
    clone. It should work in a browser and I wonder what would be the best
    approach to implement the frontend?

    I guess I could go for image maps, which would work in many browsers,
    but then the game would lack interactivity.

    A Java Applet would be another alternative, but Java is not ubiquitous
    and more importantly it cannot talk to the embedding webpage. At least
    afaik?

    I am thinking along the lines of XHTML/Javascript and SVG. I might be
    wrong, but after playing with this combination for a short time it seems
    to me, that SVG is scriptable and it plays well with the embedding page.
    Of course SVG is even less wide spread then Java, but one can always
    hope for the future.
    I would start with the Firefox 1.5 implementation and probably use the
    Adobe SVG Viewer as an alternative.

    On a related note. How would you start to build/gather the SVG maps? I
    had a look at the ones returned by google, but the maps were usually
    hugh (talking multiple megabytes here -
    http://upload.wikimedia.org/wikipedia/commons/4/4d/BlankMap-World.svg)
    and also lack containers that a) identify which country they describe
    inside the complete SVG and b) don't seem to be scriptable. I can't put
    onmouseover etc. on a path, can I?

    Any comments would be highly appreciated.

    Cheers,
    Mariano
    Mariano Kamp, Aug 21, 2006
    #1
    1. Advertising

  2. Look into the Flex 2 sdk. It's free, and with Apollo scheduled for
    release next year, your browser game could move to a desktop app.
    While Adobe hasn't released the v.9 Flash player for linux yet it's
    trivial to get Firefox running under Wine with the v9 plugin.

    As for a map to use in Flex, I haven't tried it, but you could look at:

    http://backspace.com/mapapp/

    Since you mentioned Javascript:

    http://backspace.com/mapapp/javascript.html
    Richard Lyman, Aug 21, 2006
    #2
    1. Advertising

  3. Mariano Kamp

    grrr Guest

    On Mon, 21 Aug 2006 23:07:10 +0900, Mariano Kamp wrote:

    > Hi,
    >
    > I am currently *thinking* about implementing a Risk, the boardgame,
    > clone. It should work in a browser and I wonder what would be the best
    > approach to implement the frontend?


    SVG is a very good choice with Ruby, since Ruby has a very nice SVG class
    implementation http://raa.ruby-lang.org/project/ruby-svg - Thank you Yuya!

    Let me know how it goes, I'm practicing my ruby-generated SVG moves.

    SVG can be animated much like flash, too...

    Grrr
    grrr, Aug 23, 2006
    #3
  4. Mariano Kamp

    Mariano Kamp Guest

    Well, yes, I forgot to state another constraint ... I don't know flash
    and emotionally ;-) I don't want to go there ... ;-)

    I am still wondering how to kickstart the maps. I haven't found any
    simple svg maps to reuse and am not sure how to draw some myself.

    How does one start out to draw a map? By transforming geographical
    data? Which data? Or by putting a real map below a canvas in a drawing
    program?

    Regarding ruby-svg... Did you use it? My japanese is not that good ;-(
    It was created/last updated in 2002/2003? Do you know if it is still
    maintained?

    I was more thinking along the lines of using an ordinary xml builder.
    I am not so sure what a library could add on top of that?

    Mariano

    On 8/23/06, grrr <> wrote:
    > On Mon, 21 Aug 2006 23:07:10 +0900, Mariano Kamp wrote:
    >
    > > Hi,
    > >
    > > I am currently *thinking* about implementing a Risk, the boardgame,
    > > clone. It should work in a browser and I wonder what would be the best
    > > approach to implement the frontend?

    >
    > SVG is a very good choice with Ruby, since Ruby has a very nice SVG class
    > implementation http://raa.ruby-lang.org/project/ruby-svg - Thank you Yuya!
    >
    > Let me know how it goes, I'm practicing my ruby-generated SVG moves.
    >
    > SVG can be animated much like flash, too...
    >
    > Grrr
    >
    >
    >
    Mariano Kamp, Aug 24, 2006
    #4
  5. A colleague pointed me to a real nice open-source vector graphics
    package: InkScape.

    On 8/24/06, Mariano Kamp <> wrote:
    > I am still wondering how to kickstart the maps. I haven't found any
    > simple svg maps to reuse and am not sure how to draw some myself.
    >
    > How does one start out to draw a map? By transforming geographical
    > data? Which data? Or by putting a real map below a canvas in a drawing
    > program?


    In InkScape I believe there is a feature where you can import a standard
    graphic and *vector-ize* it, which would solve your map-drawing problem.
    Richard Conroy, Aug 24, 2006
    #5
  6. Mariano Kamp

    Phrogz Guest

    Mariano Kamp wrote:
    > I am still wondering how to kickstart the maps. I haven't found any
    > simple svg maps to reuse and am not sure how to draw some myself.


    If you have Adobe Illustrator and can find free maps in any vector
    format (eps, ai, pdf, etc.) you can open them in Illustrator and save
    them as SVG files.


    > I was more thinking along the lines of using an ordinary xml builder.
    > I am not so sure what a library could add on top of that?


    Having used the ruby svg library only a little bit, a while ago, my
    impression is that it adds convenient classes for common shapes and svg
    entities. For example, the <circle .../> element legally has cx, cy,
    and r properties in SVG; the SVG library provides convenient accessor
    methods for those properties, implicitly preventing you from adding
    attributes that are not included in the schema. Using REXML directly
    would give you no such nice framework.

    It's not a terribly robust SVG library, IMO. For example, it makes no
    attempt to provide convenient interface for describing a complex path,
    instead providing only raw access to the 'd' attribute. Still, it's a
    little better than nothing. (Personally, I wish its classes inherited
    from REXML element, providing all the rich flexibility of REXML for
    managing the document as may be needed.
    Phrogz, Aug 24, 2006
    #6
  7. Mariano Kamp wrote:
    > Well, yes, I forgot to state another constraint ... I don't know flash
    > and emotionally ;-) I don't want to go there ... ;-)


    If you look past the bad rap and the reputedly Notte Very Neat API,
    Flash is still, by far, the most reliable way to get a contained
    rich-client -ish application to run in a webbrowser. Especially if it
    involves any form of multimedia. I'd go there if you don't absolutely
    need to talk to the surrounding webpage. (iSketch is one of the most
    addictive in-webbrowser games I ever played for example, and I honestly
    have no idea just how you could do that using only AJAX without severe lag.)

    Animated SVG to me seems to have pretty much the same potential to
    create obnoxious ads as Flash does, comparatively little actual
    functionality you could use, except it's probably larger to download and
    more CPU intensive to process (being XML-based and all). Except it's W3C
    approved, therefore Good and Holy, and more likely to have various
    fanboys ranting for than against it.

    Bottom line: use what will work. A *lot* of people have Flash installed.
    Probably more so than have a SVG-enabled web browser - cf. the still
    majority of IE6 users. And as was already mentioned, the lagging Linux
    support can be worked around, and that's something anyone that wants to
    play any games on Linuxen has to be used to by now anyway.

    David Vallner
    David Vallner, Aug 24, 2006
    #7
  8. Just to clarify - don't use Flash - use Flex. Yes, they both produce
    SWFs, yes they are both 'controlled' by Adobe - but if you haven't
    looked into it you should. Flex is nothing like Flash. ActionScript 3
    is nothing like ActionScript 2.

    Well.. you know what I mean by 'nothing like'... ;-)

    -Rich
    Richard Lyman, Aug 25, 2006
    #8
  9. Mariano Kamp

    Mariano Kamp Guest

    Well, actually the huge svg maps I was looking at seem to have been
    generated/converted by inkscape. The problem is that they don't
    contain any semantics. Every path and line looks the same, whereby I
    was looking for a single polyline, that describes Germany ;-) So that
    I can manipulate the appearance of Germany in the context of the game.

    So yes, I could display a map with SVG generated by inkscape, but it
    wouldn't help me more than the original bitmap.

    On 8/24/06, Richard Conroy <> wrote:
    > A colleague pointed me to a real nice open-source vector graphics
    > package: InkScape.
    >
    > On 8/24/06, Mariano Kamp <> wrote:
    > > I am still wondering how to kickstart the maps. I haven't found any
    > > simple svg maps to reuse and am not sure how to draw some myself.
    > >
    > > How does one start out to draw a map? By transforming geographical
    > > data? Which data? Or by putting a real map below a canvas in a drawing
    > > program?

    >
    > In InkScape I believe there is a feature where you can import a standard
    > graphic and *vector-ize* it, which would solve your map-drawing problem.
    >
    >
    Mariano Kamp, Aug 25, 2006
    #9
  10. Mariano Kamp

    Dr Nic Guest

    Dr Nic, Aug 28, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Nordmann
    Replies:
    0
    Views:
    515
    Arne Nordmann
    Jun 28, 2004
  2. Simon Elliott
    Replies:
    4
    Views:
    1,146
    Simon Elliott
    Mar 10, 2005
  3. Marcus
    Replies:
    2
    Views:
    579
    Marcus
    Dec 9, 2005
  4. Flaab Mrlinux
    Replies:
    10
    Views:
    172
  5. ChrisKaelin
    Replies:
    0
    Views:
    76
    ChrisKaelin
    Mar 13, 2007
Loading...

Share This Page