Jump to content
The Dark Mod Forums

Recommended Posts

Posted (edited)
2 hours ago, Amadeus said:

Keep in mind, this will only work if you have the latest dev17234-10914  build installed. 

Indeed, if you try to install this with an earlier build (I forgot), tdm refuses to start, until you either remove this potion mod, or upgrade tdm.

Edited by datiswous
  • Like 1
Posted (edited)

Now using the latest tdm build.

This fm crashes to desktop (Linux):

Spawning entities
*** stack smashing detected ***: terminated
signal caught: Aborted
si_code -6
Trying to exit gracefully..
--------- Game Map Shutdown ----------
ModelGenerator memory: 1 LOD entries with 0 users using 16 bytes.
--------- Game Map Shutdown done -----
Shutting down sound hardware
idRenderSystem::Shutdown()
...shutting down QGL
I18NLocal: Shutdown.
------------ Game Shutdown -----------
ModelGenerator memory: No LOD entries.
Shutdown event system
--------------------------------------
shutdown terminal support
About to exit with code 0

 

Edited by datiswous
Posted

Great stuff, this will be a lot of fun to play with.

Speaking of gravity, is there any way to reverse gravity, so that the player falls up? I experimented a bit with calls to $player1.setGravity with positive numbers in the Z direction, but the results were weird. Kind of seems like the player is turned on his head? Anyway, I wonder if the game engine isn't meant to handle this. It would be nice if it did, for a mission that I'm working on.

  • Like 1
  • Thanks 1
Posted
23 minutes ago, joebarnin said:

Speaking of gravity, is there any way to reverse gravity, so that the player falls up? I experimented a bit with calls to $player1.setGravity with positive numbers in the Z direction, but the results were weird. Kind of seems like the player is turned on his head? Anyway, I wonder if the game engine isn't meant to handle this. It would be nice if it did, for a mission that I'm working on.

So I know you can definitely do some weird things like turn the game map upside down (I did this when I was first experimenting with an earlier version of this potion, that was pretty wild) but I don't remember HOW I did that. I'm not too sure about reverse gravity but I'm fairly confident you should be able to do it. Sorry that's not a particularly helpful answer 😬

 

42 minutes ago, datiswous said:

Indeed, if you try to install this with an earlier build (I forgot), tdm refuses to start, until you either remove this potion mod, or upgrade tdm.

Yeah, that's because the slowfall script is dependent on script events related to gravity and air movement (setGravity and setAirAccelerate) that were introduced in this latest dev build

  • Like 1
Posted
3 minutes ago, datiswous said:

Ok but it crashes to desktop, so I'm not sure if it was properly tested.

 

It hasn't been properly tested, hence this very post asking for testers :) as for why it crashes on Linux, I have no idea, sorry. I'm not familiar with the linux environment

  • Like 1
Posted
Spawning entities
*** stack smashing detected ***: terminated
signal caught: Aborted
si_code -6
Trying to exit gracefully..
--------- Game Map Shutdown ----------
ModelGenerator memory: 1 LOD entries with 0 users using 16 bytes.
--------- Game Map Shutdown done -----
Shutting down sound hardware
idRenderSystem::Shutdown()
...shutting down QGL
I18NLocal: Shutdown.
------------ Game Shutdown -----------
ModelGenerator memory: No LOD entries.
Shutdown event system
--------------------------------------
shutdown terminal support
About to exit with code 0

 

@nbohr1more, @stgatilov do you know what would cause a crash like this for Linux? On Windows, everything is seemingly fine, so I'm not really sure how to fix this 

Posted
8 minutes ago, nbohr1more said:

Are all your variables lower case or case matched ? ( Linux is case sensitive )

this is the script:
 

Spoiler
#ifndef SLOWFALLPOTION
#define SLOWFALLPOTION

float   inUseSlowfall;
float   endTimeSlowfall;
float   soundEndTimeSlowfall;
float   soundEndPlayedSlowfall;

