Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
FLARE

Crouching behind cover?

tir2
Wednesday, May 11, 2022 - 02:12
tir2's picture

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.

  • Log in or register to post comments
dorkster
joined 9 years 10 months ago
Friday, May 13, 2022 - 11:13
dorkster's picture

I don't think this is really possible as you fully describe. This method might be close, but it has some flaws:

  1. Where cover is possible, place a constantly activating power that applies a status effect to the player. This status would basically define if the player was in cover or not. The duration should be short so that it goes away after the player leaves cover.
  2. The player's "crouch" power would only be enabled if the cover status effect was active. The crouch power would be a "block" type of power, so that you could hold the button to stay in the crouch state.
  3. When in the crouch state, a passive effect could be applied. There'd be no way to make only ranged attacks miss, so the closest solution is to buff the avoidance stat, causing all incoming attacks to miss.
  • Log in or register to post comments
tir2
joined 7 years 4 months ago
Friday, May 13, 2022 - 18:42
tir2's picture

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?

  • Log in or register to post comments
dorkster
joined 9 years 10 months ago
Friday, May 13, 2022 - 19:07
dorkster's picture

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.

  • Log in or register to post comments
tir2
joined 7 years 4 months ago
Friday, May 13, 2022 - 21:28
tir2's picture

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?

  • Log in or register to post comments
dorkster
joined 9 years 10 months ago
Friday, May 13, 2022 - 21:45
dorkster's picture

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.

  • Log in or register to post comments
tir2
joined 7 years 4 months ago
Friday, May 13, 2022 - 23:19
tir2's picture

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.

  • Log in or register to post comments
dorkster
joined 9 years 10 months ago
Friday, May 13, 2022 - 23:30
dorkster's picture

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).

  • Log in or register to post comments
tir2
joined 7 years 4 months ago
Saturday, May 14, 2022 - 00:52
tir2's picture

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.

  • Log in or register to post comments
dorkster
joined 9 years 10 months ago
Saturday, May 14, 2022 - 00:57
dorkster's picture

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).

  • Log in or register to post comments
tir2
joined 7 years 4 months ago
Saturday, May 14, 2022 - 00:59
tir2's picture

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?

  • Log in or register to post comments
dorkster
joined 9 years 10 months ago
Saturday, May 14, 2022 - 10:04
dorkster's picture

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.

  • Log in or register to post comments
tir2
joined 7 years 4 months ago
Thursday, May 19, 2022 - 20:53
tir2's picture

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.

  • Log in or register to post comments
WithinAmnesia
joined 5 years 3 months ago
Friday, May 20, 2022 - 18:18
WithinAmnesia's picture

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.

  • Log in or register to post comments