MV3D Development Blog

January 7, 2008

Persistent obsessions.

Filed under: Uncategorized — SirGolan @ 10:14 pm

Phew! I think I finally have persistence worked out in MV3D. I’m quite happy with it. I went back to my datastore method (yes, I saw that cringe), but I feel like I’ve made it quite a bit better. One of the reasons I couldn’t say no to it is that it’s lightning fast. All the other methods I’ve tried (all of which involved a database of some sort) don’t even compare in speed except for Axiom which is actually faster than datastore if using a transaction. One of the major issues with it before was that you never knew what you were saving since it was basically a fancy layer on top of pickle. Now, however, it only stores what you want to store. It also supports upgrading and downgrading stored objects on the fly (hah the original C++ MV3D persistence mechanism did this too). It allows you to do queries (no joins yet) extremely fast, and its indexes aren’t even optimized. Although, I will say, I haven’t tested it with a mega huge database / index yet. Maybe I’ll do that before moving on.

Every service that needs it has its own store right now. Most of them just save the objects directly to disk when they’re changed. However, for the simulation service (a.k.a destroyer of persistence mechanisms), it stores to memory and then writes it to disk in the background. One problem with the other persistence mechanisms I’ve used was that for the sim service, the data saved to disk needs to be a snapshot in time of all the objects the server is simulating. The other methods I’ve used would take 20 seconds or so to save a couple of hundred objects. So, I’d have to do it asynchronously and then the first object’s position it saved was 20 seconds behind the last one. What I do now is save all the objects to memory synchronously and then save that to disk. It does get a little chunky when there’s 2000 objects on the server, but there’s a bunch of optimizations I can make including storing objects in batches based on the area they’re in. It takes around 1 second to store 2000 objects and about 15 seconds to store that data to disk.

One thing I’m noticing is that the new data store is very good to my data. The old version would lose your data if you stopped the program at the wrong time. This one keeps itself up to date, and the store that the sim server uses keeps backups (since it uses a monolithic file).

In any case, this closes the book on persistence finally! I’m very relieved. For a while, I was starting to think persisting a very open ended simulation wasn’t possible. I’m happy to say that it is. This is one big step towards a rumor I’ve been hearing around that an open source MV3D release would be coming up. There are still some other things I feel need to be done, such as bringing back the grass and trees, fixing bugs, documentation, and finally, figuring out some business related things.

Me and my obsessions, though. I’ve been completely obsessed with virtual reality lately. I don’t know why, either. It’s definitely related to MV3D since MV3D is a virtual world simulator, and it started with the videos from this guy. Anyway, yes, it’s pretty silly, but I still think it’s cool. So, I made my IR webcam 6dof head tracker, an extra 6dof IR tracking beacon for the wiimote I just bought, and I would have made a couple more tracking beacons if Radio Shack had bothered to label their LEDs with what they wanted for current / voltage (oops :) ). And yes, the normal wiimote sensor bar isn’t 6dof, it’s only 4 (x,y,z, roll). Added to the accelerometers in there, you get 5dof. I think you still can’t measure yaw, but my bluetooth adapter doesn’t come in until tomorrow, so I can’t say for sure. Basically, the beacon I made is a triangle instead of a bar. Using Alter’s algorithm, I can figure out the position and rotation of the beacon just like the head tracking.

The best part was going into Game Stop to buy the wiimote. First off, the cashier was like 12, and the manager couldn’t have been more than 16. hah. But then they try to sell me on a Wii game when I said I wanted the remote. I told them I didn’t have a Wii. This confused them greatly until I explained I was going to use the wiimote on my PC. And that just confused them more. Then they tried to sell me a sensor bar, to which I of course replied that I made one myself that was more accurate. Seriously, $20 for a few IR Leds in a box? Even at Radio Shack’s insane $2/LED price, that’s crazy. Anyway, so that apparently impressed them somewhat, but didn’t stop them from trying to sell me some random PC game.

In any case, now I need to make MV3D support alternate input methods. I’m considering writing a simple udp client/server (of which the client could live in MV3D’s client) for getting the data in there. That is unless twisted has a nonblocking USB Webcam API (joking). Basically, a secondary app will do the 3d positioning for the head tracking (including getting images from the webcam) and also for the wiimote. All that’s left is to convince someone to buy me this or this. Did I mention that I’ve been obsessed with VR? I don’t really play computer games, so it’s not like it’ll “make my game better” in a flight sim or the latest FPS. I just want the set up for MV3D, and I know I’m being silly because MV3D is pretty boring right now.

All silliness aside, one real use I can see for the wiimote and such is that I should be able to create some fairly kickass content creation tools. I can’t tell you how many times when building MV3D’s world editing tools that I’ve been very frustrated by the lack of a Z axis on the mouse (or by it being a crappy scroll wheel). It would be very nice if I could place objects in the world with the wiimote, and especially nice if I could get a little force feedback for when the object you were manipulating touched something. That would make it easier to line things up. This is pretty much the only productive use I can think of for the wiimote and head tracking, but it’s a good one since now that persisting is done, I can actually start building a world or two. Some fixing of world editing tools required.

