rhunter/evolving-words
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Word Drift is a word game developed as part of the 24th "Ludum Dare", a 48-hour game development competition.
It wasn't finished to a polished state, but I'd like to submit what I have.
Development log
===============
## 11am (48 hours to go)
I wake up and check the theme. Evolution. OK, fair enough. The first thought that comes to mind is clusters of little round cells, growing and evolving to more complex clusters. A bit like a rounded, 3D "Game of Life". I don't want a non-interactive game, though.
A round arena with cells in the middle, and the player fires "evolution rays" or maybe just a destructive "trimming laser" at parts of the growth? Hmm. I like the visual.
How might the cellular growth work? I sketch out some circles and lines, and it looks like a bad soda stick animation. I don't know if I can make this fun.
OK, what else is there? Evolving words?
Nothing new came to me in the shower, so I started work.
## 3pm (44 hours to go)
Finally got my wireframe looking kinda how I want. I probably spent too much time figuring out the CSS for nested lists, considering that I haven't even validated that this kind of game will be fun. Good enough for now, anyway.
Screenshot:
## 4pm (43 hours to go)
Researching algorithms around word changes. Levenshtein distances seem to be the big thing. I start wondering if I'll run into speed issues with naively running through a whole dictionary (~50k words). I wish I was stronger at computer science -- algorithms and data structures might be very relevant here. I wonder about trading off time for space, pre-calculating the nearest neighbours for all of the words.
A quick in-browser test seems that doing string matching over 50k words is quick enough to not notice. 500k is a bit slower but still doable. I guess I can start without optimizing.
# 5pm (42 hours to go)
Decided I didn't need Levenshtein anymore. It'll be easier for everyone if there are no "double jumps" -- every move is exactly one letter to add/change/remove. Coded some simple routines to find words that are one move away.
# 7pm (40 hours to go)
Started putting the pieces together.
Also stopped to order some Thai food delivered :-) Very soon, there'll be enough of a game to click from word to word and follow evolutionary steps. Restrictions and bonuses are a way off yet, but I'll be able to get a basic feel for the game.
7.30 terrible news! now that i've assembled enough of the game to be playable at all, it turns out that the game i had in mind probably won't work.
For a start, there are no words close to amoeba. :-( Also, it's actually really hard to go where you want. It's hard to scan for a useful word in the grid layout for possible "next" words.
Also, it seems like I've lost Internet access. The neighbours have secured their wifi and my housemate isn't around to ask for our password. I've still got my phone.
# 8pm (39 hours to go)
Sitting and looking at it won't help. Time to go do something else and hope my background brain comes up with something. Playing with the guitar helps for a couple of reasons -- it's completely different, and reminds me of the other aspects of the game. Sound, music and even graphics. The game is very text-heavy at the moment, and not particularly styled.
Maybe I can take some extreme close-up photographs of surfaces and use them as background textures. I don't think I'll have much luck taking convincing photos of micro-organisms for progress.
# 11pm (36 hours to go)
I've stayed away for a few hours and haven't come back with huge flashes of inspiration. I guess I'll just try to make this one workable and polished, even if it's not fun. I'd prefer the other way around, to be honest, but I've never polished a game before so I'd like to take this opportunity.
# 1am (34 hours to go)
Time to pack it in for the night. Before I go, I'll leave a long-running job pre-calculating the neighbours of each word. I'm thinking it might be useful to draw a "terrain map" or something to give a sense of directionality. It took a bit longer than I thought to hook up a working pre-calculation script, so it's nearly 1.30 before I get to bed.
# 9am (26 hours to go)
A decent sleep later, I woke up to check the results. Apparently it took under 20 minutes to calculate the neighbours for all 50k words in the dictionary. Good to know, in case I have to do it again with some different parameters.
Loading the dictionary back into JavaScript to analyze it turns out to be more complicated than I expected -- `neighbours.length` no longer tells me how many entries in the dictionary, but rather the neighbours for the word "length". JavaScript methods and English words have a lot of overlap. Dang.
Anyway, my biggest problem is still "fun" in the game. Picking words from a list isn't that fun. It doesn't feel directed.
I'm back online now (mobile tethering). Immediately downloaded d3.js for maybe doing force-directed layouts, as well as some other libraries that might help like angular.js for templating and data binding. People in the IRC channel were talking about A* and I wondered if it would be worth using for "distance to goal" calculations. I haven't implemented A* before but I've walked through it in the past and Wikipedia's entry has a pretty concrete pseudocode implementation.
Time for breakfast!
10.00
11.00 playing with Alchemy. I can't make it work no-handed like it does in the demo video, but it's danged cool. I don't know if it'll be much use for this word game, but it's an awesome source of visual inspiration.
Inspiration strikes. It might not be fun to pick each word on the way to a destination, but maybe if the computer were doing the work and the player intervened... I'll sketch on this idea while I'm out at lunch.
2.30pm
Back to it! The lunch break sketching session felt productive. I've got a direction to take the game now, one which might actually be fun. It's going to need help from a visualisation library. I hope I can pull it off.
5.30pm
That A* article turned out to be pretty useful -- I've spent a couple of hours implementing it which I hope turns out to be worthwhile. It's not hooked up to the main game, but the console output tells me that there's a very short path from CELL to WORM to FISH to FROG. There's nothing to connect REPTILE or MAMMAL or HUMAN, though, which means a single chain of dictionary words won't be enough to progress to the later stages. That works out pretty well with increasing difficulty :-) The routing algorithm decided the shortest path from FISH to FROG involved going through a word I'd rather not show up un-announced, so I also added support for variable-cost routing.
8.00pm (15 hours to go)
What a bender! I realised I'd made the mistake of diving too deep without checking myself, so I stopped and took a breath. I've wired up everything to a somewhat-playable game. The player starts at CELL and can progress through evolutionary stages.
I've also switched most things over to D3 from jQuery.
9.00pm (14 hours to go)
I tried switching everything to D3 from jQuery but had some trouble with nested elements in the next-word buttons. It's not important enough to focus on, so I stashed those changes and got on with making the game more completely playable. I figure at this stage my priorities are:
* playable
* obvious
* completable
* fun
* polished
The game is definitely not going to win any prizes, but I'd like the feeling of accomplishment. I think I've got "playable", but "obvious" is a bit more questionable. With that in mind, I've started adding hints and help text. Unfortunately, the heavy lifting that was OK from the console is less cool when it locks up the browser window.
It's coming toward the end of the weekend here in Australia and I'm going to sleep tonight and to work after that. My personal deadline is just a couple of hours away, then.
11pm (12 hours to go)
Working hints thanks to WebWorkers!
I was tearing my hair out trying to get decent UI-thread performance
or async that worked. WebWorkers only hurt readability a little, and
really make the UI lag go away. Browser support seems relatively good,
and apparently I can polyfill my way to IE support.
12am (11 hours to go)
I've added sound effects. Generated by cfxr, naturally, since it's Ludum Dare and everyone uses bfxr or a port.
I actually played through to "completion" (CELL, WORM, FISH, FROG) which means there's something to it. You can't progress past FROG to REPTILE because there are no joining dictionary words. I might move the "winning" stage back to FROG unless I can add a different transition mechanic.
1am (10 hours to go)
The game is winnable! It even has a (terrible) winning screen. Not all the state is cleaned up, though, so you can make weird things happen if the player keeps fiddling around after they've won.
I keep seeing a "bad word" listed as a choice and I'd really rather not release with that kind of suprise on the likely path through the game.
The audio makes a suprising difference. Everyone on the Web was talking about the awful state of the <AUDIO> tag but it seemed to work OK for Chrome and Safari. Better try Firefox. UGH! No audio at all, and even worse -- the game renders poorly in Firefox, too.
I was going to pack it all in but I can't leave Firefox hanging like that. I feel pretty bad about not checking, and I also grumble a bit at Firefox. Apart from upgrading several major revisions and then upgrading some more, I find myself thinking "WebKit can render these pages, why can't you?". Half an hour of DOM digging later, it turns out that Firefox is just picking up on some styling mistakes I made. Invalid markup. Styling all paragraphs when I just meant one. {position: absolute} without {left: 0}.
# 3am (8 hours to go)
Some more cross-browser compatibility, a little bit of responsive design, and I think I'm going to have to call it a night. Which means the end of the competition. I'll just make sure that there's no leftover images or anything that's not mine. Oh, there's the background texture.
# 4am (7 hours to go)
I'm going to be tired for work tomorrow, if I get up at all. On the upside, I have a much more game-looking game. It's still horribly ugly, but it's clearly a game now.
# 5am (6 hours to go)
What the heck, man, why am I still up?
# 7am (4 hours to go)
More time tooling around with polish. I've tried to make nicer layout, fancier transitions and more obvious help text. None of it is working out. I should have been in bed hours ago. I'm submitting anyway. Submitting takes time. I didn't realise I could pre-submit.