site banner

Friday Fun Thread for July 28, 2023

Be advised: this thread is not for serious in-depth discussion of weighty topics (we have a link for that), this thread is not for anything Culture War related. This thread is for Fun. You got jokes? Share 'em. You got silly questions? Ask 'em.

2
Jump in the discussion.

No email address required.

I've been playing a lot of modded Skyrim recently and finding lots of instances of objects placed incorrectly causing holes or hidden surfaces to be visible. For those with 3d programming experience, does writing a program to detect and report these seem like a reasonable project as an excuse to learn how to work with 3d graphics for an experienced programmer who is completely unfamiliar with 3d graphics or would this be biting off a bit too much?

Since no-one has commented on the technical question, @ZorbaTHut do you have thoughts here? Is this a reasonable first step into 3d graphics programming?

That's going to be painful as hell and not actually very helpful for learning, I'm sorry to say :V

Algorithmic calculations on 3d meshes are surprisingly gnarly, especially if you're trying to answer binary questions like "is there a hole here". You're kinda trying to build a massive constructive-solid-geometry system, and those have all kinds of nasty edge cases and special cases. In addition, you're going to find that there's a lot of meshes that line up perfectly, which sounds like it's easy to handle, but in reality just exposes all the flaws of floating-point accuracy problems.

If you want to do 3d graphics . . .

. . . well, first, what part of 3d graphics? The rendering side of things, the tool-creation side of things, or the actual art creation? If you want to do rendering, are you more interested in getting your hands dirty with the absolute low-level stuff, or would you rather do VFX and new-special-effect development?

Are you hoping for a game industry job, some other form of 3d rendering employment, or is this just for fun? If it's just for fun, what kind of things do you want to make?

I could write some giant branching conditional flowchart for all of this but it would take forever, so I'll wait for answers :V

This is entirely for fun, as I'm pretty happy with my current job in a very different area of programming. I'm mostly interested in being competent enough to write code to scratch itches like this one for the games I play, so I guess I'd say the tool-creation side of things.

EDIT: Particularly tools for automating detection of "problems" or other kinds of batched analysis. I'll also note that my current job regularly involves numerical analysis in Fortran, so I'm not unfamiliar with floating-point accuracy issues.

This is definitely not a conventional first step into 3d graphics programming, then :)

But what you're basically looking at is to take all the objects in the world in an area and doing CSG operations on it. From there, you'd be looking at some form of leak detection or verification that it's a single closed mesh - you'll also want to cap off the sky and make geometry walls around the area you're testing, of course.

How you expose it to the user is a major part of tool development, but IMO the algorithm here is going to be the hard part, so to start with, just hack up something that works and don't worry about making it pretty. Later, ideally you'd want some kind of visualization that can point out the issue (the fact that this is in a game and intended for modding means that you could in theory plop down a 3d waypoint and just direct the user there, but for gamedev people would want an external tool built into the editor; I don't offhand know how that works with Skyrim, is there an editor? If possible, integrate with it!)

You are definitely going to have a bunch of weird issues, but the good news is you also have a huge existing test suite - specifically, "Skyrim" - so if you can automate running this over the entire world then that'll do a lot to hammer out the issues.

I saw your comment originally, but forgot to answer. I only played around with modding Morrowing way back when, so I'm not familiar with what Skyrim lets you do, but I don't remember anything particularly 3d-graphics-programming-y about it. Does Skyrim scripting let you do some vector/matrix math (other than you implementing it by hand that is)? That's the typical entry point into the world of 3d programming.

For those with 3d programming experience, does writing a program to detect and report these seem like a reasonable project as an excuse to learn how to work with 3d graphics

I might be missing something obvious, but it sounds like a nightmare to me. I think you could do something clever to only fetch the spaces affected by the mod you want to validate, but after that... How would you decide which surface is supposed to be hidden, or a hole is not meant to be there? What does "visible" mean? You'd run a sweep through the entire room?

Does Skyrim scripting let you do some vector/matrix math (other than you implementing it by hand that is)?

I don't know, but I was planning to do this as a separate (probably C++) program that just loaded all the resources and analyzed it rather than doing it in Skyrim itself. The idea was to start off learning how the assets are stored, how the data structures for the models work together, etc and build up to being able to run a "simple/naive" analysis on them.

How would you decide which surface is supposed to be hidden, or a hole is not meant to be there?

It wouldn't, it would just try to identify all of them and leave it to someone/something else to decide if it is meant to be there or not.

What does "visible" mean?

I don't know much about 3d graphics at the moment, but I believe a naive algorithm for detecting what I'm looking for would be to cast a ray from a spawn location straight down until it intersects a surface, then do a breadth-first search of all adjacent surfaces recording any that are adjacent to (roughly, share an edge with) one without a renderable texture.

You'd run a sweep through the entire room?

Ideally it'd sweep over every worldspace in the game.

For the life of me, I can't remember the name of the guy, but when I was getting into 3D programming, there was a series of OpenGL (or was it DirectX) tutorials that some dude wrote, and everybody was using. It looked kind of like this one, and it took you through all the relevant math, and showed all the basics from rendering/manipulating 3d models, to texture mapping, and taught cool effects. Personally I'd go with something like this for a start.

I don't know, but I was planning to do this as a separate (probably C++) program that just loaded all the resources and analyzed it rather than doing it in Skyrim itself. The idea was to start off learning how the assets are stored, how the data structures for the models work together

With this alone you'd have your hands full, I think.

It wouldn't, it would just try to identify all of them and leave it to someone/something else to decide if it is meant to be there or not.

Well, even then you need some criteria to try identify them. Otherwise you'd be showing people the entirety of the game map.

I don't know much about 3d graphics at the moment, but I believe a naive algorithm for detecting what I'm looking for would be to cast a ray from a spawn location straight down until it intersects a surface, then do a breadth-first search of all adjacent surfaces recording any that are adjacent to (roughly, share an edge with) one without a renderable texture.

Yeah, you can do that (and in fact I distinctly remember Morrowind having a scripting function for it), the issue is that you can cast an infinite amount of rays from any point. You can get around that if you know what you're supposed to be looking at. For example, to determine if an NPC can see you, you can cast a ray from it's head on to the center of the player's model (or to a few points defining it's boundaries). If something breaks the line of sight, the NPC can't see you, if not, he can. Then you write the AI code to react appropriately. But if you're sweeping the entire map, and casting rays from everywhere towards everywhere, you're going to make your CPU weep tears of blood. And coming back to identification - if you don't know which rays are supposed to be broken, and which are not, the entire exercise is kind of futile.

