Monday, July 19, 2010

Another Return, not a Yield

I haven't done enough parallel programming to really make that joke in the title yet. But anyway, I am back from UT Austin (technically have been for a few days, but stayed really busy until today). I remain astounded by orientation, the OAs (student leaders/RAs there, basically), the friendliness of everybody I met, my own unexpected socialness, the city's breadth and the campus's depth, and the spectacular advisors and students from Dean's Scholars and Turing Scholars. I'm taking 17 hours this fall -- Vector Calculus, CS theory, CS data structures & algorithms, a philosophy of the arts, and two two intriguing classes associated with DS. I guess that means Mnemonic really will fall on the wayside. Nevertheless, I will work on it when time is available. More importantly, the work I do continue all started here... ultimately I've created a playground for multi-agent experiments, a bestiary of pathfinding techniques, a home where a few people hung out, if only for a few minutes in passing...

But it's a month too early for sentiment. In my few days back, I tweaked guest crowd behavior again to time their routes through the Hotel better. I'm not happy with their "pace around aimlessly in a room for 30 minutes" behavior yet, though. Since I'm diffusing this bloody useful influence gradient from each staircase/exit on each level at init-time, I decided to use it not only for pathfinding between rooms but also for wandering around. Pick a staircase and a random scent level (not 0, which would be the staircase itself) and hill-climb up or down to reach that point. Continue for as long as needed. This works for the most part, but I'm observing lots of agents getting caught in local minima -- they'll spazz out between a few tiles. Gotta examine the scent levels there to figure out why.

I've also been continuing my Java experiments. Today I got "frame-independent" movement going... rather than trying to run the game at 60FPS by sleeping variable amounts of time, I'm having the thread/game loop sleep a constant time and tell movement functions dt -- that's change in time since the last tick. This lets me specify velocities way easier anyway -- 50 pixels per second? No problem, it's been 349/1000 seconds since last tick, so a touch of dimensional analysis (fancy-speak for "multiplication" in this case) and some floating-point positions, then things are moving consistently no matter how well the game is running. Sadly, my collision response-fu isn't quite as strong -- my trick to fix overlap by the axis over which the instigating entity was originally trying to move, it isn't working so great when you're constantly falling and also trying to move left/right. Once I fix that, hopefully the other major issue will clear up too -- movement isn't fluid at all. My numbers are probably way off -- and the keyboard repeat rate bug isn't helping (more on that another day) -- but acceleration due to gravity feels clunky still.

Well, it is late.

No comments:

Post a Comment