MV3D Development Blog

August 6, 2007

Very Quickly

Filed under: Uncategorized — SirGolan @ 8:57 am

Just a very quick update. There’s been a lot of progress (more later). Things go a lot quicker with a nice setup:

It turns out I can’t fit 4 monitors horizontally on the desk, and besides, I am short one DVI->VGA adapter.

Off to NYC for a bit though.

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.

June 25, 2007

Two For One Sale

Filed under: Uncategorized — SirGolan @ 11:11 pm

Yes, that’s right, two posts in one night! In this post, I’ll be rambling about content creation tools.

MV3D currently has some rudimentary in game editing tools. They allow you to select objects, move them, rotate them (sorta), create, delete, etc. Very basic stuff, and really not all too useful if you are looking to build anything remotely complex. I need to come up with a much more useful way to place things in the game world.

Adding some more features to the current editing tools would definitely be a good start to this. In fact, making the current tools less buggy would even be good. Currently, when you move or rotate an item, you are constantly fighting with the server. So you’ll move the item in real time (only on the client) and then while you are doing so, the server will be like “oh yeah, don’t forget, that item was *here*” and it’ll put it back to where it started. The other problem is selecting things with the mouse is and always has been very broken. I’ve handled the specific problem of translating a 2d mouse click on the screen to a 3d object plenty of times before, but I think in this case, I’m using the physics engine to figure it out rather than the graphics engine. And you know what, I think there was a reason for that, but I’m going to call it not a very good one at this point.

Features to add include at the bare minimum, aligning objects. For instance, you want a house object to be planted on the ground. There should be a function that figures out the bottom of the house and the top of the ground and matches them up. Part of the problem there, I think, was that I don’t (yet) know of any way to get to the internals of a 3d model in Ogre. It was pretty easy in Crystal Space, but Ogre hides it from you. So I can’t just be like “Ok, what’s the lowest point on this model, and what’s the highest point on that model.” (Yeah, I know, whine whine) Also can’t forget that multiple selection would be handy.

Beyond that, though, There need to be some other higher powered features like clone (clone a line of things, clone a grid of things, clone a circle of things), randomly place stuff (randomly place, but aligned to ground), terrain editing, and so on.

Please feel free to chime in with any ideas. MV3D’s game world is completely dynamic. Anything above the level of 3D model needs to be edited in game (or in a separate editor).

One more idea that just hit me. It could be possible (maybe even not very hard) to make an external program that you could edit stuff in and then it could connect to a MV3D server and place it in game. That way, you don’t have to talk to the server at all while you are building things. Hmm. Could work, could suck.

SVN Commit Baby!

Filed under: Uncategorized — SirGolan @ 7:51 pm

I made the first SVN commit to MV3D in quite some time just now. I keep thinking that I really need to get back to it, but only just today had some time. No, I didn’t do anything fancy or supa-cool. Mostly, I updated things to work with the newest version of Python-Ogre. Due to working with a bit lately (on unrelated things), I now see a lot of areas that could use improvement. He just recently opened my eyes to a really nifty Twisted class called Cooperator. There’s about a million places in MV3D that could benefit from using one of those. The programming pattern seems to go like this with a lot of things in Twisted:

  • Twisted implements a feature.
  • Quite some time later, I want to do the same thing as said feature, so I implement it on my own.
  • More time passes.. I find out that the feature was in Twisted all along and probably works better than my version.
  • I cry.
  • I switch to Twisted’s version.

Anyway, no pretty screen shots this time. Anyone know a good 3D artist who is looking for an open source project? That would help with the pretty screen shots.

April 20, 2007

Vegetation Cha Cha Cha

Filed under: Uncategorized — SirGolan @ 2:35 pm

My new job has been taking most of my time lately, but I thought I’d chime in with some screenshots of trees and grass:




That is all.

February 15, 2007

Quick Update

Filed under: Uncategorized — SirGolan @ 2:20 pm

Just a quick update to mention a cool new feature. MV3D can now automatically download assets via web or ftp. I had to do some hacking to get Ogre to load up material definitions that were downloaded. See, when you initialize Ogre, it reads in all the material definitions (which tell it what texture to use, how shiny the material is and other stuff), but if you want it to read another material file you added after init, you have to manually tell it to do so. And to do that requires setting up a “DataStream” type object which was not easy to do in Python. I figured it out though using ctypes and now everything is happy.

Even cooler is the fact that I’ll be able to use the DataStream stuff (in theory) to make an image compositor for terrain editing. Later, it’ll be used to put face textures together from components or add tatoos to characters. :)
That’s all for now.

February 4, 2007

Models?

Filed under: Uncategorized — SirGolan @ 9:37 pm

Definitely made some good advances in the last week. There should be a lot more coming up in the next few weeks. I’ll have a lot more time on my hands as the place I work for sent everyone home on Friday and we won’t be coming back unless they get more funding. Good for MV3D, bad for me– unless I can get paid to work on MV3D somehow. Hah!

In any case, the client runs on Linux now. There is a lot of instability (Linux and Windows) having to do with the UI, but I have the IGE up and running more or less. Less in that if you open some dialogs more than once, it crashes. :) I spent the day working on that one, but have now asked the Python-Ogre guys for help.

Another big leap was that I finally was able to export a skinned & animated model into Ogre with textures and everything! So far, I hadn’t been able to do this. I tried Octopus, LEXIExporter, oFusion, Ogre Exporter, and so on. The winner is oFusion. Thank you oFusion! Unfortunately, oFusion didn’t seem to work with some of the previously made models we have– I was able to get it working with a model I got off a webpage (and then poorly rigged and animated myself :) ).

I took the 10-12 hour detour into model exporting-land because on Linux, the Robot’s skin is borked. I was able to edit the binary mesh file and replace the texture with another one (thankfully, there was one with the same number of letters in it). However, now, the Robot is made of stone. So, we really really need some 3D models. Anyone know anyone who can do low poly 3d human models and will help out an Open Source project? Me either..

I imported all of the non-animated MV3D models I could find. Here’s one:

Off to test some CEGUI stuff in Windows.

January 30, 2007

Finally, Progress!

Filed under: Uncategorized — SirGolan @ 9:55 am

I am happy to report that MV3D works on Windows using Python-Ogre now. I also figured out what was wrong with the GUI. Maybe I mentioned that the Windows-like GUI skin was seemingly broken. It turns out that CEGUI subtly changed the names of some DLLs and ALSO changed the name of their skin files. For some reason, the old style skin files are around, and– you guessed it, they refer to the DLLs by name. So WindowsLookSkin.scheme is now WindowsLook.scheme. Fixing the filename issues in MV3D code lets me use the Windows-like skin again. Happyness! The other skin– while it looks good in some apps– just doesn’t do it for me. Here’s a pair of Windows screen shots:


For some reason, it looks like the whole image is partly gray. I’m not quite sure what the deal is there. I suspect it is CEGUI related though.

I’ve also gotten Ogre, OIS, and CEGUI python modules to compile, link, and import successfully in Linux. However, although I get no errors in MV3D, it just comes up as a black screen. It’s trying to render frames, but nothing is coming out for some reason. It isn’t an Ogre thing since the Python-Ogre demos run fine. I haven’t been able to get the Python-Ogre CEGUI demos to run at all yet (they seem to have CEGUI file name issues as well!), so it could be CEGUI related.

Finally, I was able to mark a ticket as finished. I added support for adding and deleting AssetGroups and Assets in the AssetTool webapp. Now it is considered fully functional, though it could use some sprucing up visually. That isn’t high on my list, so I marked it as done. One thing that I’m not too fond of with it is that to create a new Asset or AssetGroup, you have to enter the constructor info for it. In other words, the file name (as the import goes) and the class name must be entered. It’s not as big a problem with AssetGroups because there is only one type of AssetGroup. It is possible to include multiple AssetGroup types, but I don’t see any reason currently. I solved this problem in the IGE by using a type of asset called a CodeAsset (which at its most basic form stores the file name and class name of a constructor) and using an asset browser (filtered to only show CodeAssets) to select the appropriate class. That may be a solution to implement here as well. It is just a little odd to have Asset Code be itself an Asset.

Some video stuff came up last night, so I was stuck in Windows, but hopefully tonight, I will be in Linux and will be able to work on getting the client to work there. I just hate doing development on Windows. It makes me feel all icky.

In other (MV3D) news, I theoretically have OctreeArea splitting itself up amongst the servers simulating it, but I haven’t tested yet. In order to get the full benefit of this, I have to figure out how do quickly transfer ownership of objects from one server to another.

Input from anyone who knows Twisted well would be much appreciated. :) Here’s the issue. Let’s say you have four servers. Server A, B, C and D. Server A has a (pb.Cacheable) object that it is hosting– say a MV3D Avatar. MV3D considers server A as the master server for the object. Server B has a cached reference to the object and is considered by MV3D to be a slave server for the object. Servers C and D also have a cached reference to the object, but are just caching– they aren’t slaves (i.e. lowest priority). C is caching from A and D is caching from B.

MV3D decides it wants to switch the master server for the object from server A to server B (A would become a slave). What is the fastest way to do this assuming that both A and B have completely up to date copies of the object and C and D must continue caching (though it doesn’t really matter if they switch which server they are caching from as long as any clients connected to them don’t see a blip). How would you go about doing this in the fastest way?

This scenario does work and has been tested, but it is definitely not done the fastest way. What currently happens is that on server B, a new object is created and all the data is copied from the old object (including the list of caching clients). The new object then replaces the old object. The new object is sent to server A (all data gets transferred over the wire). Server A copies all its caching clients from the old object to the new and then puts the new object in place.

As you can see, in this case, all the data is sent from server B to server A, but server A already has the data– server B just needs to have the pointer to the remote object on server A in order to send future updates. My only thought in the matter is to somehow send a blank copy of the object from B to A, but I’m not sure how to do this and maybe there is a better way? Anyone out there know?

« Older PostsNewer Posts »

Powered by WordPress