Jump to content
The Dark Mod Forums

Recommended Posts

Posted

You'll want to check out particle effect tdm_flies.prt .

BTW, _Atti_ placed a nighttime swarm of these outside a window, circling in the outward cast beam. (This effect is part of our WIP that will see the light of day in 2021.) You can't really tell what creatures they are... moths, bats, whatever

Posted

@demagogue @Geep

I was looking at the flies particle effect but I'm thinking about something that could do do moths, bats, fireflies and other things. Some sort of func_mover kind of thing where you can bind a moth/bat/firefly to. Moth/bat could be a looping video on a transparent video screen ...

Posted

I also mentioned nurbs. Do a forum search for nurbs to see threads on them, but to start off you can read up on them here: https://forums.thedarkmod.com/index.php?/topic/20163-roadmap-for-tdm-in-2020/page/5/&tab=comments#comment-444657

 

Edit: Somewhere on YouTube there's a video showing a will-o'-wisp flying around using this system, so you can see the system in action and know where to find an example. I even think FenPhoenix was the one that uploaded it. I'd post it if I could, but I can't find it just now. But if you search enough on YouTube or just ask FenPhoenix maybe by PM here or on TTLG, you can find it that way.

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Posted

Just converting over to info_location sounds, and having some problems, as indicated by dmap warnings of form:

WARNING:location entity 'Info_location_x' overlaps 'info_location_y' in area n

For context, imagine x and y are separate adjacent rooms with a single entrance each. Each entrance has a visportal with a locationseparator, and each room (and their common corridor) has its own info_location. No errors are reported concerning the visportals themselves or their locationseparator embedments.

So presumably, there's some crack between rooms x and y that's treating both room as a common portal area. The crack may be some indirect path through adjoining spaces.

What would be most helpful here is a way to generate a pointfile that would run between entities info_location_x and info_location_y. Absent that, is there some other way to discover where the leak is?

Posted
3 hours ago, Geep said:

What would be most helpful here is a way to generate a pointfile that would run between entities info_location_x and info_location_y. Absent that, is there some other way to discover where the leak is?

It's good practice to build maps leaving only the big sealing brushes as worldspawn and everything else func_static, so that you can enable the filter for "All entities" and more easily find gaps in the clean, blocky brushwork.

Apart from that, there's still the old method of intentionally creating a leak to the void -> running pointfile to see which entity is used as the starting point for the red line -> move that entity into either room & turn the rooms' visportals into i.e. wood.

Or export the 2 rooms into a separate map and see what the pointfile does.

  • Like 1
Posted

Thanks. Of the three methods, my thoughts are -

(1) seems unfortunately insufficient for a preexisting large building with 2 dozen rooms and a set of worldspawn rooflines that are complexly-angled and clipped.

(2) and (3) are equivalent in power; probably (2) is the lighter lift, so I'll start there.

But first, I'm continuing the further planned subdivision of the space into various info_locations. This may (or may not) narrow down where the problems lie.

Posted

@GeepCome to think of it, the easiest way to see if theres a leak between the 2 rooms would be to stand in one and enable r_showportals 1. If you can see the other room's portal, there's a leak.

Posted (edited)

At the workshop I was fiddling around with "stacking" sliding doors on 3 axis and a rotator at the bottom, adding some random triggers and all on different speeds, a semi random movement occurs. The nice thing about this is that you can have your object to go around an object in the middle.

https://streamable.com/v5udl9

Now I'm trying to put that into a script and I can get things moving already, but how could the movement be restricted?

I think there are ways to detect when an entity touches an other entity, and when that occurs a change of direction can follow, but isn't that processor heavy?

Other way could be to predefine the area by creating some sort of (alternative) monsterclip (to define no-go areas). But how to put that in a script?

 

Edited by STRUNK
Posted

Re: Finding an internal leak, I think the quickest failsafe way is make a copy, change all the visportal textures for the two leafs to a solid brush texture, put the starting point in one leaf, then cut a hole to the void in the 2nd leaf, then when you call the point_file, it's going to run from the start point through the internal leak out to the void.

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Posted

Thanks for that refinement of Dragofer's suggestion.

Probably the tea leaves I'm basing my analysis on are too muddled so far... Further visportaling and location_separating may clarify the situation. And cutting back on speaker-based sound sources, at least some of those previously used for ambience.

Posted (edited)

Scripting the whole bat/moth seemed to be very difficult, so I made a simple script where a bat hunts after an object that moves by binding rotators and doors together:

