Giter Site home page Giter Site logo

Crash in midgame about ludum-dare-37 HOT 5 OPEN

 avatar commented on September 24, 2024
Crash in midgame

from ludum-dare-37.

Comments (5)

shakesoda avatar shakesoda commented on September 24, 2024

how are you patching the game? I'm able to play it through just fine, and I can't see a way orientation or snap_to could become invalid in such a way that it'd crash like this.

also, don't hack the game, just don't get hit :P

from ludum-dare-37.

 avatar commented on September 24, 2024

Pretty trivially:

diff --git a/src/scenes/play.lua b/src/scenes/play.lua
index b9d74bb..ef9b6c7 100644
--- a/src/scenes/play.lua
+++ b/src/scenes/play.lua
@@ -326,7 +326,7 @@ function scene:enter()
                self.player.animation:play("fall")
                self.player.anim_cooldown = self.player.animation:length("fall")
                self.player.iframes       = self.player.anim_cooldown * 2
-               self.player.health        = math.max(self.player.health - love.math.random(2800, 3200), 0)
+               self.player.health        = math.max(self.player.health - love.math.random(0*2800, 0*3200), 0)
 
                local audio = load.sound("assets/sfx/player_attack_hit.wav")
                audio:setVolume(_G.PREFERENCES.sfx_volume)

I seriously doubt it's related to my hack. Unless the boss' behaviour changes with player's health, that is.

from ludum-dare-37.

shakesoda avatar shakesoda commented on September 24, 2024

I still can't repro, but that hack definitely has nothing to do with it.

from ludum-dare-37.

 avatar commented on September 24, 2024

I've tried to reproduce it again and I was unable. But here's a data point. I'm displaying the ctypes of orientation and snap_to. They both come up as ctype<struct 167> every time. The error complains about struct 162, though, and the affected line has w in the last place, and it doesn't complain about x, y, or z. That makes me think that one of the passed values is a vector rather than a quaternion.

Edit: I've printed the typeof of player.position (which I assume is a vector) and it's indeed 162.

Now the question is, how can that happen? Is it possible that in certain degenerate cases the result is a vector instead of a quaternion? (e.g. the player immediately below the monster)

from ludum-dare-37.

karai17 avatar karai17 commented on September 24, 2024

That would be the only possibility, if a quaternion is being turned into a vec3. But the question is, where? The only time quat should be converting to a vec3 is when converting orientation to a direction. So that means in some obscure case, I am probably using direction instead of orientation and using the lovnform way of writing the code (quat.whatever(entity.direction, whatever2) instead of entity.direction:whatever(whatever2)`)

from ludum-dare-37.

Related Issues (3)

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.