MV3D Development Blog

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?

January 25, 2007

Posting To LJ Fixes Things

Filed under: Uncategorized — SirGolan @ 4:41 pm

So, a few hours after I made my last post, I figured out the problem– using the PyOgre-ish CEGUI Callback method in Python-Ogre does some serious stack trashing. I have to use the Python-Ogre way of doing it, which is annoying. To specify a callback, you pass two args, a object and an attribute (as a string), so the callback gets called like this: object.getattr(attribute)(args). Annoying.PyOgre did it the sane way.. Just pass a function reference to it. It seemed to work to pass the function as the “object” and a blank string as the attribute, but apparently, that was doing really funky stuff that wasn’t immediately obvious. [I mean, really funky. I was making the first line of the callback function be a “return” (which should end the function there), but the rest of the function was being run!]

Anyhow, while I’m recompiling Python Ogre on Linux, I really wanted to take a moment and ask some of the frequent MMORPG players about this statement I saw on a MMORPG related forum:

“In [MMORPG Engine], items are expected to exist only in inventory, so they have an icon but not a display context. Items are also only created in the inventory manager, whereas the world manager needs to know about objects that are in the 3d world. ”

Is this the norm? Do you have stuff in your pockets that you can’t just drop on the floor in most MMORPGs? If so… Odd. I can sort of see some reasoning behind it– you don’t want people leaving junk all over the place. Seriously? Why not have a garbage collector that picks up all the stuff that’s been sitting around?

Someone in that thread commented that allowing people to drop stuff on the ground has lead to item duplication issues. Maybe that’s another reason against it. Seriously? It is pretty sloppy code if you can duplicate items through dropping and picking them up. In MV3D, an item doesn’t leave the game if you pick it up. (um. aside from the fact that there is currently no ‘pick up’ or ‘drop’ code at all in MV3D yet) You pick something up, and the same data that represented the object still represents the object. Doesn’t matter if you stuff it in your backpack or anything– it’s still the same object.

That’s all for now, though noticing ’s recent post, feel free to ask me to show you a picture of what I saw on my way to work this morning. :)

January 24, 2007

Still here..

Filed under: Uncategorized — SirGolan @ 2:07 pm

I’m still here. Still working on things. Mostly, I’ve been split between trying to get Python-Ogre to compile & run on Linux (it runs now– sorta), and converting MV3D to work with Python-Ogre (in Windows). It has been very frustrating to the point that I could have put together my own Python Ogre wrapper by this point. Right now, I have an “Unidentifiable C++ exception” that is causing the game to crash when you select a PC to use.

I haven’t been able to give MV3D my full attention lately due to various other things going on, but still, I have spent a lot of time on this one task that should have been simple.

« Older PostsNewer Posts »

Powered by WordPress