MV3D Development Blog

December 26, 2006

aqqqqqqqqqqqqqqqqqqqqqqsw (this subject brought to you by my cat)

Filed under: Uncategorized — SirGolan @ 10:19 pm

There has definitely been more frustration lately. I’ve been trying all week to get Python-Ogre to compile. It’s a very new thing, and the developers have concentrated on Windows so far. The good thing is that they’ve been in constant communication with me to work through the problems– even on Christmas day! It is getting closer. The cool thing about Python-Ogre is that it uses Py++ and aparently, Py++ automatically wraps C++ code based on rulesets you define. That way, as long as Ogre sticks to its coding conventions (i.e. function names and such), then additions to Ogre will be automatically Pythonitized. But, the problem is getting things to compile. Once again, since it’s a new project, there is little to no documentation. Not much in the way of helpful code comments either, unfortunately. This has really slowed my progress this week as I broke my PyOgre installs on Windows AND Linux trying to get this stuff working. So unless I use one of my laptops, I don’t have a working MV3D client. Yes, I said Python-Ogre is working on Windows.. However, there are a lot of little tweaks that need to be done to get MV3D working on it. Part of the problem is that it is for the newest version of Ogre, and there are a bunch of API changes there. But it also doesn’t yet have the cool transformations of 3 tuple -> Ogre Vector3 classes and things like that. I’ve mostly compartmentalized my Ogre code, so there aren’t all that many places where those things come up luckily. Anyway, there is still more work to do. The Windows client (where I’ve been doing the updating) doesn’t even render the first frame yet….

On the flip side, my web-based Asset Tool is coming along well. By well, I mean it is almost to a good stopping point. It is usable right now. You just can’t delete assets and asset groups or create asset groups. There also aren’t yet extra properties for the various sub-types of assets (but the structure is there, so adding them is fairly simple). There is something I find really cool with the way the app works. It is a web app, but it connects to a MV3D server to build the pages. Yay for Twisted! One day, I want to make a web app that works like an in game web-cam, but something that may be more useful is an app like the Asset one that allows you to edit object properties instead. That would be pretty useful. Either way, it is very cool to have a web app the connects to a running game server.

I think with the broken clients, I’ll try and hit on the server things that I’ve been putting off: DB Performance, Area Sharing between servers, and stuff. If I get bored, I can always go back to Windows and continue porting to Python-Ogre.

This week, I happen to have a video projector and have set up a home theater for it. Naturally, I had to log in to MV3D on the 6′ x 6′ screen. It was pretty cool, though it would have of course been much better if there was actually something to do in the game other than walk around and jump into the water.

Hope everyone’s having a good holiday season!

December 21, 2006

Frustration, cha cha cha.

Filed under: Uncategorized — SirGolan @ 10:35 am

I was able to speed up the Noise generator by caching the pseudo random numbers. It seems like random.seed() is very slow, and I was calling it about a billion times. Anyway, the whole thing is 10x to 100x faster now. Not quite fast enough for generating a 2d noise image every frame, but usable now.

I got the server application to run on Windows. You don’t get the ability to use a database (though I suppose if I were to install MySQL and its Python bindings, it would probably work on windows.) I also have some Windows screen shots (the water is actually blue!). These detail my playing around with the in game editor:

A cube and a few robots floating in water:

And my favorite– a picture of a fish:

Things were very stable, and therefore, I updated the alpha server and made up a Windows client build for all the testers.

Why am I frustrated, you may ask? In my last post (or the one before?) I mentioned that I figured out how to do bounding boxes for objects. Yes, it’s true, I did, and it was going to be splendidly easy… if the PyOgre folks had remembered to wrap the OgreWireBoundingBox class, which they hadn’t. After giving up on that, one of the next things I needed to do is to have some way of quickly modifying or creating textures in Ogre. I’ll be creating a sort of paint program so you can modify the placement of various textures on the terrain (rock vs dirt vs road). To do that, I need to display the image you are painting to (duh), and for that, it needs to be made into a texture in Ogre. Digging through the PyOgre code, PyOgre wiki and forum, I came up with some code that may be able to give me access directly. It even almost worked. Unfortunately, in the most recent Windows release of PyOgre, the code is not wrapped. Ok, fine, since it was on Linux, I should be able to manually build a newer version of PyOgre. Nope. Many errors resulted. Ok, try it in VC++. Same result. After digging around on the forum, I found this post by the creator of PyOgre. So this means, no more PyOgre updates (there haven’t been any in months anyway). He mentions Python-Ogre, which I have been ignoring even though they’ve been stealing the PyOgre forum a lot lately. Basically, my only option at this point is a) maintain PyOgre myself (while I do have a good amount of experience with SWIG, I am not good ad building code on Windows), or b) switch to Python-Ogre. Looks like it’s option B. They claim that you only have to make a few adjustments. We’ll see. I was finally able to get PythonOgre running its demos in Windows this morning after quite a few hours of annoyances. We’ll see how hard it is to make it work in Linux. Though, before going through that trouble, I will be learning enough of Py++ to determine if WireBoundingBox is wrapped (it should be since Py++ wraps everything supposedly), and if the texture related stuff will work at all.

