I made a ton of progress on the game this weekend…so much so that I actually spent an hour just playing through it last night. You can never tell when you’re building these things, but I actually find it quite entertaining. Hopefully adding all of the final features and polish will add even more to its value.
My goal is to have a working demo (that I’m not afraid to show people) up by Friday so that I can post it on a game dev forum that I’ve been active on lately for “feedback Friday”. I’m anticipating some opinionated feedback, so I may have to drink heavily in anticipation.
Tangent: Dealing with criticism on your own projects can be so difficult. You desperately want feedback, but negative opinions can absolutely crush your soul.
I ran across an interesting problem this weekend that I thought I’d share. For lack of a better architecture, the body of the game runs every 100ms to update the user’s progress and screen. I was wondering if I’d ever run into lag issues from browser/processor load and the answer was finally yes!
When I added in my real data sets of shelters and towns, the program was initially looping through ALL OF THEM during each 100ms iteration to see if they matched the player’s current position. With over 200 data points in a bulky jquery object, this visibly slowed down the game…a lot.
After a wicked brainstorming session, I found my solution. I added an extra field to my data points in the xml file, simply called “next”. Instead of looping through all data points in the set, jquery just targets the item with the next field set. When the user arrives, you set the current point as expired and set the next one to be ready.
The file size is trivially larger (and could even be optimized more, but it’s small enough not to matter), but the program runs the same speed as using no data at all.
Okay, I’m setting down my nerd hat for the day.