MV3D Development Blog

July 29, 2007

Speed Demon!

Filed under: Uncategorized — SirGolan @ 12:29 am

I finally gave in and bought a new PC. I originally purchased my old one in 2002 and other than going up to 1gb ram and a P4 2.6GHz (from 2.4GHz), I haven’t done much with it. Now I have a 3.0GHz Athlon X2 machine with 4GB RAM and a GeForce 8600 + GeForce 6150. That’s right, I can do 4 monitors at once. I’m currently running 3 in XP and Linux, but that’s because I.. uh.. ran out of monitors. I’ll be remedying that on Monday. I also upgraded my wife’s P3 733 machine to a nice P4 2.6, and I’ll be keeping my old machine. Also, upgrading our file server to a P4 2.4 from a P3 500 and giving it mirrored 500GB drives. Pretty nice, and not too expensive since I have all sorts of spare parts around. Anyway, I’ve spent all week getting things working on my PC and Kelly’s. Today I basically started over on mine because WinXP 32bit won’t see all 4GB (it can address 4GB of space, but your PCI devices take up some of that). So now I have WinXP x64 and Ubuntu Feisty x64 both going with the 3 monitors. My poor old desktop doesn’t have any monitors currently and I’m just connecting to it remotely now.

So my PC isn’t the only thing that’s faster. The MV3D client flies now. I took graphics rendering out of the main loop (which runs the physics 20x per second if possible) and instead put it in a cooperator. The main loop is still a looping call because.. well, running it more than 20x/second is bad. On my old system, I’d get 5 physics iterations/second and about 20-30 fps on the graphics. After that change, it is locked at 20 physics iterations and the FPS is >100.

On the new machine, FPS is… Well:

300ish. :) The Python-Ogre terrain demo runs at 800 FPS, which is pretty cool because, like, you know, it’s Python and not C++.

Fun stuff.. On the not so fun side, I found out that something is making copies of the cached objects on the client side instead of increasing the refcount on the original twisted object, and that’s the reason why if the server you are directly connected to crashes, all the objects disappear. Very strange.

July 14, 2007

Models

Filed under: Uncategorized — SirGolan @ 10:31 pm

So.. I suck at making 3d models. I also suck at rigging them for animation. I was lucky enough to find a free model for NWN2 that someone named Zylch000 was nice enough to create and put up for download. I spent quite some time hooking it up to a skeleton and making a walk and idle animation. Then spent quite a lot more time fixing them so they imported correctly into Ogre.. Then spent even more time redesigning the current player object so that it can accommodate more than one mesh (the body, head, and hair are separate– which is cool cause I have a bunch of heads and hair models). But finally, I got everything working:

Yay for me. Please.. anyone out there know anyone who can make 3d models of people and rig them? If you notice, she has “zombie hands” (at least, that’s how they look to me) and the shoulders are way back. Also, when she walks, her hair doesn’t move the same way as the head. UGH! Well, one problem I found in getting the body/head/hair meshes to all use the same skeleton was that the Ogre exporter plugin only exports the bones that are attached to the mesh it is exporting. So for the head, it only exported the head and neck bones. Ugh. And the bones are numbered in the Ogre file starting at 1. So I had to go in and edit the Ogre XML file and re-map all the bones for the hair and head models. FUN!

I guess the good thing is that I can fix the animations and stuff all I want and I shouldn’t ever have to change the model files.

Another thing I did recently was add players names above their heads. This makes use of my image compositor which converts images between Ogre, CEGUI, and PIL without saving them to disk. (ctypes ftw!) Here’s a happy fun shot of that:

And I talked about the beach ball before. It doesn’t make a sound yet, but only cause I’m lazy. Sound and music is now working in the client. Nothing uses it yet though. I also mentioned the beach ball floats on water. Here’s a shot of that:

This was just before or after I jumped on top of the beach ball. It wasn’t as hard as you’d think it’d be since physically speaking, the player has a downward pointing ray instead of legs. And it doesn’t care if the object below it is rotating currently (that will have to change). But when you jump on the ball and it’s in the water, it bobs nicely just like you would expect it to (fake bouyancy rules).

Next up… Well, I’m going to make a minor change to moving/rotating objects in the editor that was suggested to me a while ago by one of the guys at DivMod. Then I think it’s off to make a terrain editor.

I’ve been thinking about indoor scenes for a while now, too. After terrain editing, that may be next. I have some ideas on how to quickly build buildings and stuff.

One final thing that’s bugging me is persistence. Currently, it basically pickles the world to a database. This is pretty slow and happens async, so if the world is dynamic (i.e. players are moving around), then it could be stored in an inconsistent state very easily. Persistence in MV3D is a little odd because the whole foundation of the game is built to avoid having to reload from disk. There is forced redundancy at every level of the game infrastructure with the idea that whenever a server goes down for maintenance, another server will take over for it seamlessly (this is more than an idea at this point, it’s already working :) ). However, during development, it would be handy to be able to keep a persistent world going even though I don’t have the hardware for redundant servers. Plus, it’d also be nice to have something to fall back on if the primary and all secondary servers for a section of the game world ever explode at the same time. Anyway, I’m actually leaning towards using pickled files on local storage. Yes, I know. That sounds pretty dumb. But consider the requirement that there are currently 10 or so types of game objects. Each one has completely different data to store, and the game is structured in such a way that more object types can be added without restarting the server or anything. Unless there is something I’m missing, that doesn’t translate well to a database.

Anyway, enough ranting. Back to work!

July 9, 2007

Boing! Splat!

Filed under: Uncategorized — SirGolan @ 9:46 pm

What goes Boing then Splat? My recent additions to MV3D do.

First off, I’ve made a bit of a shift in the way I’m going to finish up the core MV3D stuff. Instead of trying to build the rest of what I think is the core functionality, I’m making some content and building up core functionality when it becomes necessary.

So, the beach ball goes Boing. Or… At least it will once I give it some sound.


Eventually, you’ll be able to kick it and throw it, but right now, you’ll have to be satisfied by knocking into it to get it rolling. I actually played some soccer with myself while logged in on two computers. It floats in the water of course.

The terrain goes splat. As in alpha splat, a method that MV3D will use to make grass blend into dirt and dirt blend into rocks and so on as far as the terrain texture goes.


The beachball and terrain textures are part of the first MV3D module. Basically, nothing having to do with them exists in the main MV3D code. They live on an HTTP server and the MV3D server downloads what it needs (server side Python files) and the client downloads what it needs (client side python files, textures, models, etc). The server knows about everything because assets are defined in it telling it the URLs and other info.

So in the in game editor, I clicked “Add Object” and selected “BeachBall”. The server didn’t have any of the code to the BeachBall until after I hit “Create”. The client also doesn’t know about beach balls and once the server adds it, it gets sent to the client and the client downloads the code for it. All in all, I’m pretty happy with how that works.

The idea is that not every server has to know about every type of object in the game. If the server needs to know, it just downloads the python files that are required and that’s that.

Powered by WordPress