Coder Social home page Coder Social logo

Comments (4)

isage avatar isage commented on September 17, 2024

Ugh. So, in original game on contact each missile spawns another invisible "bullet" with a predefined lifetime for an each level:
Missile: 10/15/5
Super Missile: 10/14/6
Each frame this "bullet" deals damage to an npc: 1 for missile, and 2 for super missile. Each 3 frames it spawns explosion effect and 2 smoke clouds.
This works fine for lv1 and lv2, however explosions from lv3 missiles for some reason sometime live for another frame, dealing additional dmg.
When shot from a large distance there's large pauses between missile hits and so only one (last) missile deals damage for additional frame. When shot from small distance - two last missiles deal damage for additional frame.
This actually looks like some bug in bullet handling in original game, because there's absolutely no special logic for that in code.

from nxengine-evo.

isage avatar isage commented on September 17, 2024

Oh god, i found it. First of all, frame times above are wrong, they all should be +1 (or not, depending on Pixel's intention)
So: there's an array of bullets. SetBullet adds new bullet to the first found empty slot. ActBullet and HitNpCharBullet just go through this array.
Now, in missile ai calls SetBullet to spawn explosion, that deals actual damage.
Because it's called inside ActBullet loop, if explosion is added to the end of bullet array - it's respective ai gets called on the same frame, thus not dealing damage on this frame.
However, when explosion is added to array somewhere before missile, that spawned it - oops, it's ai is not called on that frame, but only on next one (and on next one it already deals damage, because HitNpCharBullet goes before ActBullet).

Ugh.

from nxengine-evo.

isage avatar isage commented on September 17, 2024

Now, the only problem is i need to somehow reproduce this bug, without completely rewriting how bullets work (they are just objects, without some additional queue)

from nxengine-evo.

isage avatar isage commented on September 17, 2024

Fixed in 8dab4de
Note that sprites.sif is modified.

from nxengine-evo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.