Jump to content
The Dark Mod Forums

MirceaKitsune

Member
  • Posts

    1922
  • Joined

  • Last visited

  • Days Won

    22

Posts posted by MirceaKitsune

  1. 5 hours ago, datiswous said:

    TDM is currelently in early dev, maybe a bit soon to start implementing in missions? I think it's better to wait for beta, so no changes will be done to the system.

    Obviously the change will only work in last night's dev snapshot and onward. But missions can already start implementing this: It's just that older TDM versions won't see the debrief screen and only future players or dev users will enjoy them.

  2. @The Black Arrow That's a good analysis. I don't disagree but we're referring to different time periods with different quality aims: In the early days of 3D and low-res CRT screens when we had 256x256 textures, detail textures were used to make surfaces appear as if they have 1024x1024 textures... today in the age of 1080p monitors such texture can appear blurry from up close, we want to make 1024x1024 textures appear of 4096x4096 quality. Back then the goal was to get at least a little bit of perceived sharpness, today the goal is to see those microscopic details on every surface as if everything is real... while the concept of detail textures is old it scales to cover both aims.

    As you correctly pointed out, the ideal solution would be upgrading the actual textures themselves. Sadly there are two big problems with this that will likely never be possible to overcome:

    • Someone must create or find identical textures to replace existing ones, which have to retroactively fit every old FM. That would be a huge effort for so many images, and will not look exactly the same way so people would complain how "this wall used to be made of small red bricks which are now larger and yellower which isn't what I intended and no longer line up". An advanced upscaling filter may be able to bump the resolution with good results, this would be a lot less effort and retain the exact appearance of textures.
    • The even greater issue is storage and memory use would go through the roof. Imagine all our textures (from surfaces to entity skins) being 4096x4096 which would be the aim for decent quality today: TDM could take over 100 GB of drive space, you'd need at least 16 GB of RAM to run it, and the loading time of a FM will be 5 minutes.

    Detail textures are a magic solution for both problems: They're overlayed in realtime on top of the standard textures without changing their base appearance. This means you see pixels several times the scale of the image without requiring any image to actually be at that resolution, no vRAM or loading time increase. And if detail layers are disabled with distance you also don't lose FPS in per-pixels calculations when distant lights update.

    • Like 1
  3. Thank you for the lovely change! I wonder if anyone can let FM authors know about it: I think this is a great opportunity to update old FM's if their authors are still around and willing to... if anyone does maybe drop a mention here, I'll be happy to replay them for this addition alone.

  4. 10 hours ago, nbohr1more said:

    @Mortem Desino already implemented detail textures into No Honor Among Thieves and his tech demo:

    https://wiki.thedarkmod.com/index.php?title=Detail_Textures

    Interesting! Does it update all default textures so it's used on everything in the world? I should replay it and check that out: It would give us a good view of how the effect will feel in practice.

    Looking at the page, they seem to do it the conventional way I was thinking of trying out, which is currently supported by the engine but more limited than a proper implementation. It also looks like they're only doing it for the albedo channel, to be effective detail should be applied to all maps... the normal map is where the improvement should be most noticeable as it responds to lighting and modifies everything else.

    The implementation I'm thinking of should be universal like all effects and work on any FM new and old. It would be controlled by a menu setting, no one needs to enable it if they don't like how it looks or it impacts performance. Each detail pass should fade and be hidden with distance, we don't want to stress pixel lighting by having it compute thousands of dots on distant surfaces each frame. Just like the TDM ambient method, we'll likely need a special segment for materials meant to indicate what kind of detail each texture wants, then based on settings and camera position the renderer must modify each surface accordingly.

    • Like 1
  5. There's been talk over the years on how we could improve texture quality, often to no avail as it requires new high-resolution replacements that need to be created and will look different and add a strain on system resources. The sharpness post-process filter was supposed to improve that, but even with it you see ugly blurry pixels on any nearby surface. Yet there is a way, a highly efficient technique used by some engines in the 90's notably the first Unreal engine, and as it did wonders then it can still do so today: Detail textures.

    Base concept: You have a grayscale pattern for various surfaces, such as metal scratches or the waves of polished wood or the stucco of a rough rock, usually only a few highly generic patterns are needed. Each pattern is overlayed on top of corresponding textures several times, every iteration at a smaller... as with model LOD smaller iterations fade with camera distance as to not waste resources, the closer you get the more detail you see. This does wonders in making any texture look much sharper without changing the resolution of the original image, and because the final mixture is unique you don't perceive any repetitiveness! Here's a good resource from UE5 which seems to support them to this day:

    https://dev.epicgames.com/documentation/en-us/unreal-engine/adding-detail-textures-to-unreal-engine-materials

    XQiQD3C.png
    NR9W9bw.png

    Who else agrees this is something we can use and would greatly improve graphical fidelity? No one's ever going to replace every texture with a higher resolution version in vanilla TDM; Without this technique we'll always be stuck with early 2000's graphics, with it we have a magic way of making it look close to AAA games today! Imagine being able to see all those fine scratches on a guard's helmet as light shines on it, the thousands of little holes on a brick, the waves of wood as you lean into a table... all without even losing much performance nor a considerable increase in the size of game data. It's like the best deal one could hope for!

    The idTech 4 material system should already have what we need, namely the ability to mix any textures at independent sizes; Unlike the old days when only a diffuse texture was used, the pattern would now need to be applied to both albedo / specular / normal maps, to my knowledge there are shader keywords to combine each. Needless to say it would require editing every single material to specify its detail texture with a base scale and rotation: It would be painful but doable with a text injection script... I made a bash script to add cubemap reflections once, if it were worth it I could try adapting it to inject the base notation for details.

    A few changes will be needed of course: Details must be controlled by a main menu setting activating this system and specifying the level of detail, materials properties can't be controlled by cvars. Ultimately we may need to overlay them in realtime, rather than permanently modifying every material at load time which may have a bigger performance impact; We want each iteration to fade with distance and only appear a certain length from the camera, the effect will cause per-pixel lighting to have to render more detail per light - surface interaction so we'll need to control the pixel density.

    • Like 2
  6. On 4/4/2024 at 10:37 PM, snatcher said:

    Hey @MirceaKitsune

    Things can get pretty busy above the lightgem and I moved the HUD to the top right corner of the screen.

    The modded gui file is attached to this post.

    I hope you resume work on this promising mod someday!

    Aug.jpg

    player_augmentation.gui 27 kB · 0 downloads

    Looks great, thank you! That looks even better: It's where DeusEx had its player status screen, feels even more like TDM with DX characteristics now :D I think I placed it above the light gem as that's where player info was technically being stored, with the new subtitles covering that position the move is a great decision.

    By the way: If anyone wishes to continue and improve this mod, I'd appreciate seeing your remixes of it. I had it mostly finished last time on my end; I think the main issue was upgrades require items to be placed on maps, augmentations may not work on every FM without a way for them to automatically spawn in random places... my imagined solution was to also offer upgrades based on loot gathered or other achievements but I never got around to adding that.

    • Like 1
  7. Sorry for the double report, ran into this myself and quickly posted about it so the issue wasn't missed. Currently the skin editor is unusable: Editing the skin name field instantly crashes DR, so does exiting the menu after making any changes, and any changes you do manage to make are immediately reverted and don't stick. The skin editor is a very useful tool and I hope it can be fixed.

  8. 16 hours ago, Frost_Salamander said:

    I wouldn't have thought it was a big deal to just use a script using atdm:target_callscriptfunction. You can change the spawnarg (using setKey()) with the script or you can make entities visible/invisible by calling Show() / Hide() on the entity.

    You could try this thing: https://wiki.thedarkmod.com/index.php?title=Atdm:target_postscriptevent to call Show/Hide.  I tried it the other day because I didn't know about func_remove and it didn't work (see the note I left on that wiki page), but you could give it a try and see if it works.

    I'll try that: I remember now there's an entity used to call script functions on other entities... show / hide are universal events at the core of the base entity, if that doesn't work something must be very broken.

    Another option I thought of: What if I teleport the atdm:mover_multistate_position entity instead? However I doubt that will work since to my knowledge, dmap compiles elevator positions to some extent so changing them in realtime will likely not work or break stuff, but just in case let me know if that might be safe.

  9. I have an elevator with a button: When the button is pressed it tells the lift move to an atdm:mover_multistate_position entity, which it does by targeting the elevator while having the spawnarg "position atdm_mover_multistate_position_1" to tell it where to go. This works well but I need it to do something special: When an objective is completed, the button needs to make the elevator go to a different position when pressed from that point on.

    I don't know how to do this: If I target the trigger_relay that runs when the objective is completed to the button, that will only make the button press itself. I can't use an atdm:target_changetarget either since it's not the button's target I need to change but its position spawnarg. I don't want to make a script for something this simple so I'm hoping there's a special entity I can use to get the job done.

    One solution would be two buttons: Completing the objective makes the first one invisible and unfrobable while making the second one visible and frobable. But I'm not aware of a way to make buttons visible / invisible either. At worst I'll use an atdm:teleport to swap the buttons, that's an ugly solution so making sure there's no better option first.

  10. 22 hours ago, Frost_Salamander said:

    Is it possible for the mapper to choose which comes first?

    If that is made an option, it should be done for both the briefing and debriefing screens. Currently in every briefing I've seen, video comes before the text pages: It would be most consistent to do the same for the new GUI.

  11. 48 minutes ago, grodenglaive said:

    Here's one I made just using spawn_args and a couple effects on a custom streetlamp. The arrow has a S/R set to trigger the lamp.

     

    image.png.78f577a016b87b1c72b169230cbf1139.png 

    Oh wow, that is amazing! It must require a custom script I imagine? Didn't think that was possible even with one and the S/R system, that's very impressive. Definitely curious about a few things:

    1. Does it distinguish between collisions with the glass and frame? If the arrow hits a metal part it shouldn't do anything, it should only break if the glass in particular was hit.
    2. If the lamp is triggered by a switch, does flipping it no longer turn the light on once it's broken?
    3. Can you use a broken skin rather than model? With some lamps it would be easier to only change the skin and replace the glass, of course both should be supported based on what works best for each lamp.
  12. A basic little detail we don't yet have is breakable decorations, I was wondering what is up with that and if maybe we can change it. Mainly thinking of new small decorations: I believe breakable crates or barrels were once experimented with, the entity may still be there but I've never seen them used, maybe someday those can be finished too.

    Just like metal goblets / plates / vases /  bottles you can pick up and throw, it would be nice to have alternatives made of fragile transparent glass. The difference being that when they hit a surface past a certain velocity, they disappear and shatter into glass shards... I believe the fundamental system for this already exists with breakable glass panels? Gameplay wise they'd have a particular property: When they break they should make a louder noise, causing a slightly higher alert that makes AI look there for longer, not as much as the noise arrow but somewhere between it and throwing a conventional object. As a potential penalty, stepping on a small glass breakable should shatter it which is hearable to AI, FM's that use them may encourage being a bit extra careful where you're going.

  13. 14 hours ago, Ansome said:

    What Stgatilov mentioned about the psychological aspect of some lights being breakable and others not is going to be the toughest hurdle for you to overcome with this idea. Realism with the clear glass casing idea is nice, but you are still fighting against the rigid Thief programming that electric lights are always unbreakable. It needs to be very obvious, perhaps best identifiable at a glance, that it can be broken by the player.

    Consider how all explosive barrels in video games are red: it immediately differentiates them from regular set dressing barrels. I don’t believe that I would be able to consistently identify or interpret a clear glass bulb as different from any electric light. Add a red stripe to them, give them a specific recognizable light texture, make them look inherently damaged, etc. You may need to sacrifice a degree of realism in order to communicate what is thus far a contradictory mechanic to the player effectively.

    Yes, definitely needs to be distinguishable. Clear glass with light bulb visible would be the best way: You know that if you see clear glass and the bulb inside you can shoot it. The distinction isn't always possible to make without first trying it out though... paintings are the best example, you always need to get close to see if a painting can be looted.

    As for players learning about this, we should add those lights to the tutorial level where the basics of TDM are taught: In one of the hallways we'd have examples with the message "solid lights can't be shot, but ones with fragile glass and a lightbulb can be broken with broadhead arrows", the player is given arrows and can shoot at different lamps to compare.

    As for explosive barrels those would be cool to have too! In their case they should already be doable with a script, just that no one's ever done them: Remove the barrel, spawn the same explosion as the fire arrow or mine, and some temporary lasting physical debris if possible. Breakable lights would need support added to the builtin spawnfunc.

  14. 21 minutes ago, stgatilov said:

    And making it possible for the new electric lights to be broken adds a psychological problem: how will players know that they are breakable if in 99% missions they are not?

    Recall lootable paintings and frob-extinguishable unmoveable candles.

    That's why last night I went with the idea of making new lamps with this mechanic: They should have transparent clear glass casing and show the light bulb inside, making it obvious they're different and can be shot. Something like this should make them easy to distinguish:

    UrOIz8L.jpeg

    uKi2W5F.jpeg

    Indeed I run into the painting problem myself: I always check every painting to see if it highlights and can be looted. Then again it's the same with doors in some FM's, which don't use a special door handle to make it clear that's a decorative door and not one you can go through.

  15. 13 minutes ago, OrbWeaver said:

    Oh well, I guess that rules out any kind of mouse grabbing behaviour that will work on Wayland desktops.

    I'm not sure what the alternative is. Some kind of on-screen widget that you can click and drag to rotate the camera, like a sort of circular scroll-bar?

    Mouse look is essential so no. We should use whatever behind-the-scenes solution of messing with the pointer will work... once Wayland or WxWidgets or GTK3 will offer one, it's kind of on them that they haven't up to this point. Until then Jonri's PR works by forcing the X11 backend, which isn't a real solution but in practice solves everything for now.

    Here's a modified snippet of what I did in PyGame which works. Obviously this code has no effect, just an example to show what works in my project, just in case it's a similar situation here: Maybe Wayland expects us to hide the mouse pointer at a core level before it allows locking, and the reason it doesn't work is DR only hides it visually at top level?

    pygame.mouse.set_visible(False)
    x, y = pygame.mouse.get_pos()
    pygame.mouse.set_pos((x, y))
    pygame.mouse.set_visible(True)

     

  16. 1 hour ago, Ansome said:

    Breakable lights might be an interesting concept so long as they are not implemented retroactively. Add a loud sound or other punishment for breaking them as you see fit, but it would still change the difficulty and design intended by level authors if you applied it to all previously made levels. I would also suggest that if you instead intend to make breakable variants of existing light models that you add a clear visual indicator that the light is breakable, otherwise it would require explicit messaging to the player that electric lights are breakable in that particular FM. I’m hesitant to see something of this sort added as it is in stark contrast to Thief precedent, but I would be more supportive of it if it was added carefully and responsibly.

    It might then be best to add it to new light models designed for the purpose. The visual cue should be making them more glassy and fragile looking: Existing lamps look pretty solid, we can argue those were made of reinforced glass built to withstand powerful impacts, something something Inventors Guild... in contrast we'd have a few lamps with very transparent glass that show the light bulb inside, their design shows their fragility and makes it clear those are meant to be shot.

    • Like 2
  17. 1 hour ago, Amadeus said:

    Yeah, I guess I didn't consider making a new entity for future mappers to implement in their future maps when I responded to you (sorry!), but that is not a bad idea. The changes should be done in a way where it wouldn't affect older FMs, and it would be a fair chunk of work. I actually have a few breakable lights in my WIP, although they are kinda glitchy and far from perfect. 

    It's okay! I'm down with any option hence why I asked. But I agree: Most players would likely not approve of such a change being done retroactively and affecting all old FM's, so it would likely be best as a derivative entity for mappers to use in the future based on new or existing lamps that can provide one.

    In any case it would likely require engine changes, not something you can currently do with a script: Lights already use their own hardcoded script classname which can't be overridden. Even if it weren't for that I don't think there's a way to intercept broadhead arrow collisions and check what kind of surface they hit, even with the Stim / Response system.

    There should probably be two new spawnargs: A breakable boolean enabling the feature on an entity, and a skin_broken to specify the skin used when a light was smashed.

  18. 1 hour ago, Amadeus said:

    This kind of mechanic would break a ton of existing FMs. Some (I dare say even most) mappers often choose electric lamps so that they can't be extinguished or turned off, forcing the player to time their movements through the light. There are of course switchable electric lights, but that is up to the author on how they want to implement those.

    It would definitely be fun to see an FM implement this Splinter Cell-style mechanic, where the mapper has designed their map to function in such a way, but to add this as a core feature would break the gameplay of countless maps

    Yeah, that is a true aspect. Which is why I think there could be one of two approaches if this happened: Either make breakable lights a new entity for some lamps that want to feature them, so just as you have "atdm_lamp_1" and "atdm_lamp_1_unlit" you'd have an "atdm_lamp_1_breakable"... or if we implemented it for all lamps retroactively, it should come at the cost of AI becoming suspicious whenever they see a broken lamp just like when they notice a rope arrow, in which case the player choosing to go down this route comes at the cost of attracting attention and possibly ruining their stealth score.

  19. I couldn't help thinking of another realism related suggestion, don't know if it was discussed before but it seemed like an interesting idea. If this were to be changed on existing lights by default, it would have minor gameplay implications, but the sort that make missions easier in a fair way.

    So... electric lights: Like the real ones of the era, they're implied to use incandescent light bulbs... the kind that in reality will explore and shatter upon the smallest impact, and which like real lamps are encased in glass or paper. In any realistic scenario, shooting a broadhead arrow at a lamp or even throwing a rock at it would cause it to go through the glass and break the light bulb inside. Is it wrong to imagine TDM emulating this behavior as a gameplay mechanic? Just as you can shoot water arrows at flame based lights to put them out, you'd shoot broadhead arrows at electric lights to disable them... you must however hit the glass precisely, there's no room for error and it must be a perfect shot. As a way to compensate for the benefit, AI can treat this as suspicious and become alert if seeing or hearing a lamp break, or finding a broken lamp at any time if that's deemed to provide better balance.

    A technical look at implementing this: Just as broadhead arrows can go and stick through small soft objects such as books, they should do the same if you hit the glass material on a lamp, while of course still bouncing off if you hit metal: Lamp glass would need a special material flag that sends a signal to the entity upon collisions but allows arrows to go through, unlike glass in other parts of the world which is meant to act as solid and changing that everywhere would break a lot of things. When pierced by an arrow, the lamp should immediately turn itself off while playing a broken glass sound and spawning a few glass particles. The glass material should be hidden if the model is a transparent surface, or replaced with a broken glass texture in case the glass is painted on a lamp model without an interior... obviously this would be done by defining a broken skin for the entity to switch to.

    This does imply a few complexities which should be manageable: Existing lamps supporting this behavior will need new skins and in a few cases new textures, the def must include a new skin variable similar to the lit / unlit skins in this case a broken skin. Any electric light may be connected to a light switch, we don't want toggling the switch to bring the light bulb back to life... as such a flag to permanently disable triggering the light from that point on would be required. For special purposes such as scripted events to reset the world, we should allow an event to unbreak lamps, setting their state back to being lit / unlit while re-enabling trigger toggling.

    What do you think about this idea and who else wants it? Would it be worth the trouble to try and implement? If so should it only be done for new lights or as a separate entity definition of existing ones, or would the change be welcome retroactively for existing missions without players and FM authors alike feeling it makes them too easy?

  20. 23 minutes ago, jonri said:

    It might be simplest for us to figure out an easy way to automatically force the x11 backend to be used.

    There might be another way, or at least it's what I thought of as a non-developer: Use a different way to transform mouse movement into camera rotation or viewport offset. Is there no alternative to calculating the distance from the pointer to the window center before resetting the pointer to the middle? There must be other mouse look implementations that could work.

    Most obvious alternative: We can detect how much the pointer moved on the screen compared not to the center, but to its previous position wherever that may be. While of course still trying to lock it in the middle, but if that fails at least it doesn't cause the view to go crazy: The only issue then will be the cursor reaching the screen edge and having to be re-engaged so you can keep scrolling in that direction, which is also a big annoyance but comparatively less bad and not as noticeable unless you do long-range movements in one go. Any reason why we couldn't give this option a try?

  21. I manually integrated and tested your PR. There is good news and bad news: The good news is that when running with the "GDK_BACKEND=x11" flag, using the clipper tool no longer breaks the window forcing me to restart DR afterward, the model / entity viewer no longer experiences the issue either. The bad news is that flag is still required, every viewport retains the problem if running Radiant in Wayland mode, we still have a big problem Linux users will increasingly run into as distros adopt it (KDE Plasma 6 now uses Wayland by default).

    So please integrate the PR if it doesn't break anything, it makes life much easier in the meantime! But this should remain open until either DR or WxWidgets or Wayland solve the core issue that exists when running in native mode.

  22. 10 minutes ago, jonri said:

    I revisited this issue and might have had a breakthrough.  I noticed that when using the clipper my cursor wasn't changing, and afterwards when the cursor was no longer hidden when the dragging problem starts happening.

    If I take out the code that is supposed to change the mouse cursor when activating the clipper, the drag behavior remains correct during and after using the clipper tool.

    If I remember correctly from last time I went down this rabbit hole, Wayland has restrictions on pointer locking and I think it was only allowed while the pointer is hidden.  I'm guessing something with changing the cursor is failing and then it doesn't get hidden before the pointer lock happens, causing Wayland to reject the pointer lock request.  And when the pointer doesn't get locked, the math to calculate the drag amount goes all wonky.

    @MirceaKitsuneor others, if you'd like to try a quick and dirty workaround, find the

    void OrthoView::setCursorType(CursorType type)

    function and put a return statement on the first line so it doesn't actually change the cursor.

    I'll see if I can figure out what's actually going wrong when setting the cursors so we can make a proper fix.

    Oh my gosh, thank you for this! After reading what you just said, I realized I've in fact noticed the same thing in another program, but assumed it must be something completely unrelated: I've been working on creasing a CPU based voxel raytracing engine in Python, for which I settled with using PyGame. When the time came to implement first person camera control using the mouse, I noticed it did not work initially... however if I told my code to hide the mouse pointer first, locking it in the center of the window started working. It must be the same thing here in some form, Wayland likely has some very particular expectation on how the mouse pointer must be set in order to be locked.

    In fact just a few days ago, I tried a virtual worlds software called Vircadia / Overte again to see how it's been progressing. I activated mouse look mode and guess what happened: The exact same behavior of the view spinning endlessly as the cursor drifts away from the center due to lack of locking. So it's clearly happening to many things and not just GTK / WxWidgets related... but no all of them, most games (including TDM itself) work perfectly fine and mouse control never breaks.

    I'll try your solution later and mention the results, likely tomorrow as it's late now and I need to head off. If it works that would be incredible! At least as a workaround, we could simply not hide the cursor on Wayland, which will look ugly but at least allow using DR without needing hacks until they can solve whatever is happening on their end.

    Also Plasma 6 was just released, my distribution (Manjaro) will likely be getting it a couple of weeks or at most months from now. I'm curious how that will affect it: Hopefully it won't make the issue worse, but just in case I'd be happy to have a solution in Radiant before then.

  23. Yes please: I've wanted something like this for a long time! One thing that always makes me sad in TDM is when a mission just... abruptly ends: Obviously every FM has an ending, but I never liked just transitioning to a stats screen as if nothing you did in the world mattered. I'd absolutely love a debriefing GUI just like the briefing one, where you can either have text or an image slideshow with music and voice-over which would be even better! Maybe some old FM's can be updated to use this too, I'd totally replay them just for that.

    One additional idea: Since FM's with multiple endings are something I always wished for and would love to do myself, support for multiple debriefing GUI's would be ideal, so the kinds of objectives you completed can execute a different one or skip / add certain passages. Absolutely hope the team can consider this, should be just a GUI execution hook to implement it so why not :D

    • Like 1
×
×
  • Create New...