Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Dark A.I. 2D character tilesets?

Author
Message
Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 16th Jul 2008 10:54
Hey guys,

I have a project that I've attempted to code several times, but just can't seem to get it. I have a tileset of a 2D Knight character from [a href=http://www.ReinersTilesets.de]Reiners Tilesets[/a href]. I need to allow Dark A.I. to control this character, so that it will successfully walk around the screen. So far, I have been getting stuck at the fact that my character is only represented with 8 directions (0, 45, 90, 135, 180, 125, 270, 315 degrees). Since the Dark A.I. entities want to be able to move with 360 degrees of free rotation, I have not been able to get my characters to work.

Might anyone know a clever trick to bypass this problem, or perhaps a way of limiting Dark A.I. entity to turns of exactly 45 degrees?

Thanks,
-Sunflash

Mountain Dew, happiness in a bottle.
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Jul 2008 11:22
You could make it use the closest image angle possible to its current one, but that might look as if its sliding across the map at some moments.
Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 16th Jul 2008 20:54 Edited at: 16th Jul 2008 20:59
You get that problem and the fact that if it wants to travel to a point whose angle is somewhere between the two direction angles (say 45 and 90). At first it will try to turn left (90), that will prove to be to far, so it will turn right (45). But 45 degrees is STILL to far in the other direction, so it will turn back to 90.

The end result is a lot of flip-flopping. There must be more of an intelligent way to approach this problem though...


Quote: "but that might look as if its sliding across the map at some moments"


Surprisingly, yes it does. I say surprisingly because I have seen games that pull it off with the same graphics I am using (as they have been released to the public). I would ask the developers how they managed, but they use a drag-and-drop game maker called Multimedia Fusion published by ClickTeam.

Mountain Dew, happiness in a bottle.
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Jul 2008 21:51
Well, for the final part of the rotation, you could pick the closest one, and use Rotate Sprite for the final few Degree's, but the drawback on that is, that it will have a few rather sharp edges...

Login to post a reply

Server time is: 2024-09-19 02:13:58
Your offset time is: 2024-09-19 02:13:58