| ruby_gambit is now under the DFPL |
[Jul. 16th, 2005|03:15 pm] |
|
I created something called the Drama Free Public License to help protect both the freedom and the quality of information on weblog systems. ruby_gambit will be the second LJ in existence to be DFPL'ed. Check out the FAQ here. |
|
|
| Gambit Post Mortem |
[Jun. 7th, 2005|02:38 pm] |
| [ | mood |
| | tired | ] | Syndicated from James Edward Gray II's post to the ruby-talk mailing list:
"We've just completed nine solid days of development on Gambit. Now that's a "Codefest" alright! I thought I would share a little with the curious about how I think it went...
Greg Brown flew out to my home in Oklahoma so we could work on Gambit. It was nice to finally meet face-to-face. We've actually programmed together on many projects these last couple of years, but this was the first time we didn't do it over the Internet. We're both grateful to the wonderful people at Ruby Central for giving us that opportunity.
We've had practice, so we work pretty well together by now. Greg would probably say that I've almost beat all his bad habits out of him. ;) True or not, I know he's always challenging me and pushing me to new limits of what I can build. I think we both learned a lot from working together on this project.
And boy did we work! We played two games, watched two movies, went out shopping once and to eat twice over a ten day stay and the rest of the time, we were working on Gambit. We ate a couple of meals a day and I slept, but Greg appears to be one of those rare human beings that needs very little sleep and because of that he kept us working almost 'round the clock. We designed, implemented, tested and built examples of usage in a continuous cycle.
Here's some fun little statistics for our work:
$ rake test (in /Users/james/Documents/Ruby/gambit) ruby -Ilib:test /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.3/lib/rake/ rake_test_loader.rb test/ts_all.rb Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.3/lib/rake/ rake_test_loader Started ........................................................ Finished in 0.163976 seconds.
57 tests, 715 assertions, 0 failures, 0 errors
$ rake stats (in /Users/james/Documents/Ruby/gambit) +----------------------+-------+-------+---------+---------+----- +-------+ | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+----- +-------+ | Gambit | 2084 | 1703 | 23 | 120 | 5 | 12 | | Functionals | 1834 | 1513 | 12 | 88 | 7 | 15 | | Units | 1618 | 1346 | 15 | 64 | 4 | 19 | +----------------------+-------+-------+---------+---------+----- +-------+ | Total | 5536 | 4562 | 50 | 272 | 5 | 14 | +----------------------+-------+-------+---------+---------+----- +-------+ Code LOC: 1703 Test LOC: 2859 Code to Test Ratio: 1:1.7
(Obviously, I borrowed Rails' statistic generation library there. "Functionals" refer to our examples and "Units" to our unit tests.)
Which brings us to what we built. Some of you have expressed interest in Gambit and I'm sure you would like to hear how it came out. The short story is, very good. We met and even exceeded our expectations in many areas.
The longer story: We've built a very hand model layer for common game elements like Boards, Cards, and Dice. This is probably our most polished work and has been a real asset to our internal development already.
Our views layer started out pretty basic, and really still is in many ways, but we're already using it to great effect. It has evolved as we discovered our needs and will continue to evolve with future development. However, it is already an adequate and effective tool.
Finally, our controller (the Gambit server) is still a little rough around the edges. It's quite functional at this point, if not yet elegant. There's probably still some lingering issues hiding in here (we've been steadily uncovering and removing them), but I'm sure all you beta testers will find those for us right quick! :) We'll clean up our mess in here as we continue to refine this aspect of Gambit.
Which brings us to the final question. When can you get your hands on a Gambit release? Naturally, the brave are welcome to pull down our CVS and poke around. There's really a lot to find in there, but no good guided tour at this point. For those that don't think that sounds like fun, our official answer is "sometime this summer." We have a few more minor tweaks to do to the controller, some general clean-up, and an example to build.
While it's true that we already have many examples, they were built at various stages of Gambit functionality and use a mis-match of its features. We're going to unify that with a complete example that will serve as your map to exploring our first release of Gambit. That's important because the API is not documented yet and probably won't be by the time we release. That's our number one priority feature for the second version, scout's honor.
Well, that's where we, and Gambit, are at this point. Give us a little time to uncross our eyes, pay a little attention to our other lives, etc. and then we'll get a release packaged up and out for public consumption.
Again, we send our thanks to Ruby Central and all those who have shown interest in our project!
James Edward Gray II Greg Brown: |
|
|
| Phase III complete, Final Day of Codefest begins |
[Jun. 6th, 2005|04:04 am] |
| [ | mood |
| | thankful | ] | Oh what a time it has been. We have created quite a robust system in 8 days, and we think you'll be very pleased with the results. Today, I rounded off the messaging framework and added SMTP support. I created an example system called GambitMail that lets you send and recieve in game messages. This code allowed you to sort, view, reply to, and compose new messages to any user on the server, and the code consisted of 78 lines of ruby and about 50 lines of CSS and 50 lines of html tops. This system is compact enough where you can most likely easily adapt it to fit your needs and embed it in one of your games written on Gambit. James crushed a ton of WEBRick issues today and implemented a login system and the ability to create new instances of games. He has been using Bird Wars to smoke test the server, and the fact that Bird Wars was kludgey and poorly written has actually panned out to be a good trial by fire for our server. Getting Gambit Mail to talk to the server was trivial, even when we made some changes, which goes to show you that clean code is easier to manage than difficult code. I put a ton of effort into Bird Wars, but most of it was focused on the design of the actual game, not the code lying underneath. As I said, the fragility of the code provided a great worse case scenario to test our system with, but I'm now in the process of converting it to something that's sexier and more Ruby/Gambit. James raytraced a very attractive Gambit logo today, which we will unveil sometime tomorrow. I must say that I have learned a ton this week and am incredibly grateful for the accomodations that James and his lovely wife Dana have provided for me. I'm also really thankful that RubyCentral provided this opportunity for us to get together and work on Gambit. I really believe those of you in the Ruby community will enjoy what we have created.
Now, it's time for me to stop being all weepy eyed and get back to finalizing Gambit. I don't think I'm going to sleep tonight, as it's already 4am and since today is our last day, what have I got to lose?
 |
|
|
| The promised update, midstream phase III |
[Jun. 4th, 2005|01:33 am] |
| [ | mood |
| | tired | ] | NOTE: I forgot to mention the other day that Viewable is now a Mixin. You don't need to inherit game objects from it anymore, so that is a big plus. Functionality is the same, we only gained features, didn't need to sacrifice any.
So the hardcore controller stuff is underway, and we've already made some awesome progress. Though I initially thought spending extra time on Bird Wars today was probably a bad use of my time, It was no surprise that James was well aware of the value of what I was doing even if I thought I was just playing around. While I did a ton of work on layouts for Bird Wars and wrote a quick and dirty model and event parser for Bird Wars, James was implementing the Gambit server, which now has full support for forms, has support for seperate games, and can handle custom events from the user without issue. This is all seemlessly integrated with the models as well as the layers. Bird Wars became our prototype for testing how to wire a game up to the server, and with a little effort, we moved it from a simple barebones server to Gambit's system, which actually resulted in a reduced amount of code all around. Having prototypes built before the system has been a major asset to our productivity, where I have been continuosly pushing the system to it's limits, James is expanding those limits rapidly. He has implemented an Exception class today, so that Gambit can handle it's own errors, a must have for complex server behavior. Right now, I'm going to start working on the Message class, which we will use to send in game notifications, as well as emails.
We will probably put Bird Wars online sometime tomorrow, and I'll put a link here so that you can play it if you like. We'll be implementing the login / user system tomorrow which will bring us close to a complete system.
Gambit is starting to really take shape but there is still a long way to go before we sleep. Unless of course you're James. Then you can go to bed 9ish while your "BLOGGER" writes complex prototypes, unit tests, helper classes, etc. Must be nice to be the guy who touches everything, eh James?
Oh, don't mind the silly comments. They'll probably only get worse as the week goes on. You can't work for as long as we have on Gambit in the last week without going a little silly :)
 |
|
|
| Busy... Busy... Busy... The way of the Beaver |
[Jun. 3rd, 2005|10:12 pm] |
| [ | mood |
| | amused | ] | There will be an update all of our work soon. But before I forget, let me share four quotes from James Edward Gray II, all referring to Gambit but taken out of context for entertainment purposes. Enjoy!
"I'm white, and I'm looking for a black guy!" - Player handling for chess
"I love touching things! I touch everything! You can tell me to stop, and it won't make a difference" - Frequent changes to CVS
"DOCK ME BABY!" - I have no idea what this was about.
"Are you helping? How are you helping? Your job is to edit the BLOG. You're the Blogger!" - Appreciation for the thousands of lines of code I've written so far. Thanks James :) |
|
|
| Phase II near completion |
[Jun. 1st, 2005|09:13 pm] |
Today I continued work on Space Trader as it has become quite robust and is a good way to test a number of Gambit's power features. James implemented Viewable, but instead of making it a mixin implemented it as a class due to some issues we ran into. However, the functionality is still the same. All of the models have been wired with both plain text and html modes. It's also possible to create your own custom erb templates, which I made use of in Space Trader.
I just got done fixing some bugs and doing some code cleaning in Currency and Board as per request of James. I have to say, it does look better now. However, James broke the original Space Trader by introducing layouts, so I hope he fixes this :)
Tomorrow is a planning day, but it will be a lot more comprehensive than yesterday's planning session, as we only have 3 days to implement the controller. Though the schedule is tight everything has been moving along smoothly and we expect to meet or exceed our goals before the end of the codefest on June 7th. Afterwards, we're going to document and do cleanup and packaging, and hopefully release our first version some time next week. Anyway, I'll be back with an update later tonight after I get done as much as I can and of course will summarize our planning session tomorrow as well.
I'll leave you with two pieces of raw information from the project: Jame's Summary of Phase II and the Gantt Chart (Project Timeline)
Summary of Phase II from Gambit TODO by James Edward Gray II:
"We went for the simplest system that could possibly work here, and I believe it does. Everything in Gambit now has views, both defaults and as many as you care to write. Your own objects can easily interface with our view system as well. Building up those views, is the process of defining your game's interface.
Where does that leave layouts? Simple ERb files that have access to your model layer when filled in. Using views, you'll be able to reduce your renderings for complex in-game objects to something like <%= @monopoly_board.view(:gambit_html) %>. Views can be built off of other views, naturally. Because the rest of the file is yours to create, things like pluggable styles are a non-issue.
Obviously, this isn't the most robust system ever and I expect this layer to see the most growth in the future. What's there is now powerful, if not yet elegant. It will grow as we learn more about what we (and others!) need.
We didn't add the huge library of HTML helper functions, like Rails uses. I'm not sure what our future plans in that area are at this point. Greg thinks that code generation is the way to go here, having Gambit help you build layouts. That could very well be the answer. Whatever we decide, that's down the road a bit...
However, both Gambit and its creators are ready to start building games today!"
Chart as of 2005-06-01:
 |