object slowfallpotion : player_tools
{
    void inventoryUse(player userEntity, entity frobbedEntity, float buttonState);
    void physicsLoop();
    void soundLoop( entity userEntity );
};

void slowfallpotion::inventoryUse(player userEntity, entity frobbedEntity, float buttonState)
{
    //drink the potion
    userEntity.changeInvItemCount(getKey("inv_name"), getKey("inv_category"), -1);
    userEntity.startSoundShader( getKey("snd_swallow"), SND_CHANNEL_VOICE );

    //reset timers
    endTimeSlowfall = sys.getTime() + getFloatKey("duration");
    soundEndTimeSlowfall = endTimeSlowfall - abs(getFloatKey("end_sound_lead"));
    soundEndPlayedSlowfall = 0;

    // if the player is already slowfalling, there is nothing more to do
    if (inUseSlowfall)      return;
    else                    inUseSlowfall = 1;

    //monitor the player's fall
    thread physicsLoop();
    thread soundLoop( userEntity );
}

void slowfallpotion::physicsLoop()
{
    //set up the new gravity and air acceleration properties
    vector newGrav;
    newGrav_z           = -abs(getFloatKey("gravity"));
    float maxVel        = -abs(getFloatKey("max_fall_speed"));
    float braking_rate  = abs(getFloatKey("braking_rate"));
    $player1.setGravity(newGrav);
    $player1.setAirAccelerate( getFloatKey("horizontal_acceleration_multiplier") );

    float curr_time = sys.getTime();
    float prev_time, delta_time;

    while (sys.getTime() < endTimeSlowfall)
    {
        sys.wait(0.0159);

        //timekeeping
        prev_time = curr_time;
        curr_time = sys.getTime();
        delta_time = curr_time - prev_time;

        //gradually slow the player down if the player is falling and their vertical velocity exceeds the limit
        if( !$player1.isAirborne() )
            continue;

        vector playerVel = $player1.getLinearVelocity();
        if( playerVel_z < maxVel )
        {
            playerVel_z = sys.min( playerVel_z + (braking_rate * delta_time), maxVel );
            $player1.setLinearVelocity(playerVel);
        }
    }

    //reset gravity and air acceleration properties when the effect ends
    newGrav_z = -$world.getFloatKey("gravity");             //default is ('0 0 -1066')
	$player1.setGravity(newGrav);
    $player1.setAirAccelerate(1);                           //default is 1
    inUseSlowfall = 0;
}

void slowfallpotion::soundLoop( entity userEntity )
{
    //loop designed to be able to play the end sound multiple times, x seconds before the effect ends
    //in case the player drinks another slow fall potion shortly before the previous one expires

    while( inUseSlowfall )
    {
        while( !soundEndPlayedSlowfall )
        {
            //wait for the end sound's timer to elapse
            sys.wait(0.0159);

            if( sys.getTime() >= soundEndTimeSlowfall )
            {
                userEntity.startSoundShader( getKey("snd_end"), SND_CHANNEL_VOICE2 );
                soundEndPlayedSlowfall = 1;
            }
        }

        //sound has played; now wait a frame before checking whether the sound will need to be played again
        sys.wait(0.0159);
    }
}

#endif

 


 

Posted
6 minutes ago, nbohr1more said:

Which mission is impacted?

It's not impacting any existing mission (aside from an unreleased WIP), but I just want wanted to get feedback on the potion itself first. Datiswous was saying that they couldn't even boot up the test map without their game crashing to desktop. I included a pk4 in the OP that has a test map and all of the relevant assets. Thanks for looking into this!

Posted
2 hours ago, nbohr1more said:

Some sort of buffer overflow.

Are you using any parameters that reference "long" floats?

Are all your variables lower case or case matched ? ( Linux is case sensitive )

I dont think DoomScript allows you to use any other kinds of floats, and variables always have to be case matched since DoomScript, too, is case sensitive.

  • Like 1
Posted

I love it! Congratulations @Amadeus and Team. Very well done! Looking forward to missions making use of the Slowfall mechanic! 🥰

Because of other games with similar dynamics my brain is desperately asking:

  • To be able to change direction slightly
  • To reduce momentum by pressing jump

