wip

Usually I don’t post projects until they’re finished, but occasionally I’ll preview something, usually right here.

For example, here’s the game I’m working on for the Ludum Dare 26 this weekend:

Hadron (version alpha-01)

And since the comp theme is “Minimalism”, here’s a more Mondrian-esque screensaver mode:

Hadron-a02

No, it’s not a game yet. More like a weird screensaver. Check back later, I’ll update this page the next time it’s interesting to….

Third screensaver version. This is pretty much the look I wanted…now I just need to make it a game. About 25 hours to go….

Hadron-a03

Still not a game, but the particle-antiparticle explosions look nice:

Hadron-a05

Generally it’s best to start a game design with the gameplay, and polish the visuals last. For this project I started with the visuals and left the gameplay for last. Kind of weird, I know. It’s fun, though, just following inspiration and letting the concept evolve as I go. (Last night I did figure out how the game will probably work, but it’s not implemented yet.)

Particle-antiparticle interactions, but no player interactions!

Particle-antiparticle interactions, but no player interactions!

 

 

Today’s been a slow day for this project. The time remaining before the main Ludum Dare deadline is about the same as the running time of On Her Majesty’s Secret Service: a good long while, but probably not enough to make this into a fun game.

Conveniently, the Ludum Dare organizers have thoughtfully provided a fallback: the Ludum Dare Jam adds a day to the deadline and relaxes some other rules, for the sake of inclusiveness. Since this is my first LD and I’m doing it for the fun and challenge, not to win, I have no problem falling back to the Jam’s more lenient deadline tomorrow night, if that’s what it takes to make this project into something fun.

Meanwhile, I’m starting to pin down the actual particle physics. What you see in the demos above is a bluff: I wrote some equations that, at a quick glance, look like physics equations. mass-1 times mass-2 over distance-squared, sort of, except if you looked closer it was all wrong math. I figured I’d replace it with real math later…but when I ran it — my made-up math — it actually looked pretty much how I wanted it to. So I put off fixing it up. Today I cleared away the clusters of particles and tested it on individual pairs of particles. Guess what: it really is all wrong! It behaves crazily, as I “designed” it to. But with a big mess of particles on screen, the craziness all cancelled out, and it looked right.

Fun stuff. It’s that kind of emergent behavior that makes a project like this interesting to program. But I really do want sensible behavior, so now I’m playing with equations more like the real ones. Here’s a quick demo of some like particles repelling each other.

Hadron-a07

And here’s the fun one, electrons and positrons. Opposites attract, then annihilate each other in a burst of gamma rays! Like Romeo and Juliet:

Hadron-a08

It didn’t turn into a game by the main Ludum Dare deadline, but I like how this project is going, so On with the Jam!

Jam for the Ludum Dare Jam

Jam for the Ludum Dare Jam

It’s not much like the gameplay I have planned, but this update has a bit of user interaction, so it’s maybe a bit more interesting than the screensavers I’ve posted so far. Here, after clicking the ‘Charge!’ button, you can type ‘x’ to enter Experiment Mode. Random particles will stop forming, and you can create little test patterns of particles with the number keys. They do little square dances as their charges interact, and sometimes they explode. It’s sort of charming.

Press ‘x’ again to return to random particles forming and no game. Looks just like all the earlier versions, but this time the particle behaviors actually make sense.

Hadron-a09

It’s a game! With under two hours to go, I’ve got something that technically counts as a game. You can snag particles and hold them together. Hold one proton near one electron for about one second, and you discover hydrogen.

Hydrogen: Discovered!

Hydrogen: Discovered!

Now I just need to allow you to discover other elements, and then tune it for playability as much as I have time to.

…and it’s DONE!

Not tuned as much as I’d like…not tuned much at all…but it basically works.

Hadron_1_02

Um, except suddenly it doesn’t work online, only offline. Hmmm. Stand by….

Hadron-1-03

Nope, still broken. Something’s up with the preloader. So all my hard work is hidden behind some stupid glitch. Yay! Stand by, I’ll fix it eventually.

Anyway, it’s submitted for the Jam but I won’t go into detail and post the link…until it actually RUNS…sigh.

…and finally, after tearing out the preloader and putting in an old one I trust…

…and after fixing some stuff that randomly broke while I was doing that…

…it runs! Whew. So finally you can play it.

Check it out:

Hadron the Uniter — entry page at Ludum Dare 26

Hadron the Uniter — home page at dan-efran.com

And here’s the source code (and Flash file and sound files) in case you want to see how I did it:

Hadron-source-1-1-2

(Note: This is published source, but not open source. I encourage you to read it and learn something from it, but please don’t copy it into your projects. Write your own, it’s more fun! This is hasty code anyway, not really the kind you want to borrow.)