Crouching behind cover?
Hello!
I'm thinking of using FLARE for a project in a more modern setting.
How hard would it be, in the engine, to script the ability to crouch behind cover objects and have ranged attacks miss you?
Thanks for any help.
Hello!
I'm thinking of using FLARE for a project in a more modern setting.
How hard would it be, in the engine, to script the ability to crouch behind cover objects and have ranged attacks miss you?
Thanks for any help.
I don't think this is really possible as you fully describe. This method might be close, but it has some flaws:
Thanks for the reply! That sounds perfectly fine, honestly. Although I was looking more into crouching being something you toggle, as I'm aiming for a slower more methodical gameplay. Think Fallout 3/NV if you're playing as a sneaky character. Is that a gamefeel you'd think is possible in FLARE? Or is it truly for a twitchy crowd-control style of combat?
Slower gameplay should work just as well in Flare. I would definitely like to see something like that, since just about every Flare mod to this point has had fast/twitch combat.
Great! Although I just realized an issue with the proposed jerry-rigging: If it's dependent on an area "buffing" cover, it wouldn't work right if the enemy went around to the same side of the cover as you, right? You'd still get the buff even though it'd make no sense to.
Maybe a more daring question would be: How hard of a time do you think I'd have trying to hack something like toggable cover into a fork of the source code?
That is true.
Another approach I thought of is to have an event use 'mapmod' to change the collision tiles. I can't think of how to trigger the event itself when in the cover state. I think there would need to be a way to trigger an event if the player was under a specific status effect. So that's where some new engine code may be needed.
That got me thinking of two other questions:
Flare doesn't have "half-wall" as a collision type, right? You can't have a tile where entities can't walk over but missiles/flying entities can.
Is there a way to make an "invisibility" power that somehow affects the enemy's threat_range or combat_style to simulate line of sight? Because I'd be okay with never using half-covers if you could at least sneak your way past an enemy or get them from behind.
Thanks again, I really appreciate you brainstorming this with me.
Flare has exactly the collision type you describe. We use it for half-height objects/walls, as well as for pits/water. If you open the flare-game maps in Tiled, these are blue in the collision layer. The red tiles are the other collision type, which represent an all-blocking wall. So in my last comment, the cover tiles would start as blue and be changed to red upon enter the cover state.
As for affecting enemy threat range, the player has a 'stealth' stat which can reduce the range at which enemies will see the player. At 100%, enemies can't see the player at all (we use this for the "DEV Boots" developer-only item in flare-game).
That all sounds very promising, then. Maybe with some clever mapping and having some areas buff stealth I could simulate some more tactical combat.
But threat range is still a circle, right? No line of sight system.
Yes, threat range is a circle. There's line of sight, but it's only used in determining if a certain attack can be executed (i.e. don't shoot a projectile if the player is behind a wall).
I assume messing with raytracing to an engine is well beyond my capabilities, but maybe comparing player's and enemy's position on the map and running through a table that takes direction into account I could simulate a cone of sight.Well if raytracing is there, could it be rigged to relate to passive/aggressive state?
Should be possible. You could use the existing circular threat range, but then add an angle to define the size of the cone within that circle. To see if the player is in the enemy's cone, you would use Utils::calcTheta() to get the polar coordinates of the enemy looking straight ahead and at the player. If the absolute value of the difference between these angles is less than the cone angle divided by 2, the player will be in the cone.
Thanks! I'm still in the concept stage and I'm just trying to convince myself not to use Unity because I want something super light that can run anywhere, and also I've always loved FLARE as an open source project and really want to use it. I'll be sure to get someone more experienced with C++ when it comes time to prototype and experiment with that.
What are you trying to figure out for your project / game? Making a short 'gameplay demo' thing that has around 30 minutes 1 hour of gameplay 'hook' / 'game feel' / ~'game play loop' is a great place to start for it is like trying to first find your 'core' of your game build around that. Please don't do what I did before one of my older projects and put the engine stuff last and think you can solve them later while working for years on art and other stuff you may like / enjoy more than the nitty gritty engine work. Get the engine working and make some 'wheels and chassis' and ~'drive it around'. Find the minimum viable prototype that you are happy with and build on that to get super powerful build cycles and improve mental health in the long run. Do you have any W.I.P. screenshots / videos? Also you can make a forum thread here for people to help brainstorm if you want; lots of people here could add stuff your really like but you have be publicly known for a bit and to ask for advice first XD.