(Just sharing first impressions eh, nothing else)

  • Like 1

TDM_Modpack_Thumb.png

Posted
5 minutes ago, snatcher said:
  • To be able to change direction slightly
  •  

Glad you're diggin' it, snatcher! As for changing directions, we tried looking at that, but it seems to be a limitation for now. You can hit the Run/Walk key and gain a bit more movement control while your falling, but that's about it. As for reducing momentum.... that's an interesting idea 🤔

  • Like 1
Posted

I can confirm that this doesn't work on Linux. I get the error

*** stack smashing detected ***: terminated

and an immediate CTD.

  • Like 1

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted

When using the Slowfall a regular jump is way longer than usual. And I think this goes in detriment on when mappers can make the potion available in their maps (shop? half way through? right when required?). A seasoned mapper such as yourself will understand. Perhaps the slowfall effect should apply only after a certain downwards speed is reached?

 

TDM_Modpack_Thumb.png

Posted
3 hours ago, Amadeus said:

Glad you're diggin' it, snatcher! As for changing directions, we tried looking at that, but it seems to be a limitation for now. You can hit the Run/Walk key and gain a bit more movement control while your falling, but that's about it. As for reducing momentum.... that's an interesting idea

That was what my latest commit shortly before the test went live was about actually. Core TDM already supports moving towards any direction while falling, but it's very slow so the slowfall potion amplifies your horizontal acceleration by about 5x. That said, something in spoilers for people who have already tried changing direction mid-air:

Spoiler

While falling, the run key still works and lets you change direction much faster. Did it occur to you to hold down the run key while you were falling (assuming you don't have always-run enabled anyway)?

Please feel free to reply in a spoiler.

 

  • Like 1
Posted
3 hours ago, snatcher said:

When using the Slowfall a regular jump is way longer than usual. And I think this goes in detriment on when mappers can make the potion available in their maps (shop? half way through? right when required?). A seasoned mapper such as yourself will understand. Perhaps the slowfall effect should apply only after a certain downwards speed is reached?

Yep, a side-effect of the current implementation is that your horizontal jump distance is significantly longer, even if your vertical jump height is still the same. It kind of makes sense to me that you would be able to cover more distance if you hang in the air for much longer, and I don't think it would feel good for gravity to abruptly change depending on your vertical velocity. But it would be be possible to scale your horizontal acceleration with your vertical velocity, if this is more widely desired. Maybe gravity, too, should scale with velocity in some way.

Posted

Looks like something is causing the collision code to go nuts trying to finish the polygonal windings? @stgatilov
 

Spoiler
*** stack smashing detected ***: terminated

Thread 1 "thedarkmod.x64" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)
    at ./nptl/pthread_kill.c:44
warning: 44    ./nptl/pthread_kill.c: No such file or directory
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)
    at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>)
    at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ./nptl/pthread_kill.c:89
#3  0x00007ffff764526e in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/posix/raise.c:26
#4  0x00007ffff76288ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff76297b6 in __libc_message_impl (
    fmt=fmt@entry=0x7ffff77ce765 "*** %s ***: terminated\n")
    at ../sysdeps/posix/libc_fatal.c:132
#6  0x00007ffff7736c19 in __GI___fortify_fail (
    msg=msg@entry=0x7ffff77ce77d "stack smashing detected")
    at ./debug/fortify_fail.c:24
#7  0x00007ffff7737ea4 in __stack_chk_fail () at ./debug/stack_chk_fail.c:24
#8  0x00000000004ed732 in idCollisionModelManagerLocal::TryMergePolygons (
    this=<optimized out>, model=<optimized out>, p1=<optimized out>,
    p2=0x7488370)
    at /home/user/darkmod_src/trunk/cm/CollisionModel_load.cpp:1487