Although it takes some effort to implement in a map, the result is rather nice I think. It could, with some tweaking, also be used for other flying stuff ^^

Edited by STRUNK
Posted

My large-building-interior info_location overlap problems have been solved. Here's what I learned -

  • The majority of my problems were due to missing locationseparators. In a large, complex spaces (say, the inside of a duct network), it is easy to overlook an opening or two.
  • One fail was caused by a worldspawn wall which I had stupidly made way too thin (0.125 thick!), which the engine decided was non-sealing.
  • There was only 1 traditional seam leak.

Given that most causes were not leaks, the recommended leak-finding techniques were not fruitful. Instead, what worked was "divide and conquer". More specifically, for each reported overlap:

  1. Subdivide one or both existing info_locations by temporarily installing more locationseparators (usually in new visportals) and named info_locations.
  2. Dmap to check any new visportals, and correct them. (Did a visportal fail because it crossed a seam leak? If not obvious by inspection, try a pointfile).
  3. Map (but don't actually press "attack") the game, in order to get updated overlap information in the console. Which subspace is now reported?
  4. Repeat until you've gotten the culprit area down to manageable size. If there's no obvious missing locationseparator, eyeball the walls closely for seam fails. (Helpful: filter entities; select walls of interest and hide deselected)

When done, any new visportals can be left as non-harmful/maybe-helpful; remove the diagnostic-only info_locations and locationseparators.

  • Like 1
Posted (edited)

I'm working on a script for a random mover that will stay in an area that is set by boundries. Random-Mover.jpg

 

Ok,  I erased the question for I have answers t most of it already. New script down here:

Spoiler

void Warning()
{
    $Warning.rotate( '0 0 720' );
}

void WarningStop()
{
while (1)
    {
    $Warning.stopRotating();
    sys.waitFrame();
    }
}


void Collision()
{
    while(1)
    {
        if ($Warning.isRotating())
        {
        $light_4.On();
        
        $Target1.rotateOnce('0 0 179');// 0 0 180
        sys.wait(0.1);//0.1
        $light_4.Off();
        }
    sys.waitFrame();
    }
}


void RotateRandom()
{
    while(1)
    {

    float minY = 0;
    float maxY = 0;
    float Y = minY + sys.random(maxY - minY);
    
    float minZ = -60;//-60
    float maxZ = 60;//60
    float Z = minZ + sys.random(maxZ - minZ);
    
    vector R = ('0 0 0');
    R_y = R_y + Y;
    R_z = R_z + Z;
    
    $Target1.time (0.1);//0.1
    
    $Target1.rotateOnce (R);
    sys.wait(0.5);//0.5
    }
}

void Move()
{
while(1)
    {
    $Target1.speed (250); //250 max speed?
    $Target1.move(REL_LEFT , 1);
    sys.wait(0.005);//0.005
    }
}

void main()
{
    thread Collision();
    thread RotateRandom();
    thread Move();
    thread WarningStop();
}

 

 

 

 

 

Edited by STRUNK
  • Like 1
Posted

There are different ways to let a script wait, like waitFrame() and wait()

Does waitFrame() wait 1/60th of a second when the game runs at 60fps and 1/20th of a second at 20fps?

If I use wait(0.01) or wait(0.001), it's a shorter wait period then waitFrame. What is the shortest "safe" wait period, and can a fast computer handle a shorter wait time then a slow computer?

Posted
1 hour ago, STRUNK said:

Does waitFrame() wait 1/60th of a second when the game runs at 60fps and 1/20th of a second at 20fps?

I think the game clock runs independently of how fast your PC is producing frames. If you run the game at 20fps, the game clock advances by 3 frames even though you've only seen one frame in that time.

1 hour ago, STRUNK said:

If I use wait(0.01) or wait(0.001), it's a shorter wait period then waitFrame. What is the shortest "safe" wait period, and can a fast computer handle a shorter wait time then a slow computer?

The shortest possible waiting duration is 1/60 of a frame, so 0.0167s. As Obsttorte pointed out once, if you use wait commands the engine checks every frame whether a greater or equal amount of time has passed. So if you specify 0.0200s, the engine will wait 2 frames, 0.0333s.

 

  • Thanks 1
Posted (edited)

@Dragofer

If I getFrameTime() it returns 0.0160 so I guess that is the minimum time the engine can repeat/check things. But if I have a wait of 0.001 in a while() loop, it calculates every frame what would have happened in 16 times this while() loop .. right?

 

I have a working script now and am determaning the right settings for maximum speed. Only problem is I can't get higher then a movement of 12 units in one loop, for it results in the enty escaping through the boundries: 

Spoiler

void Warning()
{
    $Warning.rotate( '0 0 720' );
}

void WarningStop()
{
while (1)
    {
    $Warning.stopRotating();
    sys.wait(0.002);
    }
}


void Collision()
{
$light_4.On();

        $Target1.rotateOnce('0 0 15');
        sys.wait(0.001);
$light_4.Off();
}

void Coll()
{
if ($Warning.isRotating())
Collision();
}

void RotateRandom()
{
    float minY = 0;
    float maxY = 0;
    float Y = minY + sys.random(maxY - minY);
    
    float minZ = -30;//-60
    float maxZ = 30;//60
    float Z = minZ + sys.random(maxZ - minZ);
    
    vector R = ('0 0 0');
    R_y = R_y + Y;
    R_z = R_z + Z;
    
    $Target1.time (0.1);
    
    $Target1.rotateOnce (R);
    sys.wait(0.2);
    float frmTime = sys.getFrameTime();
    sys.println (frmTime);
}

void Move()
{

    $Target1.speed (1);
    $Target1.move(REL_LEFT , 12);
    sys.wait(0.001);

}

void Rest()
{

    $Target1.move(REL_LEFT , 0);
    sys.waitFrame();

}

void MoveRest()
{
    float minA = 0;
    float maxA = 1000;
    float A = minA + sys.random(maxA - minA);
        
        if (A>=0&&A<1)
        {
        Rest();
        sys.wait(1);
        }

        if (A>=1&&A<2)
        {
        Rest();
        sys.wait(5);
        }

        else
        {
        Move();
        }
        
    sys.wait(0.001);
}

void MoveRestCol()
{
while(1)
    {
        if ($Warning.isRotating())
        {
        Coll();
        }
        else
        {
        MoveRest();
        }
        
    sys.wait(0.001);
    }
}

void RotCol()
{
while(1)
    {
        if ($Warning.isRotating())
        {
        Coll();
        }
        else
        {
        RotateRandom();
        }
    sys.waitFrame();
    }
}

void main()
{
    thread WarningStop();
    thread MoveRestCol();
    thread RotCol();
}

So I guess getting a higher speed means I have to find out how to get a greater distance in one loop (that always takes 0.0160 sec), without the escape ...

 

 

Edited by STRUNK
Posted (edited)

Is there something simple I can put in my script, or in my map that is realy eats resourses, so I can test what happens?

Edited by STRUNK
Posted
3 hours ago, STRUNK said:

@Dragofer

If I getFrameTime() it returns 0.0160 so I guess that is the minimum time the engine can repeat/check things. But if I have a wait of 0.001 in a while() loop, it calculates every frame what would have happened in 16 times this while() loop .. right?

It's very probable the 0.0160 is just a rounding down of 0.01666666. The most precise expression of a frame is 1/60 of a second.

sys.wait is less precise than sys.waitFrame because the engine checks every frame how much time has passed. So it checks after 0.0167s, 0.0333s, 0.0500s etc. If you tell it to wait 0.02s it actually waits 0.0333s because that's the first frame where time elapsed is greater than 0.02.

I really don't think there can be less than 1/60 of a second between scripted events, so you'd have to adjust the distance moved.

  • Thanks 1
Posted
15 hours ago, STRUNK said:

Is there something simple I can put in my script, or in my map that is realy eats resourses, so I can test what happens?

Use a gpu overclocking tool to decrease your GPU core clocks to something low like 200mhz.

Do the same thing with your CPU.

This will simulate a garbage potato.

  • Thanks 1

I always assumed I'd taste like boot leather.

 

Posted
42 minutes ago, STRUNK said:

I want to spawn a func_static and a func_mover from script ... is that possible?

You can spawn entities, and you'd probably need to set a model too, like this:

entity spawned_entity = sys.spawn("func_static");
spawned_entity.setModel("models/darkmod/...");
spawned_entity.setOrigin('0 0 0');

 

  • 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

    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 5 replies
    • Goblin of Akenash

      My mapping discord if anyone is interested, its more of a general modding thing rather than just for TDM 
      https://discord.gg/T4Jt4DdmUb

       
      · 0 replies
×
×
  • Create New...