LOS - AI Hides From Player + Cover points

This forum is currently in read-only mode.
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hi!

    First of all I want to thank everyone that have helped me with my previous subjects, you know who you are! <img src="smileys/smiley1.gif" border="0" align="middle">

    Please bear with me, english is not my native language.

    Today I will share a little top-down demo I have made using Construct Classic.

    In this demo the AI units will run for cover, prefering cover points distributed on the map. For each tile I have distributed a LOS node which is a sprite. Due to the fact that the tiles always have their hotspots in the top left corner.

    In this demo I have the walls on the inside of the tile square. I realize now that I could have made them inside on the south and east walls and outside on the north and west walls. Maybe even using the same tile but putting the north and west wall in the outdoor tile next to the floor tile. Anyways...

    Each LOS Node gets a "hide value" like so:

    clamp(int((distance(player.x,player.y,los_node.x,los_node.y))) - (los_node.Value('in_los')*100000) + los_node('cover_point')*240,0,480)

    You can get a very dynamic formula here if you play with the values and add more values like if there is a grenade thrown etc...

    Well since alot of people have been so nice to me on this forum I feel that I want to give something in return, if this has any value to anyone that is. <img src="smileys/smiley36.gif" border="0" align="middle">

    Here it is:

    Example file here!   

    However for the love of all green jelly in the world, I can't make this work when using the nodes as tiles. Does anyone know how to do it?

    It creates alot of overhead using sprites for such a simple task.

    Have a nice day!


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It wants "Dropshadow2" effect to open the file and I can't find it on the forum. Do you have a download link?

  • Holy cow I forgott about that. <img src="smileys/smiley9.gif" border="0" align="middle" />

    I will reupload a version without that effect...

  • Might work now, I deleted all the instances of the dropshadow 2 effect... I hope...

  • Looks good, thanks for the example. About using tiles, I think it'd be possible, but using sprites is easier. My idea is, that you would keep an array as a map, just a wild guess, didn't really think about it.

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