#9  0x000000570000005b in ?? ()
#10 0x00007fffffffa560 in ?? ()
#11 0x0000000007cbecb0 in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--RET
#12 0x00007fffffffa540 in ?? ()
#13 0x0000000007ca2580 in ?? ()
#14 0x0000000007e7fec0 in ?? ()
#15 0x00000000015fd900 in cm_windingList ()
#16 0x0000000007cbecb0 in ?? ()
#17 0x0000000007e7fec0 in ?? ()
#18 0x00007fffffffa560 in ?? ()
#19 0x00000000004f0bef in idCollisionModelManagerLocal::MergeTreePolygons (
    node=0x6200000067, model=0x6a0000006f, this=0x660000006b)
    at /home/user/darkmod_src/trunk/cm/CollisionModel_load.cpp:1570
#20 idCollisionModelManagerLocal::FinishModel (this=0x660000006b,
    model=0x6a0000006f)
    at /home/user/darkmod_src/trunk/cm/CollisionModel_load.cpp:2966
Backtrace stopped: Cannot access memory at address 0x5a00000067

 

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted
20 hours ago, datiswous said:

Ok but it crashes to desktop, so I'm not sure if it was properly tested.

(although I have no clue what the reason is)

Is the crash to desktop when you attempt to launch TDM, when you load the map or when you drink a potion?

Posted

It is caused by trying to convert render model into collision model for these two models:

  • models/darkmod/nature/skybox/starry2/moon_full.ase
  • models/darkmod/nature/skybox/starry2/moon_full_glow.ase

I guess the models are just planar grids. The engine tries to merge all the incident planar quads, and suddenly gets more than 64 edges in total. And there is no protection against it. Windows build is lucky to have some extra space, but Linux build dies.

I fixed it in svn rev 10916.
Meahwhile, I think you can mark the skyboxes as non-colliding?...

  • Like 2
  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      My First time trying dromEd and DR. It's quite intimidating lmao 
      I'm starting to get the big picture
      Hope i get enough time , juggling multiple interests has never been easy
      · 7 replies
    • The Black Arrow

      Well, this is just sad...I was not able to play any Thief or TDM whatsoever, why? Too busy the past 2 months, this month I'm not as busy BUT it's also very heaty in my place.
      I can't play Thief when it's not at least 15c or lower, the game demands to be played when it's cold for...Well, may sound stupid but I'll just say it, for that "immersion".
      It's kinda like playing Quake during Summer, which unless it's the Summer Jam mod, I don't think it's as fun.
      · 5 replies
    • STiFU

      Oh my gosh, I just realized, I will have my 20 year Dark Mod anniversary this year. 😮 I've literally spent half my life with The Dark Mod. That's crazy!!
      · 8 replies
    • Arcturus

      I need money. Anyone wanna hire a 3d artist?
      · 4 replies
    • Petike the Taffer

      The preliminary working titles for the missions in my now-in-development Partners in Crime series: 
      - Partners in Crime 1: A Mere Trinket
      - Partners in Crime 2: Beacon Burglary
      - Partners in Crime 3: In the Bleak Midwinter
      - Partners in Crime 4 (5 ?): Fishy Dealings
      - Partners in Crime 5 (4 ?): A Thief in the Night

      No title stealing, please.  In return, I promise to finish these. I do stress the preliminary part. Beyond the broad strokes storyline, plot, objectives, briefings and the (currently built) layouts of these FMs, I haven't fully decided about every single detail yet, including the exact order of the missions (4 and 5 might switch places, with the story adjusted accordingly). I want the overall plot to be plotted out a bit in advance and not suffer too much from inserting prequels later. I also prefer to let my FM building fill out part of the details naturally.

      Currently working on the second FM, and once I do enough work on the current prototype, I'll work on the first one, until I get that one released. Then complete the second one, get that one ready for release (hopefully) a few months later, and so on. I want most of the early missions to be fairly small and confined, and get a bit bigger as I grow more confident in my FM making skills.

      Though there is an overarching storyline to this series, the missions themselves are mostly episodic in nature. They factor into the character development of the two main characters I'll have in the series, but it's the kind of continuity where the mission's own plot and story wouldn't depend on it. 
      · 2 replies
×
×
  • Create New...