Ideally it'd sweep over every worldspace in the game.

That would take approximately forever.

Yeah, you can do that (and in fact I distinctly remember Morrowind having a scripting function for it), the issue is that you can cast an infinite amount of rays from any point.

I don't think I communicated the intended algorithm well. This is just intended to be a batch program that you point your load order at and it spits out a file listing all the "holes" it found. I would only cast a single ray per worldspace, straight down from the (first, if more than one) spawn location to identify a surface to start the breadth-first search. My assumption is that this initial surface would almost certainly be part of the composite surface surrounding the playable volume of that worldspace rather than something floating within it, and thus "flooding" over it with a breadth-first search would suffice to identify holes.

EDIT:

Well, even then you need some criteria to try identify them. Otherwise you'd be showing people the entirety of the game map.

I do have a criteria to identify them: a surface with a texture adjacent to one without a texture. It is classification of them that I defer on. The definition of "adjacent to" is a bit complicated, but basically shares an edge with and if you rotated them around that edge they'd come together without intersecting another surface.

So to make sure I got it right: just a scan from the top to make sure there's no holes in the floor / the ground?

Yes, though I expect for interior worldspaces it'd wrap around to cover the walls and ceilings as well.

Oh ok. I think that should work for interiors (though the math of it is beyond me at the moment)... For exteriors, I thought there are not holes in the ground in TES games, that the map is literally a heightmap defining where topography of the ground?

More comments

Do these flaws reveal spoilers or ruin the immersion or surprise? Which mods are you running. I finished Morrowind and wish to play through Skyrim at some point but I don’t want to ruin it.

Do these flaws reveal spoilers or ruin the immersion or surprise?

I suppose they could in theory though I don't think I've ever found one that does. Usually just a mesh isn't quite aligned with the one next to it leaving a few pixel gap where the void is visible, or one of the rocks on a mountain is shifted enough that you can see its insides.

Which mods are you running.

Currently the Tempus Maledictum Wabbajack list.

Can you write a bit more on why you're playing Skyrim? I'm just genuinely curious. I want to motivate myself to play, and not give up after a week this time.

I'm endlessly drawn to Elder Scrolls games. They're near to what I would call "perfect" games for myself. My biggest complaint is the combat system. In Morrowind and (maybe) Oblivion I don't mind it, because the magic system is so open. You can craft your own spells, launch yourself all across the world map, nothing is restricted. In Skyrim however, the restrictions are there, and I can't give it a pass on the combat system. Not to mention that the quests are notoriously shallow. And that's something, coming from a person who usually doesn't notice such things and consumes most media passively.