|
|
| SpaceTrader model |
[Jun. 1st, 2005|06:05 am] |
| [ | mood |
| | tired | ] | Well, it's 6:00am and I still haven't slept, but I wrote up a customized SpaceTrader model that we'll be fitting a view on today. The model lets you generate a MASSIVE 12000 planet galaxy and then pin the planets in little solar systems on a grid. You'll be able to travel from system to system and the board will keep track visually of where you have been. Unfortunately, I haven't had time to work on BirdWars, so I'll be working on that some time later today once James finishes the Viewable mixin. Right now, I'm going to grab some much needed sleep. We should have some exciting stuff to show you tonight when we complete the view system, so stay tuned.
P.S. Board now supports a default fill value, so Board.new(10,10,[]) would make a 10x10 Board with array objects for all the elements and Board.new(10,10,"*") would fill the 10x10 board with asterisks. Came across for the need for this feature when I realized that I'd be storing the planets in arrays for space trader. I think this will come in handy :) |
|
|
| View Design |
[May. 31st, 2005|03:20 pm] |
So, today James has gotten me up to speed on ERb and WEBrick. We'll be using a system that uses static layouts wherever possible and will allow each model to provide a customized view system which allows for multiple different interfaces to the model. The view system will produce ERb strings which can easily be embedded in html or used in plaintext output. Tonight I will be building two customized models in order to test the Viewable mixin tomorrow. These models will be the Opponent class for BirdWars and a Planet class for space trader. I will be searching the net tonight for comical graphics for the inside joke that is Bird Wars which will be one of our test applications. We may play around with styles and things like that tonight as well, so that designing the layout system will go smoothly tomorrow and give us something to show for our work.
Tomorrow James will be building the Viewable mixin while I try to wire some of the models up to the new system. Once he has it completed, he'll help me finish wiring all the models at which point we'll code out Bird Wars. Then it's time for a deep breath before Controller design begins on Thursday.
Needless to say, we've been busy and will be busy for quite some time. Soon, you'll be able to engage in heated battle with the mighty albatross, so keep your eyes on this project as it continues to grow.
For those of you albatross fans, here is the mockup that started the joke:
 |
|
|
| Piles implemented |
[May. 31st, 2005|10:48 am] |
Well, we lied about Piles. James implemented them this morning after fixing SpaceTrader to make it less fragile. So if you were excited about piles being in the first release, you'll have them.
Piles offers a neat feature in which you can use a proc to determine which cards are face up / face down in the pile, which happens to be James favorite feature.
Here is an example of implementing a dealer using this feature in blackjack:
dealer_hand.face_up = lamda { |index| index != 0 }
As you can see, all cards except the first card are set to face up :)
We also reversed the each_row iterator in boards, so that printing will print bottom up, like a chess board.
Now we're going to spend some time actually playing some games and talking about the layouts and views. Stay tuned for an update later today on the results of our planning. |
|
|
| Phase I is complete! (31 Tests, 581 Assertions) |
[May. 31st, 2005|01:53 am] |
We have completed working on phase one and have met and exceeded our goals for the models. We have implemented dice, scorecards, cards, decks, hands, currency, 2D boards, and move history. We have also written 4 prototype commandline games: Yahtzee, Go (Capture Game), Blackjack, and a SpaceTrader type game.
Yahtzee shows off Dice and Scorecards, Go makes use of Boards, Blackjack the card system and SpaceTrader makes use of Dice and Currency heavily. Tomorrow, Go will be expanded to include Move History.
SpaceTrader is especially neat because it demonstrates that Gambit does not need to be Board game centric only. It lets you travel from planet to planet trading goods (some legal and some illegal) all whilst avoiding cops who want to catch smugglers and pirates who want to steal your precious cargo. The whole thing is written in just over 200 lines and could mostlikely be half this length if we optimized it.
Blackjack WITH a computer player rings in at 85 lines, most of which are print statements.
So, already Gambit is flexing some of it's muscles for us.
Tomorrow we're going to take a bit of a break and plan the view system and go back and clean up some of the code we've written in this marathon session that was Phase I. We'll be implementing views and layouts completely on Thursday which will mark the last day before we enter mind numbing Phase III, which we have given ourselves one planning day and 3 working days for. Then, on day 9, we catch up on anything we miss, hopefully going back and throwing support for one dimensional boards and piles into the Models and fixing any bugs or issues that come up.
Well, that is the news for tonight, come back tomorrow for an update on our design of the views and layout stuff. For those of you who are interested in the source, the CVS is on fire right now so keep your eyes peeled. |
|
|
| Day 2 Underway |
[May. 30th, 2005|04:12 pm] |
Well, we have already implemented two prototype games and we're churning away in phase one of development. Today James and I will finish models and be ready to start working on views and layouts tomorrow. Though we were behind schedule this morning, we are catching up and Gambit is already starting to take shape.
Now we're just waiting for the activity meter to go through the roof on rubyforge so that we can feel good about ourselfs.
As far as the tests go, we're up to 172 assertions. Each and every feature is being rigorously tested to make sure that Gambit is as rock solid as possible.
The models are looking really good so far, we've both contributed our share of clever tricks to make Gambit even cooler than HighLine. However, the pressure is going to be on and stay on as we continue to attack the problem.
I created this LJ to be able to fire off quick bits of news and keep anyone in the Ruby Community, or those people who are just curious about James and I informed.
Anyway, I've got a currency class to implement so that's all for now. Check out the chart below to get an idea of what we're up against this week.
 |
|
|
| navigation |
| [ |
viewing |
| |
most recent entries |
] |
| |
|
|