I may still have to write my own little Python extension.. Something like:

char *Convert(void *a) {return (char*)a;};

Unless Py++ is friendlier than SWIG when it comes to pointers. It’d probably be good to do something simple like that as a basis for other C++ Python extensions I’ll have to write later (for the purpose of speeding things up), but once again, while this may be simple on Linux, I still hate building things on Windows. Maybe VC++ will make it easier, I don’t know.

December 18, 2006

Getting noisy in here.

Filed under: Uncategorized — SirGolan @ 12:28 pm

I implemented a Perlin Noise function (1D or 2D) in Python which is pretty cool, albeit slow as molasses. It should be upgraded to handle 3D and 4D (and to be faster..), but for that, I’ll need to brush up on my Trilinear Interpolation. Have not done tlerping for a while, but I did just notice that article has a pseudocode link. However, for 4D, I’d need quadlinear interpolation (if that’s what you call it). Anyway, what does all of this geek talk do for MV3D? Well, for one, it generates realistic looking terrain:


It can do many other things such as moving clouds, flowing water, and textures that are extremely small to download. Check out Ken’s site for more fun things. Something to mention is that in the first image, there are 4 little dots somewhere in approximately the middle of that landscape– those are the other PCs. :) Also, there is a terrain chunk missing in the corner furthest away from the camera. This is just because it’s out of the view range. Anyway, you may say “But Mike, why would you want to rebuild the wheel on terrain generated by Perlin Noise when 3rd party tools are out there that are extremely good?” The answer is that using those tools will still work, but since my noise function can incorporate arbitrary edits to the output seamlessly and can run inside the client and server, one can send a huge portion of terrain to the client over the network by just sending the parameters to the noise generator along with the edits to apply. That could save tons and tons of bandwidth. The noise generator just needs to be faster.

In other news, I’ve done a lot of work on the editor this weekend and last week. I hope to have a usable version out to the testers some time this week. It is pretty solid right now. All of the buttons work at this point including the properties button and deleting objects. I just finished a properties screen for Biped objects, and will either move on to one for Box objects (so people can change the model associated with them and start some basic world building), or terrains (so that you can adjust the terrain heights). Schubaal helped me out with a better looking image to denote object selection, then this morning, I looked into wire frame bounding boxes a little more closely, and I may be able to use them after all. Schubaal’s image would still be used, just I would also add an additional option to turn on bounding boxes.

Update: It turns out that by taking a good look at how blerping (bilinear interpolating) works, I was able to extend that to trilinear and quadrilinear, so now my fun noise generator can do up to 4D. Really, there should be some way to do Xlinear interpolation (i.e. any number of dimensions), since the algorithms are the same just with added dimensions. For some reason, though, I haven’t been able to wrap my head around that one yet. However, I don’t see the need for >4D, do you?

December 11, 2006

Behold my awesome programmer art!

Filed under: Uncategorized — SirGolan @ 9:55 am

I solved the item selection problem for now thanks to a little help from The Gimp..

No funny comments on where the center of the selection image hits. Well, maybe if they are particularly funny…

All silliness aside, I would like to mention that Ogre really does make many things very easy. It still falls back to my earlier comment that while Ogre isn’t trying to be the all in one game utility that Crystal Space is, it is excellent at what it does do. Making that image pop up was pretty easy and was under 20 lines of code, I think.

I also made progress in making useful move and rotate functions. You can drag things around with the mouse and stuff. I really think they will need to move with you when you walk as mentioned. The fun thing to do now is to select your PC and use the mouse to fly yourself around.

I’m starting to work on the “Add Object” function. For that, I need to add all the object types (biped, terrain, white block, and so forth) as assets and generally make some way to select assets. Luckily, an asset selector that was sufficiently generalized will help elsewhere. Especially if you can tell it to only allow you to select assets of a given type (i.e. images only). After that, I’ll probably hit on either deleting objects (which I’m not certain is 100% supported in the code), or the item properties button.

