Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Which Frontend Technology for an Online Game of Risk? SVG Maps?

Reply
Thread Tools

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

 
 
Mariano Kamp
Guest
Posts: n/a
 
      08-21-2006
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/wikipedi...kMap-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

 
Reply With Quote
 
 
 
 
Richard Lyman
Guest
Posts: n/a
 
      08-21-2006
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

 
Reply With Quote
 
 
 
 
grrr
Guest
Posts: n/a
 
      08-23-2006
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

 
Reply With Quote
 
Mariano Kamp
Guest
Posts: n/a
 
      08-24-2006
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 <(E-Mail Removed)> 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
>
>
>


 
Reply With Quote
 
Richard Conroy
Guest
Posts: n/a
 
      08-24-2006
A colleague pointed me to a real nice open-source vector graphics
package: InkScape.

On 8/24/06, Mariano Kamp <(E-Mail Removed)> 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.

 
Reply With Quote
 
Phrogz
Guest
Posts: n/a
 
      08-24-2006
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.

 
Reply With Quote
 
David Vallner
Guest
Posts: n/a
 
      08-24-2006
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

 
Reply With Quote
 
Richard Lyman
Guest
Posts: n/a
 
      08-25-2006
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

 
Reply With Quote
 
Mariano Kamp
Guest
Posts: n/a
 
      08-25-2006
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 <(E-Mail Removed)> wrote:
> A colleague pointed me to a real nice open-source vector graphics
> package: InkScape.
>
> On 8/24/06, Mariano Kamp <(E-Mail Removed)> 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.
>
>


 
Reply With Quote
 
Dr Nic
Guest
Posts: n/a
 
      08-28-2006
Ajax Risk (not in Rails)
- http://denizengames.com/grandstrategy/login.faces

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What graphical frontend for a simple 2D game? ChrisKaelin Ruby 0 03-13-2007 09:07 PM
[ONLINE GAME] Ruby Core + Php FrontEnd (open) Flaab Mrlinux Ruby 10 12-12-2006 04:19 PM
[SVG] problem with SVG image drawing with Batik Library Mardagg Java 0 05-12-2006 02:12 PM
[SVG] using image-tag to integrate SVG in SVG Arne Nordmann XML 0 06-28-2004 01:16 PM



Advertisments