[Behavior] Grid based sight

0 favourites
From the Asset Store
Grid - snap to grid
$1 USD
80% off
Snap to visible grid - perfect solution for any game genre
  • A new version of my grid based sight. Now intergrates a-star pathfinding (broken). (Updated 21 March 2012.)

    Edit (21/04/2012): Please note that Astar in this is broken so go to here for my Github repo with a much faster version. I'm currently updating the Grid based sight so expect a new version in the repo linked above.

    Rogue (r2.1)

    <font size="2">EXAMPLE HERE!</font>

    (21/03/2012) Updated. Now the action which creates the cells has an opacity range between 0 and 1. Default is 1. This controls how much opacity is used e.g. setting as 1 is 0-100 opacity drop off. Setting as 0.3 would be 0-30 opacity drop off. Experiment and hopefully it will make sense. The behavior uses inverse square to calculate the opacity using this action to create cells. For more control or to use your own equation use the crossed out code. No more black/white tiles either.

    There's an example project in the zip file.

    Edit2 (Quite old now): Here is the original thread I started with some examples.

  • Been eyeing your examples, and getting more and more excited. Thanks for releasing this into the wild! :D

  • Been eyeing your examples, and getting more and more excited. Thanks for releasing this into the wild! :D

    Thanks! If you see any problems or have any ideas for further actions/conditions/expressions let me know!

  • Thanks 00Rez for your work on this. I'll let you know how using it goes.

  • Just realized when using the "for each cell" actions and then checking each of these cells using the check cell condition you MUST use the expressions which have "Cur" at the start to get the correct coordinates. If you look at the example it shows the expressions to use. I think this might confuse people to how it works because it actually confused me at one point!

    Anyway, I'm currently in the process of incorporating pathfinding into this plugin! Demo soon. The pathfinding keeps track of the position in a path to which you can access the current, previous or next position and also move to the previous or next position. This seems to make showing/keeping track of the movement easier.

    Currently I'm having issues with enemies overlapping each other, if anyone has any ideas to stop this I'd be very welcome to hear them!

    • Rez
  • Thank you! This looks AWESOME! Will be very helpful in creating nice games =)))

  • Thank you! This looks AWESOME! Will be very helpful in creating nice games =)))

    Thanks! Looking forward to a dedicated section for plugins/behaviors, not good in here because it falls behind and no one sees it... <img src="smileys/smiley5.gif" border="0" align="middle" />

  • it's working super fine here...tnx Rez for this awesome behavior ^^

  • Rez, that is really cool. I haven't played with it yet, so this may be obvious, but can the LightCell be any shape and color, or does it need to be a black square.

    Also, please develop a game using DrunkGuy. I would play that game! :D

    Seeing all of these new behaviors is really giving me the itch to start making my own plug-ins. I do know some JavaScript, although it's mostly been for one-off admin tasks at work. Did you find it easy to figure out?

  • I know the question is aimed at Rez, but I was a bit in the same situation. I didn't know much about JS (but I knew other languages: VB, notions of C/C++, PHP, Lua/python) and found JS quite straight forward to get into.

    Especially in the goal of plugin developpement for C2, Ashley made an awesome SDK with links to JS guides and references and from there it was almost like "follow the guide".

    In the end, I found it pretty easy and fun to developp plugin or behavior for C2 even if sometimes you will encounter your fair share of headaches, but that's what dev is about in my experience <img src="smileys/smiley1.gif" border="0" align="middle">

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Rez, that is really cool. I haven't played with it yet, so this may be obvious, but can the LightCell be any shape and color, or does it need to be a black square.

    Also, please develop a game using DrunkGuy. I would play that game! :D

    Seeing all of these new behaviors is really giving me the itch to start making my own plug-ins. I do know some JavaScript, although it's mostly been for one-off admin tasks at work. Did you find it easy to figure out?

    Haha yeah the lightcell can be anything its just a way of showing a "seen" cell. The basics of javascript are easy I've come from C#/Python/LUA/GameMaker/a few other programming side of things. I'm not massively great at programming although I love it. The plugin system Ashley has designed is really good, just use the latest Firefox with the Firebug add-on. This will help alot. If you get stuck I create an alert, assert2 (as Ashley does) or even an expression so you can return a value you want to check out. When I design a plugin such as a "container" or inventory behavior I found I could use parts of the storage plugin to save the contents of the container/inventory. Can't wait for Families then I can make a fully functional item system...

    Believe you me it does click eventually!

    Anyway thanks for the feedback Wastrel.

  • I know the question is aimed at Rez, but I was a bit in the same situation. I didn't know much about JS (but I knew other languages: VB, notions of C/C++, PHP, Lua/python) and found JS quite straight forward to get into.

    Especially in the goal of plugin developpement for C2, Ashley made an awesome SDK with links to JS guides and references and from there it was almost like "follow the guide".

    In the end, I found it pretty easy and fun to developp plugin or behavior for C2 even if sometimes you will encounter your fair share of headaches, but that's what dev is about in my experience <img src="smileys/smiley1.gif" border="0" align="middle">

    Thanks for answering for me Kyatric, appreciate it!

    On another subject I'm currently incorporating pathfinding into my behavior. You had any luck with a method of smooth movement? I can have it move easily with 'set position' but thats a bit crap looking. I've made it so you can find or move to the previous, current and next position in the path list by using a position counter which as a behavior works perfectly.

    Finally, does anyone here play Dark Souls!?

  • Hey 00Rez. I've been playing with behaviour, but I can't quite get it to work. Could you have a look at where I could have been going wrong?

    dl.dropbox.com/u/1378330/gridProblem.capx

    The pertinent events are in the "Terrain" and "Player" event sheets I believe.

  • I also have a problem Rez, no light is appearing at all!

    My Problem

    Changing the lightcell to XOR doesn't make a difference.

  • I also have a problem Rez, no light is appearing at all!

    My Problem

    Changing the lightcell to XOR doesn't make a difference.

    It seems you got x,x instead of x,y. I'll let you figure that one out and the shadow object effect needs to be set to "destination out."

    One last thing if you select an object with the Sight behavior attached make sure you look at the properties on the left hand side because you set the tile size, the default is 32 pixels which means usually to keep all objects at no more than 32x32 pixels or whatever (just a recommendation). I noticed your dirt object is 16x16 which would probably look weird.

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)