Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Integrating Combat-Flying and Gravity.  (Read 2206 times)

Skizelo

  • Bay Watcher
    • View Profile
Integrating Combat-Flying and Gravity.
« on: May 16, 2008, 06:21:00 pm »

A hammerdwarf of mine was attacking a goblin at the top of a cliff. The hammer struck a mighty blow and the goblin flew horizontally off the cliff... and then continued that way for about five tiles. Only when the "Flying" from the hammer had worn off, did the goblin fall downwards. At the moment (correct me if I'm wrong) creatures operate on the same rules as a bolt where the object moves to its target, ignoring wind, gravity or momentum, heeding only its preset lifespan, at the conclusion of which it stops moving (after which, another part of the physics engine moves in). While this is fine for tiny, aerodynamic bolts, the bigger and awkwarder the object gets, the more noticeable this fudged physics is.
So I'd suggest a more complex system that decides not just how forcefully the creature's moved, but also the horizontal/vertical ratio of that strike. He can fly sideways as before, but the game moves him down one for every tile; if he's at ground level it'd be as if he'd stuck a wall (adding bounce would be cool too). He could also fly upwards but the energy runs out quicker because every tile up requires two units of force (one to get him up there, another to negate gravity). This would shred the (already slim chance) of hitting creature B with creature A and stunning them both, but it would make the physics more believable (now each hammer has rifling and the goblins move like they're on hover-boots*) as well as adding another element of chaos to the fights and making it possible that the goblin flies straight upwards and knocks out your champion hammerdwarf on the descent (losing's fun, remember?).

*I'd also be happy if every creature was given hover-boots.

Logged

MaxVance

  • Bay Watcher
  • Legendary Internet User
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #1 on: May 16, 2008, 06:36:00 pm »

Instead of falling down a set amount per tile, what would be even better is if the creature fell based on its body size versus the density of its flesh. This would be needed to account for air resistance. Flying monsters (assuming, of course, they managed to get hit by your hammerdwarf in the first place) would be able to regain control of their flight as long as they aren't stunned, paralyzed, or unconscious.

However, I think this falling would only satisfy for appearance purposes, as the creature knocked back completes its flying and falling within one turn. Give it a try in adventure mode to see what I mean.


Edit: And yes, we do need hover-boots once magic is implemented.

[ May 16, 2008: Message edited by: MaxVance ]

Logged

Skizelo

  • Bay Watcher
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #2 on: May 16, 2008, 09:55:00 pm »

I'd have no idea how to factor in air-resistance and momentum. Perhaps, when in free-fall, every few tiles in one direction yields a unit of energy in that direction? And maybe a cheaper way of figuring out A.R. would be just to set a free-falling speed-limit (it would have to be fall-specific or hyper-agile people would hit a wall. Or things could fall a LOT faster) in the creature code. And clothiers could make parachutes which sharply lower that limit.
And yeah, it's kind of a vain point, but I just really like watching things fight in fortress mode, and I think making every battle play out over several z levels would be awesome. Also, it would give an extra incentive to fight in caves with low cielings, I guess.
(by the by, my current army is, like, 70% hammerdwarves because the goblin nations kept on sending out hammer-squads and I just feel the need to make them neater. Why should swords and axes have any number of limbs to chose from or spears their internal organs, yet hammers only have the one neat trick?)
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #3 on: May 17, 2008, 11:05:00 pm »

I fill my armies with swords to lop off the limbs..  My legendary +5 bonecrafter needs something!
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

MuonDecay

  • Bay Watcher
  • Say hello to my little μ
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #4 on: May 18, 2008, 03:43:00 am »

Realistically, a ballistic trajectory of one or a few objects is a very very simple calculation and could be done real-time in computer games many, many years ago.

But adding that to a fixed grid of coordinates where an object is always exactly at a given x,y,z intersection would probably just obfuscate the visibility of that calculation to the point where a given linear trajectory of horizontal/vertical motion would probably give the same perceived result unless for some reason you're actually following something as it falls 30 or more tiles, which is a darned feat in and of itself and so isn't really something to cater to.

So having things falling, say, 1 z level for every horizontal tile would probably look good enough without taking resource usage and programming time away from more pressing goals.

As for the proposed calculations about size/weight ratio and factoring in wind resistance and all that fluff... you'd really never notice the difference in the game for all that extra math being done real-time and all that extra programming and variable-defining that has to be done to implement it, which would make it painfully pointless from a development perspective. It could be neat mind you, but again the definition of physical location within the game world has such coarse resolution that the subtleties of this would likely just be undone in the end anyhow.

Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #5 on: May 19, 2008, 06:27:00 pm »

quote:
Originally posted by Skizelo:
<STRONG>(now each hammer has rifling and the goblins move like they're on hover-boots*) as well as adding another element of chaos to the fights and making it possible that the goblin flies straight upwards and knocks out your champion hammerdwarf on the descent (losing's fun, remember?).

*I'd also be happy if every creature was given hover-boots.</STRONG>



Objects in motion tend to stay at the same altitude until gravity is noticed"

Logged

Cthulhu

  • Bay Watcher
  • A squid
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #6 on: May 19, 2008, 07:41:00 pm »

*Wants to call subliminal imaging on the first panel of that comic, but is afraid he's the only one who saw it*
Logged
Shoes...

Mikademus

  • Bay Watcher
  • Pirate ninja dwarves for great justice
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #7 on: May 20, 2008, 05:25:00 am »

quote:
Originally posted by Skizelo:
<STRONG>A hammerdwarf of mine was attacking a goblin at the top of a cliff. The hammer struck a mighty blow and the goblin flew horizontally off the cliff... and then continued that way for about five tiles. Only when the "Flying" from the hammer had worn off, did the goblin fall downwards.</STRONG>

Anyone even considered that this might be *correct physics* in the DF universe?

Logged
You are a pirate!

Quote from: Silverionmox
Quote from: bjlong
If I wanted to recreate the world of one of my favorite stories, I should be able to specify that there is a civilization called Groan, ruled by Earls from a castle called Gormanghast.
You won't have trouble supplying the Countess with cats, or producing the annual idols to be offerred to the castle. Every fortress is a pale reflection of Ghormenghast..

Draco18s

  • Bay Watcher
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #8 on: May 20, 2008, 09:56:00 am »

quote:
Originally posted by Cthulhu:
<STRONG>*Wants to call subliminal imaging on the first panel of that comic, but is afraid he's the only one who saw it*</STRONG>

What, the motion line being something else?

Logged

Align

  • Bay Watcher
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #9 on: May 20, 2008, 02:31:00 pm »

I think he meant the orange stuff around the Lich's eyes.
Logged
My stray dogs often chase fire imps back into the magma pipe and then continue fighting while burning and drowning in the lava. Truly their loyalty knows no bounds, but perhaps it should.

Draco18s

  • Bay Watcher
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #10 on: May 20, 2008, 02:46:00 pm »

In which case, I don't get it. :-\
Logged

Cthulhu

  • Bay Watcher
  • A squid
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #11 on: May 20, 2008, 05:53:00 pm »

[Removed due to embarrassment]

[ May 20, 2008: Message edited by: Cthulhu ]

Logged
Shoes...

Skizelo

  • Bay Watcher
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #12 on: May 20, 2008, 08:37:00 pm »

Yep, that's all you.
I've not been keeping up on my cartoons. Now that I know that those little gs are scrambling against the air or looking down and pulling out signs it's all good.
And it clearly is the "correct physics" because objects operate under their influences. However, as it knackers the whole "gravity's a constant" thing in a rather blatant way, it's kind of upsetting, at least to me.
Logged

Align

  • Bay Watcher
    • View Profile
Re: Integrating Combat-Flying and Gravity.
« Reply #13 on: May 21, 2008, 06:58:00 am »

quote:
Originally posted by Draco18s:
<STRONG>In which case, I don't get it. :-\</STRONG>
Well, you're probably fortunate enough to not spend a lot of time around weeaboos.
Does the name Kamina mean anything to you?
Logged
My stray dogs often chase fire imps back into the magma pipe and then continue fighting while burning and drowning in the lava. Truly their loyalty knows no bounds, but perhaps it should.

Cajoes

  • Bay Watcher
  • "I'm a damn cat."
    • View Profile
    • http://none
Re: Integrating Combat-Flying and Gravity.
« Reply #14 on: May 21, 2008, 08:02:00 am »

Permaflooding, tiles that are both finite and infinite in space and rapid fire crossbows and you're concerned over gravity?
Logged
Quote from: Roman Proverb
Do not argue against the sun. For it is a lot brighter than you are.
Pages: [1] 2