Thursday, September 24, 2009

New Display

So I ... wait, I last posted a month and a half ago? Crap, sorry about that. I got a new job and my schedule got changed around.

Anyways, both Peter and I are doing triple-time at the moment. We both have full time jobs, we both are working on Darkened Dreams 2, Peter is doing art for another company in his spare time, and I'm working on a tool for editing sprite sheets for use in 2D games. Also, we're married (not to each other >_>) and each of us has a small child. That's why there hasn't been too much progress lately.

Not to say that nothing has happened! Peter's been getting me new art, and I've managed to speed things up. We had a problem with timid creatures grabbing a spot in an opposite direction from the hero and run through the path-finding code to find out how to get there. Unfortunately, because of the test map setup this led to a nasty problem. They would almost always choose something that was outside of the boundaries, use up some time trying to find a non-existent path until hitting the limit of places I allowed them to look, try a different direction which, likely as not, ALSO ended up outside the boundary!

If we had more than one at the same time looking like that it would slow the game down considerably. I started testing to figure out what I could do, then realized that I didn't even need to get them a path. They weren't trying to get to a certain spot, they were just trying to get away from the hero! The next problem is that since they didn't always run away from the hero (maybe they didn't see you or just don't feel like running) it was hard to tell if they were really running away or just happened to travel in a direction opposite you. Peter got me some recolored versions of the creature icons so I could give them a different color depending on what their AI state was. That's when I found out that timid creatures would run right at you! lol. Then run right past you as if you weren't there. I negated the direction and it all worked right and wasn't slow anymore.

The next problem is with the display. I have things set up so that there are a number of boxes that a creature can fill in depending on the size of the art. It's first come, first shown and they can't be kicked out until you get far enough away from them. This means that once you kill something the bones are just going to sit there forever (not doing any decay and respawning yet). Also, anything that's too big won't show up. I found out that the biggest monster that Peter drew doesn't fit at all, so that made me see I need to rework it.

I've come up with what feels like a good solution, and I plan to implement it sometime this week. I'll let you know if it works :)


No comments: