[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Mariano Kamp

8/21/2006 2:07:00 PM

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...)
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

9 Answers

Richard Lyman

8/21/2006 4:28:00 PM

0

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.c...

Since you mentioned Javascript:

http://backspace.c...javascript.html

grrr

8/23/2006 12:28:00 PM

0

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/projec... - 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

8/24/2006 7:42:00 AM

0

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 <grrr@toto.maatti> 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/projec... - 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
>
>
>

Richard Conroy

8/24/2006 2:26:00 PM

0

A colleague pointed me to a real nice open-source vector graphics
package: InkScape.

On 8/24/06, Mariano Kamp <mariano.kamp@gmail.com> 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.

Gavin Kistner

8/24/2006 3:09:00 PM

0

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.

David Vallner

8/24/2006 6:58:00 PM

0

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

Richard Lyman

8/25/2006 2:40:00 AM

0

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

Mariano Kamp

8/25/2006 8:37:00 AM

0

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 <richard.conroy@gmail.com> wrote:
> A colleague pointed me to a real nice open-source vector graphics
> package: InkScape.
>
> On 8/24/06, Mariano Kamp <mariano.kamp@gmail.com> 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.
>
>

Dr Nic

8/28/2006 1:21:00 PM

0

Ajax Risk (not in Rails)
- http://denizengames.com/grandstrategy/l...

--
Posted via http://www.ruby-....