[noob] porting an old project - where to begin?

40 views
Skip to first unread message

Daniel

unread,
Jun 4, 2011, 3:24:26 AM6/4/11
to Clojure
I suppose the noob tag is appropriate ie I was around sometime last
year and earlier but RLing got in the way of doing anything useful
with this lovely language.

Anyway, I've got this old project (https://github.com/doubleagent/
Magic--legacy- ) which I've recently gained a renewed interest in, and
simultaneously am less concerned about the potential legal issues
which made me disinterested enough to drop it 4 years ago. I'm proud
that it still builds and runs, but don't take the readme too
seriously, and I highly doubt the perl scripts work anymore. The
intent was to write a program which assisted MTG (Magic: The
Gathering) players by providing them with robust deck building tools
and a way to compete over a network using the honor system. Several
features are still unimplemented, and some were removed in this
version because the java2d worked too poorly to accommodate them.

I'd like to port it to Clojure, but in the process I'd also like to
solve some fundamental problems. More specifically, real estate. In
a real game you would not be able to see any of the cards in great
detail, but get an overall view of the board, and be able to inspect
cards more closely by zooming and panning (over the whole board - I
find Wotc's way of zooming on individual cards undesirable). This is
even more critical when there are a lot of cards on the field eg some
decks can blast tokens onto the field which number into the hundreds.

I'm unsure how to approach this core problem in Clojure. clj-
processing looks interesting, but I would prefer something more high
level b/c 3d graphics is difficult for me to wrap my head around. In
particular, mapping a mouse click to the nearest movable object in 3d
space and ensuring proper draw updates on the object with dragging....
*head asplode*

But I'm sure to be missing plenty. Suggestions?

Robert McIntyre

unread,
Jun 4, 2011, 6:44:59 PM6/4/11
to clo...@googlegroups.com
You might want to take a look at jMonkeyEngine (http://jmonkeyengine.org/)

It's a 3D java screengraph library with quite good performance.

I've found it to be fun to use in the past, and it has a good userbase
and lots of tutorials online.

Even if it's not what you want exactly, many people have tried to use
it for a pseudo 2D/3D sort of game and if anyone could tell you what
really works in java/clojure it's the people on the message boards
there.

sincerely,
--Robert McIntyre

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

MiltondSilva

unread,
Jun 4, 2011, 8:07:41 PM6/4/11
to Clojure
This, https://github.com/CharlesStain/clj3D , is probably what you are
looking for. Though I'm not sure how the inputs are handled.

Penumbra ( https://github.com/ztellman/penumbra ) is a very powerful
abstraction over opengl and to it's very easy to handle inputs.

Gregg Williams

unread,
Jun 4, 2011, 10:14:44 PM6/4/11
to Clojure
I'm currently using the Java-based Piccolo2D (http://code.google.com/p/
piccolo2d/, http://www.piccolo2d.org/), which is robust and has a good
development community and lots of sample code. It provides built-in
zooming in and out of the image, which could be very useful in your
situation. Good luck with your project--I'd like to see a project of
that size recoded in Clojure!

Gregg Williams
http://www.GettingClojure.com
Info and forums for people who aren't Clojure experts...yet!

Daniel

unread,
Jun 5, 2011, 3:50:08 AM6/5/11
to Clojure
Penumbra looks interesting. Prior to heading there, I decided it
would be a good idea to take advantage of all the Processing examples
and see if I could dispell any concerns (Mainly because it packaged
jogl with the download and testing is as easy as clicking a button.
Very pleasant experience). Any discovery could be pushed to penumbra
or picollo2d or whatever after working out some rudimentary
'understanding'.

Here's some code: https://gist.github.com/1008742

It's supposed to give the user a default view of the board (at an
angle, so that the opponents cards seem further away on the opposite
side - similar to the way most of your 3d chess games have looked).
Currently there is just one card, but imagine lots. In the default
view the user should be able to mouse over a card and drag it about
the table. If the user presses 'z' then the 'camera' zooms in (and
into a flat angle) and the user should be able to just pan around by
clicking and dragging.

So, my concerns seem to be valid. I simply don't know how to do
proper transformations from...what are they called...viewport and
object space coordinates? Is a wrapper over lwjgl going to fill that
knowledge gap?


On Jun 4, 7:07 pm, MiltondSilva <shadowtr...@gmail.com> wrote:
> This,https://github.com/CharlesStain/clj3D, is probably what you are
> looking for. Though I'm not sure how the inputs are handled.
>
> Penumbra (https://github.com/ztellman/penumbra) is a very powerful

yair

unread,
Jun 6, 2011, 8:32:04 PM6/6/11
to Clojure
I'm using processing in a Java2D program. It doesn't have to be 3D...

Daniel

unread,
Jun 7, 2011, 1:53:58 AM6/7/11
to Clojure
Meh. I'm more or less giving up. Being stuck on a peripheral problem
I have neither ability or desire to solve is about as fun as hacking a
four-year old program already written using java2d (having fun being
the main objective here)....

Daniel

unread,
Jun 8, 2011, 12:11:09 AM6/8/11
to Clojure
I lied. Ran across this:

http://processing.org/discourse/yabb2/YaBB.pl?board=OpenGL;action=display;num=1176483247

Spent about 20 minutes bringing it up to date and voila

https://gist.github.com/1008742

Near as I can tell, this captures the object space coordinates of the
object nearest the mouse cursor. I'll get back to "work" on moving it
around. If that works out we'll see how it works in Penumbra.
Exciting!

Daniel

unread,
Jun 21, 2011, 2:16:53 AM6/21/11
to Clojure
http://forum.processing.org/topic/fix-my-program#25080000001008001

Managed to get most of the components to work. Having issues
panning. Thought I'd keep you guys up to date.

Once this is completed I can test a couple more things before porting
this to clojure.


On Jun 7, 11:11 pm, Daniel <doubleagen...@gmail.com> wrote:
> I lied.  Ran across this:
>
> http://processing.org/discourse/yabb2/YaBB.pl?board=OpenGL;action=dis...

Daniel

unread,
Jun 22, 2011, 12:19:50 AM6/22/11
to Clojure
https://gist.github.com/1008742

This is a poor solution to the panning problem.

I think that once I demonstrate this with multiple cards and
translucent select boxes I'll be ready to drop processing.
Reply all
Reply to author
Forward
0 new messages