In other news, the amazing Rik Vargard is back to help out with art. So, this may be the end of programmer art. Rik made pretty much all of the 2d and 3d art in Siegium, including the website. He was also on the MV3D team prior to that and is an extremely talented artist.

Oh yeah, if you are interested, here’s my laptop/server hard drive shown next to a normal server hard drive:

December 8, 2006

Are you bored of world editing yet?

Filed under: Uncategorized — SirGolan @ 2:00 pm

Hopefully, I’ll update this weekend or early next week with some screen shots of the world editor. There still isn’t too much to see really. The toolbar code is more or less finished, and I have a few plugins done– select item from a list and select objects by clicking on them. I also made some button graphics and got them to work. The screenshots are worth it just to see the horrible programmer art on the buttons. :) I’m starting to work on an object movement plugin and then will do object rotation. At that point, the tools will at least start to be useful because you’ll be able to move objects around and rotate them. It won’t be incredibly useful until there is a “create object” button. For that, I need an asset browser and I’ll need to do some work on associating object code with assets.

One problem that I’ve been trying to solve all week is how to signify which objects are selected. Part of the problem is that not all selectable things have a visual representation or even a position. The other part is that I can’t see an easy way to do it in Ogre. My first idea was to display the object’s bounding box. It would be crude, but it would work on things large and small (though not on invisible things). Unfortunately, it seems the code needed to draw a box on the screen in Ogre is several hundred lines long.. And the example is in C++, so it’s not clear if I can do it in Python. So that’s not worth it. Also, you can turn on drawing bounding boxes, but it’s either for all objects or none.

The next thought was to make the selected object brighter or semi-transparent. I can find no way to do that within Ogre. I briefly considered attaching some sort of particle effect to whatever you selected, but if you are selecting 500 things in an area, that could get a little slow. So it looks like I’ll have to resort to making some sort of semitransparent image that I’ll stick on things that are selected.

In any case, showing what objects are selected is fairly important. I’m considering making each object in charge of figuring out how to select and deselect itself– as in it’ll have to put up the image to show it is selected. That way, things without a position can show their selected status in some other way.

As a fun aside, I recently ordered some brand new servers from HP. They just came out with a new “generation” of servers, so this was my first time seeing them. One of the features of the new generation is that you can stuff more drives into them. 6 drives in a 1U (1 3/4″) high server is very impressive, and I’ve been wondering how they pull that off. Today, some of the hard drives came in. They are freaking laptop hard drives! I’m not so sure I like that idea as I usually end up with a big stack of laptop hard drives on my desk that have failed. I guess that’s what RAID is for though.

December 4, 2006

Edit My World

Filed under: Uncategorized — SirGolan @ 12:39 pm

I fixed the bugs in the OctreeArea and moved on to the in game editor. I started to work on some of the multi-server features of the OctreeArea, but didn’t really test them. Mostly, I wanted to make sure that it worked in a master/slave server situation. It does now. I definitely have some thoughts on how to divvy up the octree nodes amongst the servers simulating them, but that may not be the hard part of the whole thing. The hard part will be figuring out how to quickly switch an object’s master server because when a node changes servers, all objects in that node need to change servers with it (otherwise, there is little or no performance gain).

The more interesting part of this update follows. I’m working on the user interface that will allow people to put the game worlds together. This is something that has always been planned to exist within the actual game as opposed to having a separate application. I have some fairly well defined ideas on how it’ll be set up, but I want to open it up to any suggestions from people who read this. So if you have any opinions, speak up now.

I’ve written up some basic ideas here, and asked on the forums here. But in simple terms, let me explain what I have in mind.

It’ll sort of be like a paint program. You have a toolbar that contains various icons (like the “pencil”, “paint can” and “air brush” of a paint program). The tools are organized by sections such as: select, object, area, and realm. Select will contain various means of selecting things (by clicking on them in your view, select from a list, and so on). The others will just have editing related to those game elements.

All game elements will also have a “properties” window. This is something very similar to what you get in windows when you right-click and select properties. Except, the purpose is to be able to manually edit all the properties of the item.

The main priorities for this are:

  • Ease of use
  • Speed of creating things
  • Flexibility and extensibility (I should mention that the toolbar uses a plugin architecture)

Anyway, what functions would you like to see? What things do you think would work well? What features would help you creating a 3D virtual world?

Powered by WordPress