Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 79 80 [81]

Author Topic: Submissions for project CAELUS  (Read 343309 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Submissions for project CAELUS
« Reply #1200 on: December 20, 2012, 11:06:29 AM »

If you need a reference for designing the sprite, here's the black hole generator in action (using a placeholder projectile): http://www.youtube.com/watch?v=5tL6GMgQIoY

The video lost a lot of detail in compression - if you view it at 720p, you can just barely see the particle effects of the core, and the outer rim is almost invisible. The hole is mainly dark blue/purple. Ignore the bright points that appear when the frigate gets sucked in, those are just where damage is being applied (visible for debug purposes).

Did you use the Planet "force" mechanic currently in game or used the impact methods but set it into negative?

Neither, I modify the velocity directly. This system doesn't use a weapon file; the effect is procedurally generated via a combat plugin.

Here's the relevant code:
Code
    private void pull(Vector2f center, CombatEntityAPI victim, float time)
    {
        Vector2f velocity, direction;
        float distance, maxVelocity = 500f;

        velocity = victim.getVelocity();
        distance = MathUtils.getDistance(victim, center);
        // Normalized directional vector
        direction = MathUtils.getDirectionalVector(victim, center);

        // TODO: replace linear decay with a curve, factor in mass
        float strength = (1f - distance / GRAVITY_WELL_RADIUS) * 300f;

        if (victim instanceof ShipAPI)
        {
            ShipAPI ship = (ShipAPI) victim;
            // Once again, Janino sucks (no switch on enums)
            if (ship.getHullSize() == HullSize.FIGHTER)
            {
                strength *= STRENGTH_VS_FIGHTER;
            }
            else if (ship.getHullSize() == HullSize.FRIGATE)
            {
                strength *= STRENGTH_VS_FRIGATE;
            }
            else if (ship.getHullSize() == HullSize.DESTROYER)
            {
                strength *= STRENGTH_VS_DESTROYER;
            }
            else if (ship.getHullSize() == HullSize.CRUISER)
            {
                strength *= STRENGTH_VS_CRUISER;
            }
            else if (ship.getHullSize() == HullSize.CAPITAL_SHIP)
            {
                strength *= STRENGTH_VS_CAPITAL;
            }

            maxVelocity = ship.getMutableStats().getMaxSpeed().getModifiedValue() * 2f;
        }

        velocity.set(velocity.x + (direction.x * strength * time),
                velocity.y + (direction.y * strength * time));

        // Avoiding a costly sqrt here, so that's why this looks awkward
        if (velocity.lengthSquared() > maxVelocity * maxVelocity)
        {
            velocity.normalise();
            velocity.set(velocity.x * maxVelocity, velocity.y * maxVelocity);
        }
    }
Logged

sini002

  • Captain
  • ****
  • Posts: 394
    • View Profile
Re: Submissions for project CAELUS
« Reply #1201 on: December 20, 2012, 11:22:33 AM »

no idea what all that coding means and/or does but good job makeing the blackwhole "effect" or what ever i should call it :P
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Submissions for project CAELUS
« Reply #1202 on: December 20, 2012, 11:48:30 AM »

So, now I've got to make a black-hole producing weapon?  Might have to skimp out on the .proj file then. ;D
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

Upgradecap

  • Admiral
  • *****
  • Posts: 5422
  • CEO of the TimCORP
    • View Profile
Re: Submissions for project CAELUS
« Reply #1203 on: December 20, 2012, 11:52:14 AM »

Hehe. Go for it! :D
Logged

sini002

  • Captain
  • ****
  • Posts: 394
    • View Profile
Re: Submissions for project CAELUS
« Reply #1204 on: December 20, 2012, 12:42:32 PM »

looks like it was a good move of me to ress this tread :P or remind people of it :D
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: Submissions for project CAELUS
« Reply #1205 on: December 20, 2012, 12:47:06 PM »

no idea what all that coding means and/or does but good job makeing the blackwhole "effect" or what ever i should call it :P

It "reverses" the ships velocity of the ship, making the "pull" effect

the only way to escape it since its impossible using the ship engine would be a teleport

Quite nice, it would make possible to make a tractor beam with a pull effect by setting a single target

Just a note, ive noticed theres an actual "pull" effect that i havent found when you go near a planet in a battle, if i could actually find it, it might be possible to replicate.

LazyWizard, if you make it into a MIRV "missile", it is possible to create a blackhole effect when the second projectile comes out
« Last Edit: December 20, 2012, 12:52:04 PM by silentstormpt »
Logged

Upgradecap

  • Admiral
  • *****
  • Posts: 5422
  • CEO of the TimCORP
    • View Profile
Re: Submissions for project CAELUS
« Reply #1206 on: December 20, 2012, 02:20:07 PM »

I thinks it's good as it stands right now. No big changes needed.
Logged

sini002

  • Captain
  • ****
  • Posts: 394
    • View Profile
Re: Submissions for project CAELUS
« Reply #1207 on: December 21, 2012, 03:21:42 PM »

possably give it more damage? it is a black whole and realisticly it can swallow planets, suns and solarsystems...
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Submissions for project CAELUS
« Reply #1208 on: December 21, 2012, 11:11:30 PM »

possably give it more damage? it is a black whole and realisticly it can swallow planets, suns and solarsystems...

I've increased the damage significantly since that video was made. Anything less than a cruiser has a good chance of dying if it's sucked in for the full 30 seconds.

This is meant to be more of a support weapon than a guaranteed one-hit-kill. It's hard to time correctly, and if you generate black holes via impacts instead of the time bomb method the duration is quartered. It already has two benefits no other weapon does - it prevents enemies from running away, and it bypasses shields entirely. Anything else would be overpowered. ;)

LazyWizard, if you make it into a MIRV "missile", it is possible to create a blackhole effect when the second projectile comes out

Yes. You can constantly scan all projectiles on the field and instantly replace the second projectile with a black hole when it's created (basically the same thing this weapon does, without the countdown).


Edit: since the outer rim doesn't show up well in the video and a few people asked about the size of the hole, here's a screenshot with debug particles drawn. It's actually fairly large!
Spoiler
The outer circle is where the pull starts (you can sort of see the dark purple particles that were invisible in the video), and the inner circle is the 'core' where actual damage starts being applied to your ship.
[close]
« Last Edit: December 22, 2012, 02:31:23 AM by LazyWizard »
Logged

ValkyriaL

  • Admiral
  • *****
  • Posts: 2145
  • The Guru of Capital Ships.
    • View Profile
Re: Submissions for project CAELUS
« Reply #1209 on: December 22, 2012, 04:28:19 AM »

I love it, now if it could only pull in asteroids as well.  if you use a sun on the battlefield, the sun has its own gravity effect and it throws ships and asteroids everywhere. maybe that could be useful somehow?
Logged
Pages: 1 ... 79 80 [81]