At the moment I find it hard to not pick going for another Elden Ring run instead, even though that game is much farther from what I would call "perfect" (personally, although it is probably "perfect" in general).


Unfortunately, I have "gaming OCD" and just can't install any mods, except for bugfix or graphics mods. I want the vanilla experience in games, the way they're "meant" to be played. Not to mention the technical difficulties of installing mods. I've recompiled my kernel and have been an Arch user, but that shit is just too much for me.

To preface this, it sounds like you look for very different things in your games than I do (eg. I could never get into Elden Ring), so I'm not sure this will be much help. That said...

I'm endlessly drawn to Elder Scrolls games. They're near to what I would call "perfect" games for myself.

That's me, between these and (modded) minecraft. I occasionally branch out (eg, Factorio or various RPGs), but I always find myself being drawn back to the TES games or minecraft.

Unfortunately, I have "gaming OCD" and just can't install any mods, except for bugfix or graphics mods. I want the vanilla experience in games, the way they're "meant" to be played.

As far as I'm concerned, the fact that the Creation Kit is included with the games means customization through mods are the way they are "meant" to played. Bethesda provides a curated vanilla experience for those who want it, but have done more than any other developer I can think of in providing and supporting the ability for players to adapt the games to their desired playstyle. The games' modding community has built amazing things on the canvas Bethesda provided. Eg, in Morrowind there was a mod I used that added the ability to raise skeletal minions through a ritual involving manually placing items (bones, candles, etc) in the correct layout in the world rather than simply casting a spell, though you still needed a spell to trigger the ritual once all the preparations were made.

Not to mention the technical difficulties of installing mods. I've recompiled my kernel and have been an Arch user, but that shit is just too much for me.

Allow me to introduce you to Wabbajack, the "I just want to click install" option for playing modded Skyrim, albeit a bit annoying without a premium nexus account since you have to manually initiate the download of each mod/resource. Nexus has a somewhat controversial similar feature in its collections.

In Morrowind and (maybe) Oblivion I don't mind it, because the magic system is so open. You can craft your own spells,

In Morrowind you can create custom spells in-game that combine multiple (IIRC, up to 8?) spell effects from a preset list, varying the magnitude and targeting of the effect. If you wanted to do anything more complex (eg, a Mark and Recall-like pair that allows you to set multiple destinations and choose from them dynamically, or the previously mentioned necromancy ritual) or even just include preset spell effects that they didn't want you to have access to (eg, restore magika), you needed to resort to modding. As the series progressed, Bethesda pushed spell customization out of the game and into mods, a choice that never really bothered me since I was already used to doing things via mods anyway. And modders have done amazing things with spells in all the games.

launch yourself all across the world map,

