JF make 347
JF Nav
JF Nav
Creation Date: 2004-04-11
Today I did two useful things. Neither see results today or likely even a few days. But I'm starting up a very good (and hopefully productive) few weeks.

Following my code of full disclosure and free information, I wish to publish my preliminary algorithm so that anyone can work on it. I imagine that the code will be useful for machine vision, artificial intelligence, pathfinding, and forensics as well as many other interesting applications. This algorithm has probably been done before, but I'm happy that I'm the first to produce a page with these functions (believe me, I've looked).

So the situation in which this would be used is a particle in motion under Newton's Classical Mechanics (billiard-style physics). It comes to rest by accelerating over two periods of time: one where it aligns the first and the second where it accelerates directly against the velocity. It has conditions that need to be met for it to come out with a reasonable answer. It requires many inputs. There is one square root function required. This is fine since it will be done on a relatively few number of particles in design time. However, it should be possible to do a medium number of particles in real-time on a mildly fast cpu.

Below you will find the algorithm.

Full Stop Algorithm for Accelerated Particle

Known: p0, v0, p1, v1, dt2, |va|
 Find: a0, aa, va, pa, dt1
v1 == 0

pa = p0 + v0 * dt1 + a0 * dt1 * dt1 / 2
p1 = pa + va * dt2 + aa * dt2 * dt2 / 2
va = v0 + a0 * dt1
v1 = va + aa * dt2

va.va = v0.v0 + 2*v0.a0*dt1 + a0.a0*dt1*dt1

A = a0.a0
B = 2*v0.a0
C = v0.v0 - va.va

dt1 = (-B +- sqrt(B*B - 4*A*C))/2*A

pa = (p0 + v0 * dt1 / 2) * (dt2 / (dt2 + 2 * dt1))

p1 - pa = va * dt2 / 2
va = (p1 - pa) * 2 / dt2
aa = -va / dt2
a0 = (va - v0) / dt1

My Bachelor's of Science in Physics really helps even though it still takes me a lot of time to get something right. It took me 3 hours today and 2 hours on Thursday to produce this on top of the ~100 hours to write the AltSci3D Path Engine (with artificially intelligent pathfinding included) which this algorithm will be implemented in. Specifically, it will allow full stop in Anime Director, which is a terribly important algorithm which hasn't been needed until now since Anime is at the bottom of my list. It came to the top of my list because Mission 1 of Hack Mars needs a scripted sequence where the character gets out of bed and walks from place to place. Imagine if a person could not stop once they started walking -- or worse, driving. Vroom, vroom, errrrr, squeeee! Crash, boom! SPLAT!

The second thing I worked on today was an xml to mysql converter for php. Yeah, I was thinking of switching my backend to mysql. The xml file is currently 2.2 MB. While that isn't a lot, it's slow to load and save. A fast database would definately help that. So, I'm not yet ready to switch over. I still see the positive aspects of xml. For one, it's entirely kept in a file. There is no configuration necessary (except compiling php), no graphical interface, no command line interface, no web interface necessary. The interface to the xml file is any text editor. I use Kate for KDE/Linux because it's very useful. Compared to mysql's command line interface, it is good. It is about as good Microsoft's SQL interface. But that isn't a very good interface. A good daily use interface is a web interface like the one I'm typing this rant in right now. Believe it or not, the textarea tag really beats most text editors. Even though the textarea tag is just a text editor minus features, it has a very reliable interface and it lacks tags. If I was editing the xml file, I would have tags every which way. Also, for such a large xml file jumping to a specific record is not easy. The select tag works well for that. But if a web interface is the best interface, the back end doesn't matter, as long as it is fast enough to keep up, right? Exactly. That's why I'm thinking of switching to mysql. So now I can quantify why xml beats mysql: tags are easier to write than an sql query. Check this out:

<AS3D> <Application name="AS3D Anime Director Version 4.0-0.22" title="Javantea's Fate"> <AppInfo> <Scene SID="1" SName="Warehouse"/> </AppInfo> <Video windowed="1" width="800" height="600" bits="24"/> <ScreenShot path="pics/scrnx%i.png" number="48"/> <AppData> <AI name="as3dad1"></AI> </AppData> </Application> <GUI> <Box name="pTitle"> <Rect left="N 0" top="N 0" right="N 256" bottom="N 128"> <Children cols="1" rows="1"/> <Captions/> </Rect> <Texture name="data/gui/as3dmd4c.bmp" tu="1" tv="1"/> </Box> <GUI> </AS3D> The above is truncation of an actual xml file for AS3D Anime Director. Could you imagine the fucking hell that would be the database that could explain that and more? Object tags, Path Cues, Lights and such would be horrible to put into mysql. Then think of putting a mysql loader into a video game. You can almost see me cringing at the thought of it, right? XML allows me to take one file or one string and send it to a parser that instantly turns it into accessible data. It works well with object-oriented system because of the way xml is designed.

Last night I went to a really good rave. Seattle has a good rave scene, so I'm fortunate to live here and like techno so well. The last two raves I went to have been oriented to Happy Hardcore. I really like the stuff I'm hearing. My first experience with Happy Hardcore was on Kazaa. It is funny that in two days I spent on Kazaa, I found about 50% Happy Hardcore, 25% Trance, and 25% House music. I was looking for Techno and Rave and the pirating masses have spoken: Happy Hardcore is the Rave. I agree. I think that P2P is doing a great job of informing middle class young people about music. It is free, in privacy of your own home, efficient, high-quality*, and on-demand. This is an amazing combination and I think that if the free went away, a large number of people will still be happy to spend a reasonable price on them. There is an excuse out there that record sales are going down to the tune of $2M (15%, which is quite substantial) because of rampant piracy. But I think a greater part of the change is due to people becoming educated about what they buy. A person will be unwilling to buy a poor album (which the industry seems to be producing more of) when the one fad song is played on the radio 12x per day. Also, the economy is in recession (a jobless recovery is not a recovery at all) which would explain why people are tightening their belts.

*The music on Kazaa is high quality except the little clicks every once in a while. I imagine it is due to the lack of checksum; from time to time, bits can get flipped. Those clicks are really a good advertisement for crypto checksums. It would be wise for download programs and servers to build in this functionality. Bit Torrent has SHA1 built in, which is quite cool since it could function without. Whether SHA1 keeps Torrent's malicious lusers honest is up to debate. But I can vouch for SHA1 doing its job: ensure that my Slackware 9.1 Linux ISO download is flawless.

For more information on the above topics (especially the path physics), feel free to e-mail me. I don't get much feedback, so I'm always hoping for the chatty IRC bot to mail me.

I don't put text of my e-mail on any of my newer rants because I don't like spam very much. So simply type in the e-mail address above in your favorite e-mail client.

If you are blind, please refer to my link to mail or ... maybe google my site for jvoss... or maybe m y u w ... not dot net? naw. Oh, well.

Home Characters Making Of Technical Mail News Links |< First < Prev Next > Latest >|  bandwidth version Goto Scene