Hello!
I am back in action, so i must start with a complicate question eheh!
I started reading some tutorials about FoV (field of vision) in 2D tilemap, and i was asking myself if it would be possible to set up something like that in Makinom.
I think there are all the tool in the framework, but i think some help pointing me in the right direction. What i woudl like to achieve is:
- the player move by 1 tile
- the map is updated with new position
- all adiacent tiles (let's see a 5-tile radius are lightened)
- if there are obstacles, like monsters/objects/walls, the tile behind aren't showed
(- facultative: have a different visibility of discovered tiles but out of LoS)
Let me link some images for a better understanding:
I tried some Asset Store Assets that achieve this, but the biggest problem would be the integration with Ork, so i was asking myself if it would be possible to set up such a system without 3d-parties...
Thanks in advance, have a nice day!
Kaem
If you already have a 3rd party asset that does that, it might be easiest just calling that functionality with Function nodes or writing your own schematic for that.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I was thinking about sending raycast at 360 degrees, see if the ray hits something solid, and change material for every tile hit. So my biggest problems are:
1) Shooting rays for 360 degrees, is there a way to do it with one step only?
2) Record all tiles between the player and the obstacle, or max distance if reached... Concering this is it possible to store each object hit till a specif one, like every walkable tiles till the obstacle?
Thanks a lot Gil!
My old entry for Indie Game Making Contest 2015
Another solution would be raycasts from above on all tiles around the player - similar to how it's done in the Match3 tutorial for finding matches, where each tile checks it's neighbours (and blocked don't check further).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
My old entry for Indie Game Making Contest 2015
I was thinking about shooting from each tile (to the player) inside a range and see if that collides with an obstacles. But i cannot set up raycast properly: how can i set the direction / lenght of the ray from the tile to the player and check if inside there is a solid object? I am losing myself with all these parameters. ^^
Also, i didn't understand shapecast. Can i store somehow all tiles not hit inside the area (blocked by obstacles that are nearer to the player)?
Oh, almost forgetting... How can i set a variable as a distance between two objects (usually player and machine object)? I cannot get it.
Sorry GiL but i would like to understand how to apply FoV to 2D tiled environment. :)
My old entry for Indie Game Making Contest 2015
Maybe try using this asset as a means of using Field of Vision/Line of Sight? Seems to come highly recommended and I've been tempted to give it a go a few times. I haven't tried it before, but I'm guessing that it that it'd be possible to hook into it from Makinom/ORK.
---------------------------------------
Personal Twitter: https://twitter.com/AMO_Crate
I make RFI! https://twitter.com/NootboxGames
My old entry for Indie Game Making Contest 2015
E.g. this article gives a good understanding for the available methods (they generally have a lot of great articles :D).
I'm currently lacking the time to do a tutorial on this :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I thought about shadowcasting, so i was wondering if there is a way to calculate in Makinom an opposite direction between an object and the player...
If i can do that i think i will be able to shoot a ray in that direction and change all tiles found.. But i cannot understand which schematic step can store me a direction (line between player and object), is it possible? Thanks a lot. :-)
My old entry for Indie Game Making Contest 2015
You can calculate the direction by subtracting the origin's position from the target's position. I.e. changing store the target's position as a Vector3 variable and sub the origin's position from it.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
About direction, sorry but these vectors are making me crazy. :D
So, if i subtract vector 3 player position from object position i get the direction of the ray? Where should i use that in the raycast settings? I don't know yet if i am using shadowcast approach, i think it would perform better if i found all solid objects in the range and cast from them rays to hide all tiles behind.
Thanks a lot for the help. :)
My old entry for Indie Game Making Contest 2015
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!