Still technically possible in Skyrim with mods (eg, using the buffs from the wind element from Phenderix's Elements) and even the base game with glitches, but this is more a technical restriction to avoid game crashes and performance issues than a real gameplay decision. When Morrowind first came out, it was very easy to crash your game by boosting your Acrobatics and Atheletics skills sufficiently high that you could jump across the island and have the game choke trying to load in all the resources as you flew across the world. If you got them high enough, you'd also start to run into compounding errors in the position calculations leading to all kinds of "fun". Oblivion and Skyrim are much more resource intensive, and this drives a lot of performance tradeoffs to manage that (eg, forbidding Levitation so you can assume players won't be positioned to notice that some objects don't have renderable surfaces from all angles).

nothing is restricted.

This is definitely the primary attraction I've had to the series, but I think it is only through modding that you truly get there.

In Skyrim however, the restrictions are there, and I can't give it a pass on the combat system.

I'm not sure what you are looking for in terms of combat, but the modding community has a lot of options for various playstyles. Even vanilla Skyrim I'd rate higher than Morrowind though, as I found the tedium of missing/fizzling constantly at the start of the game extremely annoying. This is related to the primary reason I tend to play Skyrim more than Oblivion or Morrowind these days. I tend to keep all my skills at a similar level so I can swap between them as my mood changes rather than specializing as the game expects. This doesn't play very nice with the earlier games balance or levelling system though.

Not to mention that the quests are notoriously shallow.

Again, mods. There is a questing mod available that won a Writer's Guild award for its script. Another with one of my favorite game trailers of all time. If you are looking for something more akin to Elden Ring and similar games, see VIGILANT and the others in the series or Darkend (less lore friendly). If you are looking for something that explores the weirder aspects of the games' lore (eg, you want that "I can't believe these mods are lore-friendly" feeling), see Trainwiz's series of mods, notably The Wheels of Lull. And I'd probably be lynched if I didn't at least mention Legacy of the Dragonborn.

In short, I love open-world games that I can easily tweak to my liking and change up my playstyle regularly without too much hassle (eg, starting a new character/playthrough), and Skyrim fits that bill very nicely. Its base game isn't all that great by itself, but the modding community surrounding it has lots of options for nearly everyone.

EDIT: Grammar.

even just include preset spell effects that they didn't want you to have access to (eg, restore magika)

There's a game bug that lets you duplicate the effect of "cast spell, get all your magicka back". Drain your own Intelligence to 0 for one second; when it wears off, you have max magicka again. Cheaty, but so is Restore Magicka as a spell.

(eg, forbidding Levitation so you can assume players won't be positioned to notice that some objects don't have renderable surfaces from all angles)

IIRC this was only part of why they did it; another part was so that they didn't have to balance for flight (Morrowind notoriously just let flight break everything).

Even vanilla Skyrim I'd rate higher than Morrowind though, as I found the tedium of missing/fizzling constantly at the start of the game extremely annoying. This is related to the primary reason I tend to play Skyrim more than Oblivion or Morrowind these days. I tend to keep all my skills at a similar level so I can swap between them as my mood changes rather than specializing as the game expects. This doesn't play very nice with the earlier games balance or levelling system though.

Tips on the early-game:

  • Bound Weapons go a long way, especially the axe and longsword (though even the dagger that you start with if you've got a decent Conjuration is decent). The spell is very cheap and easy to cast (and obviously you only generally need to cast it once per battle, which makes it far more efficient than flashier Destruction and Mysticism spells), and the weapons have inbuilt +[Weapon Skill] effects that make you substantially more likely to hit. Masalinie Merian in the Balmora Mages Guild sells all six Bound Weapon spells.
  • Mentor's Ring is quite close to game start (go northeast along the coast from Seyda Neen until you hit a ridgeline, there's a tomb right on the waterline). It's a constant-effect +10 Int +10 Willpower, and Willpower controls your success chance on spellcasting. You'll probably want to buy a probe from Arrille, though, since the trap on the urn with the ring in it can one-shot a starting character (a probe is a handy thing in general, since traps have no difficulty levels; you can disarm any trap with an Apprentice's Probe and a Security skill of 5, even if it might take a few tries).
  • If you are going to use direct attack spells, start small. There's a spell called Righteousness, sold by Ygfa in Pelagiad and a few others, which is Absorb Health 10pts on touch; very reliable, and the time taken to spamcast is less of an issue since it heals you. Casting lots of little spells will also raise your casting skills faster.
  • You might already know this, but don't go into combat without your Fatigue bar at full. Your chance to cast spells and to hit enemies with weapons is strongly dependent on how full your Fatigue bar is. Feel free to run-jump your way through cities (unless you need to do persuasion or commerce; those are fatigue-based as well), but out in the wilderness, let it come back to full or nearly so (pure walking is pretty tedious, but you can alternate running with walking to go a bit faster while keeping your Fatigue up).
  • Level up smarter, not faster. Your attribute increases on levelup get multipliers determined by the skills you increased since your last levelup, and you can't max out the multipliers without increasing your "misc" skills - the ones that don't contribute to levelup. So don't be frustrated by using "misc" skills and levelling up slowly (note also that while Morrowind enemies don't get boosts based on your level, spawn points do check your level when deciding what creature to spawn, so levelling up rapidly and inefficiently can lead to you getting shredded by random kagouti on the road), and do spread out your major and minor skills across the attributes and specialisations (I usually play mage-ish characters, but I still take Light Armour and one weapon skill). I'd definitely advise against making Acrobatics and Athletics anything but "misc" skills, as they train hilariously fast but don't make you better at fighting.

I'm not sure about the programming side, but a tool like LOOT could help you detect those issues. If users report conflicts between mods, it will flag your load order to warn you about them. Of course, if you're just looking to get your feet wet with some technical work then there's nothing wrong with giving it a go yourself.

It's also worth learning how to use the Skyrim Creation Kit as well. I used it to spot patch a few mod conflicts that didn't have patches, for example removing a barrel placed by a city overhaul mod that a boatman was sitting in, or restoring some missing pieces of terrain like you've had issues with. If you're looking for an excuse to learn how modding works, it's a great tool. I would also use it to create custom modded companions and it taught me a lot.

I'm mostly interested in possibly using this as an excuse to finally learn how to work with 3d graphics on the programming side. I already have some modding experience, though more with the earlier games than with Skyrim.