Is it possible to "draw" walkable areas in script?

Started by mode7, Mon 04/07/2011 12:03:06

Previous topic - Next topic

mode7

Hey there,
I'm still working on a tile engine, while the drawing works pretty good so far its time to add some game logic in there.
I'm trying to retain as much of AGSs functionality as possible. As I coud easily code my own collision detection this would break for example the pathfinding algorithm.
So I wondered and this might be a stupid question:
Is it possible to use to RAWDraw function of AGS to dynamically draw a walkable area on screen? Or is there any other way to create a walkable are from script?

thanks in advance

Wyz

No, there is currently no way of changing the walkable area at runtime. If you really want to, it is exposed to the plug-in API. I have never tested it but I guess you could build a plug-in to enable drawing on it. What kind of game are you making? There might be some workarounds. :)
Life is like an adventure without the pixel hunts.

mode7

It's more like a module so I wanted to keep every possibillity open. Well I'll do my own walkable area merking then. Well I could actually code my own pathfinding algorithm too, seems easier than learning C++ to write a plugin.
Do you guys have some links or advice how to aproach that?

Shane 'ProgZmax' Stevens

With your tile engine, just have it output the final map color-coded (collision tiles all red, walkable area all blue) to gif or png and then load that for the area.  Presuming the rooms aren't huge that should take care of all the walkable and collision zones for you, just make sure you use roughly the same colors as ags does for the walkable areas and you'll be fine.

mode7

Thanks ProgZMax, if I understand you correctly, you mean having a roomsize equal to the map size and putting a non-tiles walkable area mask on it. This is not really an option as the engine supports (in theory) unlimited map sizes. The biggest I tested was 200x200 tiles. With a tilesize 64 this would mean a Bg size of 12800px x 12800px which would be more than ags could handle.
Anyway I've read some stuff about A* pathfinding algogrithm and it looks like a challange to implent it. I'll give it a try.

SMF spam blocked by CleanTalk