MV3D Development Blog

July 6, 2008

Nevow Complaints Vol 1

Filed under: Uncategorized — SirGolan @ 12:55 pm

I’ve heard a good amount of complaints made against Nevow, and one of them was that templates can’t include other templates. I’ve been working on a web based resource management system for MV3D this weekend and of course, it uses Nevow. I decided it would be nice to have a main layout template that included other templates for navagation and the content of the page. But that can’t be done with Nevow, right? Wrong. It’s pretty easy to include other templates. Just use rend.Fragment– it even suggests using it that way in its docstring.

Before I get in to specifics, I’d like to just comment on what I just said. Another complaint that I’ve heard about Nevow is that there is barely any documentation. In some cases, I can’t disagree– if you are talking about missing docstrings or an extensive manual. One thing I’ve learned, though, is that if you want to know how to use something, just read the code. The only Divmod code I’ve found so far that was hard to read was deep inside Axiom. Definitely part of that was because I didn’t really understand metaclasses at the time. What I’m saying is that I’ve always found the quickest way to answer a question is to just get out the code.

Anyway, rend.Fragment isn’t mentioned anywhere in the Nevow getting started manual that I know, but it took me 20 seconds of skimming rend.py to find it and even before reading the docstring, I knew it was what I was looking for. I also found that there’s a nice example of how to use it in exactly the manner I wanted in the examples folder.

What’s neat is that you can use it to cache chunks of your pages really easily. Say you have a header bar on the top of all your pages that is always the same for users who aren’t authenticated. Just make a subclass of rend.Fragment to render it and use the same instance of that everywhere. If that header changes for logged in users, then you can easily switch which rend.Fragment subclass you display in the header section depending on whether the user is logged in or not.

I could give an example usage here, but the best place to look is in Nevow/examples/fragments/.

In other news, there was something strange going on with the MV3D alpha server where it wouldn’t allow people to log in after creating an account. I’m not sure what the deal is, but somehow, I’ve fixed it. So, please give the new release a try if you haven’t already.

July 3, 2008

Release time!

Filed under: Uncategorized — SirGolan @ 12:23 am

I just released MV3D 0.32 today. It has all the features I mentioned in a previous post plus now a load tester. There’s a slight issue with the load tester, though. It can’t handle load very well. The load tester, not MV3D. I had it going with about 75 clients connected and moving around, but the load tester was going very slowly. The problem is that currently, the client has no choice on which objects it gets updates for. The server decides which objects are within view range and automatically makes sure those exist on the client. Since the load tester impersonates any number of clients (75 in the example above), that means 75 player objects get updated 75 times. I have a ticket for the next release that will stop this behavior and allow the client to choose which objects to receive updates on (of course limited to ones the server deems are in its view range). I suspect that will fix the load tester and allow it to test more effectively.

However, 75 clients connected is pretty impressive. I was even able to log in via a real graphical client and walk around a bit. It got choppy now and then, but for the most part, other than a low framerate (30-50ish), it was pretty responsive. Impressive considering there were three apps running on my system that wanted 100% of a single core, and I only have 2 cores. I didn’t end up making any changes based on the load testing I did. That was mostly due to not being able to stress the server enough to make it matter.

My next task is to figure out what the 0.34 and 0.36 releases mean. Now that I have persistence solved for the moment, there are two areas that need attention. One is the world editor, and the other is load balancing and redundancy. My current thinking is that since load balancing and redundancy worked previously and the framework for them is still in place, it should be ok to focus on world building first. I figure that there won’t be any need for load balancing if no one can make worlds other than the test world. In any case, it’s time to do the ticket shuffle.

Powered by WordPress