Zyps

Was gonna do a fake book cover for Speaking LOL, published by O’RLY, but in Googling for materials found that someone had automated the whole process (and that a LOLcats cover was one of their examples). So I did this instead:

Zyps: Game Development the Lazy Way

The real book, less sarcastically titled, will be coming out as soon as someone gets me an O’Reilly editor’s contact info. :)

Zyps

Comments (0)

Permalink

Zyps presentation…

Here’s the presentation I gave at Code Camp, uploaded to Google Docs…

Ruby
Zyps
development

Comments (0)

Permalink

A time-sink is born…

Found an old e-mail to my brother that is basically the inception of Zyps. Not sure of the exact date, because dates got eaten by a corrupted mbox file eons ago. Whenever Wired profiled the MIT Ants project, I guess.
Continue Reading »

Zyps

Comments (0)

Permalink

Desert Code Camp…

I’m doing a talk on Zyps at Desert Code Camp on Saturday, May 31st. (Exact time TBD.) There are several other Ruby sessions as well, ranging from beginner to expert.

If you’re in the Phoenix/Tempe area, go get signed up!

Ruby
Zyps

Comments (0)

Permalink

zyps_client, zyps_server…

OK, here we go. The window on the left is the server, and on the right is the client. The server has absolute authority on all object movement right now, so objects on the client will occasionally “snap” back into the places dictated by the server. (That’s the jagged part in the trails on the client; the smaller boundary on the server causes them to change direction on the server only, and fall out of sync momentarily.) The shells in the background are both barfing debug data.

Next up is to test with multiple clients, and with joining/leaving whenever the client wants. I also need to get back the same degree of freedom for live coding that dRuby offered (shouldn’t be too difficult).

zyps_server_client.PNG

Ruby
Zyps
development

Comments (0)

Permalink

I have two Environments talking!

Well, sort of. They can only share one Creature, and then they start throwing DuplicateObjectErrors. And they don’t keep that one creature’s movement in sync. But it sure was a thrill to drop a Creature on one screen and watch it appear, behaviors and all, on the other.

Ruby
Zyps
development

Comments (0)

Permalink

Yaaaaay!

Finished in 3.329 seconds
127 examples, 0 failures, 89 pending

jay@MINIME:C:\work\zyps
$

Of course, there’s still those 89 pending examples, but at least I don’t have that dirty feeling from failing tests any longer.

Ruby
Zyps
development

Comments (0)

Permalink

After some frenzied coding last night and this afternoon…

…EnvironmentServer and EnvironmentClient are much more fleshed out:

spec_doc.html

The failed examples are supposed to throw exceptions; not sure why the test is failing because of it. Some Googling on RSpec should take care of that.

Ruby
Zyps
development
testing

Comments (0)

Permalink

So it goes like this…

Environment1
EnvironmentServer observes Environment1
Environment2
EnvironmentClient observes Environment2
Add Object1 to Environment1
Environment1 notifies EnvironmentServer of new Object1
EnvironmentServer sends Object1 to EnvironmentClient
EnvironmentClient adds Object1 to Environment2
Environment2 notifies EnvironmentClient of new Object1
EnvironmentClient sends Object1 to EnvironmentServer

Screeeeee… Hold the phone. I just created a loop of object additions there.

The problem is that Environments are set up to notify their observers whenever an object is added, even if it came from that observer.

What I need is an entirely different model. Something that monitors the difference between two Environments, and then does the needed steps to synchronize them. Like a diff or an rsync or something.

I need to draw some diagrams or browse some source code or something, ’cause an elegant solution eludes me.

Ruby
Zyps
development

Comments (0)

Permalink

Philistines…

( 0.000, -0.028)
( 0.000, -0.083)
( 0.000, -0.167)
( 0.000, -0.278)
( 0.000, -0.417)

Jay: Lookit! The Body’s falling!
Diana: It’s green text.
Jay: But it’s falling! There’s gravity! And it’s accelerating over time!
Diana: It’s only falling 5 times.
Jay: I can extend the loop!
[Diana walks out of room, shaking head.]

require 'chipmunk'

include CP

space = Space.new
space.gravity = Vec2.new(0, -100)
radius = 10.0
body = Body.new(10.0, moment_for_circle(15.0, 0.0, radius, Vec2.new(0, 0)))
ball = Shape::Circle.new(body, radius, Vec2.new(0, 0))
space.add_body(body)

5.times do
	space.step(1.0 / 60.0)
	puts body.p
end

Ruby
Zyps
development

Comments (0)

Permalink