[MUD-Dev] [TECH] Multi - Browser plugin framework

ceo ceo at grexengine.com
Sun Oct 16 11:49:53 CEST 2005


Arnau Josep Rosselló Castelló wrote:

> I'm trying to (re)implement one of those old-style turn based
> games with a web interface(first seen on BBS, or so they say,
> because I'm too young to have seen for myself), but I want to do
> it in a more world-ish way.

(/me reaches that stage in life where other people make him start to
feel old)

> As a means to that I'd like to embed text, 2d and 3d interactive
> widgets(maps,points of view, chat window, etc...), I have looked
> at Java but i don't like working on it very much and it's main
> advantage for me(no need to install anything) doesn't exist for
> Java3D.

If you're using java, you will NOT be using Java3d if you have any
choice at all. Java3d is designed very much NOT for people like you,
does lots of things you will never use, and can't do the basic
things you'll need a lot of the time. Java3d is for sci-vis apps. It
is also languishing behind after years of being an unsupported
officially "dead" project.

No, what you'll be using is either Xith3D (an open-source
re-implementation of the core Java3d API, so you have very nearly
compile-time compatibility) or LWJGL (java's native binding to
OpenGL, allowing direct access to the modern 3D graphics card and
all its fancy stuff like pixel shaders etc).

Xith happens to use LWJGL to do the low-level rendering - xith's
authors concentrate on scenegraph-level features, and on providing a
fast, single-threaded SG (java3d has a monstrously complex
multi-threaded SG designed to work simultaneously on multiple
monitors and other such scenarios from the sci-vis world).

If you're using java, java nowadays has a built-in library installer
that manages versioning, caching, and shared use of libs between
different apps. You just have to write one line of XML for each lib
you want to use in your app, and the app will automatically and
transparently install it the first time it is run *iff* said lib
isn't already installed on the user's computer.

> Next in my list is Director, but I have previous experience doing
> director games and when a server is thrown into the mix, it goes
> awful very fast, in terms of code cleanliness.

I've only worked with two different groups that tried this
commercially, but both had the same experience: avoid like the
plague :(.

> I've also looked at AJAX briefly, but it looks too limiting and
> hackish, it could be useful as a complement to plug-ins(more
> below), but it's not enough on its own.

AJAX IMHO would fit you better than anything else you've listed.

However, be warned that it's much harder to write than java or c# -
it's not compiled, and so debugging is a long hard slog. You also
have to face the fact that it's not cross-platform: what works on
mozilla doesn't work in MSIE. What works in both of them doesn't
work in opera. Etc. *you* then have to spend ages learning and
memorizing the differences and coding around them.

> (Also, It would be nicer if i didn't have to learn the whole
> Javascript, css, etc thing; I'm wondering if there isn't anything
> that let's me construct basic things like changing lines of text
> from the server without reloading the page, but abstracting for me
> the messy client side?)

NB: if you do not learn "the whole ...css etc thing" then you're
never going to be able to render what you've done. CSS - despite
MS's laziness and official refusal to fix the bugs in their CSS
renderer - is still much easier to use than any of the standard GUI
libraries that come with C, java, etc. If you don't learn CSS,
you're going to have to learn something nastier.

> I'm looking now at simply making downloadable plugins, Which will
> give me 2 or 3 standard output contexts(SDL for 2d input and
> audio, Opengl, and text), control over what is cached locally, and
> the ability to embed a Python interpreter.

That sounds the worst option I can think of, apart from Director.

You are taking the worst of all worlds. If "coding in python" is
your priority, then ignore the browser and just write your whole
game using Python and SDL. But I think you were on a much better
tack with the "leverage the browser" ideas.

> Does anybody know of a framework that has at least some of the
> following?

>   - Works on IE and Firefox (old netscape, opera, the MacOS
>   browser thing, whose name eludes me, etc... would also be nice)

10 minutes with google will give you at least 5 if not 10 free AJAX
frameworks you can download in a single zip file.

Try out their demo pages, glance at their tutorials pages, and see
which ones look right for you.

>   - Let's me tie it to SDL so I can have a widget on the page that
>   is a SDL 2D or OpenGL context.

(as noted above: don't mix SDL and browsers. You are mixing two
technologies that are fundamentally replacements for each
other. Really, you're not going to end up benefiting from it)

>   - It's reasonably portable, I'd like to offer a simple installer
>   for every plataform.

AJAX: no install needed, "just works"

Flash: 97% chance no install needed (already installed)

Java: 75% chance no install needed (already installed)

C#: ?? chance no install needed - there's many .NET apps out there
that have forced people to download the runtimes, but ... they still
seem to have reached only a tiny minority of people

others: your user is going to have to wait for a big download :(

Apart from flash, I'd recommend them in that order of
appropriateness too. Zero download works for me, and having a mature
and powerful GUI for you to develop with (CSS) is a major boon IME -
most of the pain tends to be in GUI development :(. Java is a bit
more mature and more cross-platform than C#, but it's a toss-up
between them, more down to your personal preference as a coder.

Everything else is just makign it unnecessarily hard for yourself,
ignoring the modern latest + greatest + easiest tools.

Adam M
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list