Monday, December 26, 2011

12.26.2011 Day after Christmas

summation: graphics problems fixed. New graphics problem found.  Sound and astar pathfinding probably need optimization. Some optomization acheived.

I separated the movement code from the drawing code.  Now any object that has "needs los to be seen" is on a list and gets drawn if it's on the screen.  Now, at least, an unmoving monster will not be invisible - it gets it's LOS checked and if it's true, it gets drawn, wheras before, only moving monsters got their graphics updated.  I could probably check for a "just moved" variable to optimize things, and only update the graphics of those who move, but then I'm back to having the same problem.

The game is getting slow.  I've worked on all different code over the last few weeks as it's slowed down - mostly with the addition of the sound code.  I'll have to expirament and see what's eating up the processor eventually. I usually work on all different code projects and then do a whole bunch of optimization all at once.  If it turns out to be the sound code that's slowing things down I think an "auditory memory" for denizens so sounds dont have to be generated so often.  That will probaly take making sounds more complex also, they'll probably each need an identifier like ""_"..type_sound_name) so that walking sounds overwrite walking sounds... that's one idea instead of an auditory memory.  Then sound data would be self-updating.  I would just need a "cleaner" function to delete aged, un-updated sounds from the soundscape.

But at least ghouls who are unmoving are now seen.

Still working on the undrawn squares in the forests where the deer were "just" standing on player screen-transition, but it draws correctly when he steps out of the ditch....  All I can think is that the tree gets drawn, and it's upper level over the deer's location is not drawn...

---Later that day:

--Fixed-- Unmoving ghouls now seen.
--Fixed-- No more vision trails! (they had reappeared due to yet a different bug in new programming. ugh.)
--Fixed--Undrawn squares in forest where deer were standing on refreshscreen is fixed!  Not sure what I did but I was fixing graphics in general and must have corrected the problem.

my Wife is knitting.  Not sure why.

Todo: Either sound generation or a-star pathfinding is eating up my processor.  Will have to optimize one or the other or both.

Later on:

So I found another graphics problem that I cant seem to solve.  Whenever my creatures move off of the screen to the north, they leave a graphics trail.  If they move off of the same square to another square on the screen, I'm pretty sure they redraw their old square.  I occasionally check for things "off the edge of the screen" but I couldnt seem to find any errors in that.  When they move off the screen to the south, they dont leave a graphics trail.  ugh.

No comments:

Post a Comment