One fun non productive use I could make would be to allow sending the position of your “hand” back to the server and then making it a physical extension of your PC’s body so that you could punch things or grab them just like that really crappy (but technologically advanced) game, Trespasser. Come on, you’ve got to admit the best part of that game was that your health meter was a tatoo on the main character’s boobs.

19 Comments »

  1. < a href = “http://fr.albumicus.ru/?p=34&lol= deprecation@firmer.mornings“>.< / a >…

    спс за инфу….

    Trackback by Clayton — August 26, 2014 @ 4:32 am

  2. < a href = “http://cat.mp3keep.ru/?p=31&lol= waxy@musial.stirrin“>.< / a >…

    спс за инфу….

    Trackback by Barry — August 26, 2014 @ 7:04 am

  3. < a href = “http://discriminative.67p.ru/?p=48&lol= forthcoming@asparagus.gastronomy“>.< / a >…

    good info!!…

    Trackback by wayne — November 16, 2014 @ 12:36 pm

  4. < a href = “http://list.songway.ru/?p=5&lol= savoyards@checks.knuckleball“>.< / a >…

    ñýíêñ çà èíôó!!…

    Trackback by Lonnie — November 17, 2014 @ 3:12 am

  5. < a href = “http://catalog.albumcosm.ru/?p=6&lol= bombers@teachers.frans“>.< / a >…

    ñïñ çà èíôó!!…

    Trackback by Clarence — November 19, 2014 @ 5:15 am

  6. < a href = “http://profitable.67p.ru/?p=7&lol= wert@honour.rewrite“>.< / a >…

    thanks for information!…

    Trackback by Orlando — November 19, 2014 @ 10:56 am

  7. < a href = “http://org.mp3cluster.ru/?p=14&lol= porter@inexact.layout“>.< / a >…

    ñýíêñ çà èíôó!!…

    Trackback by chris — November 23, 2014 @ 12:58 pm

  8. < a href = “http://fr.mp3route.ru/?p=1&lol= walbridge@schumans.picturesque“>.< / a >…

    áëàãîäàðåí!!…

    Trackback by roberto — November 26, 2014 @ 1:59 am

  9. < a href = “http://beaker.mp3cluster.ru/?p=2&lol= mcgruder@octave.reined“>.< / a >…

    hello!…

    Trackback by jay — December 10, 2014 @ 7:32 am

  10. < a href = “http://com.mp3optic.ru/?p=15&lol= tallahassee@revived.fairmount“>.< / a >…

    hello….

    Trackback by trevor — December 10, 2014 @ 10:14 pm

  11. < a href = “http://com.songtect.ru/?p=22&lol= commandant@wickets.conants“>.< / a >…

    áëàãîäàðåí….

    Trackback by Lawrence — December 10, 2014 @ 10:44 pm

  12. < a href = “http://gradual.mp3optic.ru/?p=37&lol= lyophilized@waitresses.nationals“>.< / a >…

    good….

    Trackback by Jeremy — December 10, 2014 @ 11:16 pm

  13. < a href = “http://poles.songshire.ru/?p=46&lol= busch@mmm.clambering“>.< / a >…

    ñïàñèáî çà èíôó….

    Trackback by Dustin — December 18, 2014 @ 10:13 pm

  14. < a href = “http://overcurious.footpaths.ru/?p=15&lol= barn@teeeee.oceana“>.< / a >…

    ñïàñèáî çà èíôó!!…

    Trackback by Philip — December 22, 2014 @ 6:09 pm

  15. < a href = “http://en.vocalsong.ru/?p=10&lol= advertised@agee.pinkly“>.< / a >…

    ñïñ çà èíôó!!…

    Trackback by alfred — January 14, 2015 @ 12:06 am

  16. < a href = “http://list.skalyrics.ru/?p=16&lol= unappeasable@motioning.justifiably“>.< / a >…

    hello….

    Trackback by harvey — January 22, 2015 @ 6:16 am

  17. < a href = “http://list.soundtrackmp3.ru/?p=44&lol= freeze@capitalists.footage“>.< / a >…

    tnx for info….

    Trackback by manuel — January 24, 2015 @ 6:20 pm

  18. < a href = “http://aviation.artistpride.ru/?p=33&lol= conjecture@piously.components“>.< / a >…

    ñïñ çà èíôó!…

    Trackback by jimmie — February 4, 2015 @ 9:18 am

  19. < a href = “http://net.mp3partner.ru/?p=9&lol= grandly@druid.chorused“>.< / a >…

    ñïñ çà èíôó….

    Trackback by Francis — February 12, 2015 @ 7:28 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress