Jump to content
  • Torque3D

    The pinnacle raw Torque power, Torque3D has been used for everything from driving simulators to MMOs!


    Check Out Torque3D

    Torque2D

    All the power of Torque with less of those pesky dimensions to tie you down!


    Check Out Torque2D

    Forums

     

    Looking for answers, wanna see some cool projects or talk about new / upcoming features?


    Read the Forums
  • Work Blog Updates

    • By JeffR in Torque 3D
      Greetings!
      You know, the plan was to follow up with part two only a couple weeks after the fact, but sometimes life gives you lemons!
      And sometimes those lemons are loaded into a t-shirt cannon and fired at your head at high speeds!
      Jokes aside, been a bit more chaotic lately, being tossed back into the joys of looking for a job in this market, and doing contract work on the side to pay the bills.
      Means timing and scheduling’s more chaotic than usual, but doesn’t mean that work on Torque is stopping any, thankfully.
      So, how about that work?

      So What’s New?
      Well, bunch of fixes and stuff went in, but the big ones are that the probe refactor I talked about last time is done and rolled in, as well as the main in-use asset types were finished being rolled over to the AssetRef setup! 
      This means general stability improvements for the probe stuffs, and no more crashes when you have too many! Woo!
      And general code cleanliness and coherency when dealing with assets on the C++ side! Yay!
      With that, the last major TODOs that had been planned for the engine are sorted, so it’s time to lock in and get 4.1 finished out and out of the oven. I’ll talk more about that later on down the blerg.
      Far as other things that be cooking go…

      Documentation
      One thing that’s been brought up time and again(for good reason) is the state of the documentation. It was never a FULL picture of the engine, and over time new content and articles got added in various places, leading to fragmentation and making it harder and harder to learn the engine from documentation alone.
      A while back we shifted to using gitbook to start centralizing everything at docs.torque3d.org, but it’s always a challenge to split attention between doing active work on things, or pausing to document.
      Especially when what’s being documented is still a bit of a moving target.
      So, some weeks back I sat down and walked through the engine and built out a list of ‘everything’ worth documenting. Classes, things about those classes that are important, etc.
      That itself isn’t really ‘documentation’ so much as a todo hitlist. 
      From there I did start building out proper, in-depth, up to date docs articles for the ‘core classes’ like SceneObject, ShapeBase, etc, among other things, along with a new style and formatting to try and make any given article not only provide good, topical info about what the thing is about, but also how it slots into the greater engine.
      For example, here’s the roughout for the new ShapeBase article that’s still in progress:

      You have your navigation table to go to sections of the article, yes, but you also have stuff like at the top, where you have a breadcrumb bar to let you immediately see how ShapeBase slots into the class hierarchy(and also jump to any other related class)
      Topical to THAT, for as many articles as possible, I’ll have a section at the end that links back to the in-depth class reference page for all the variables, methods, etc, as well as jumping to related classes(Shapebase relates to ShapeImage, or Player, etc)
      Further, I’m gunna have a ‘cookbook’ section which is a step beyond mere “Here’s what the class do” and into “Here’s some small, digestible examples of what you can do with it.”
      The hope is that by getting this solid foundation, we can just keep building out the articles as we go and check off the hit-list, eventually ending with *total* coverage of the engine. And if we get that, it means less time needs to be spent answering basic questions new people popping into the discord wanting to try the engine out, as they can just easily search what they’re looking for and probably find something at least related to get them on their way.
      And speaking of getting them ‘on their way’, I’ve got plans for updating not only the general structure of the articles to make a bit more sense overall, but also a new home page that better steers people to relevant article/article groups based on what they’re trying to do, like so:


      Project Manager
      There’s been a new PM getting worked on over the last months to help drastically streamline working with engine builds, modules, projects, etc.
      Most people that have used it generally liked the flow, information as presented and the like, but ran into various technical hangups that made it more of a pain to use than we wanted.
      Things like “What does an error code <N> mean?” when you were expecting it to, you know, download an engine build.
      Absolutely frustrating, and I completely get it.
      Some of that stuff’s got good headway on fixing as-is with integrating libCurl and libGit in. That means when you go to clone down an engine build,we’ll be able to do cool stuff like progress bars, and also not throw random, nonsensical error codes at you if something goes wrong!
      Wow!
      Beyond that, it’s mostly just refining the workflow and making it really hard to have anything go wrong.
      And then adding the ability to Export your game project, of course.
      That’ll get all the bells and whistles like being able to set encryption, allow tools or not, compile scripts, shapes, shaders, etc to make the cache files and then not ship the source files and all that good jazz.
      It’s the last major piece of the puzzle for it to go from “Kinda convenient to get a project underway” and to a more major tool in your toolbelt to get games made and published.
      Both the Project Manager and the Documentation can, thankfully, be worked on ‘on the side’ and don’t act as blockers for the release itself.
      And then?!?!?!
      No, seriously. That's it. The two roadblockers were dealt with, so that means the meat of things is done.
      “So 4.1 is out!?” you may be asking, and the answer is no, not yet, but very soon. 
      My plan is to spend the rest of November basically running through our issues list on the github as well as stuff that’s been reported on the discord and just tear through as many of those as is physically possible for the next two-ish weeks.
      Really polish things up and quash the frustrations.
      Once that’s done, the start of December will see the Release Candidate put out there for people to start using and abusing.
      Since the rest of Nov. is going to be tackling a lot of outstanding bug reports, I expect not too much new will be found with the beatups, but also certainly not nothing, either.
      So, we run the Release Candidate(s) through December, and unless something truly horrible is discovered that’d roadblock last-second, 4.1 goes out at the end of the year.
      And while we’re doing the ol’ test-aroo with the Release Candidate, I can work at Documentation/PM stuffs in parallel on the side, and more generally going forward after 4.1 as time affords.
      This should let me fairly reliably chip away at the last big pain points of the Project Manager as we do final testings on things for 4.1, as we just crack at articles for the documentation as I go.
      I’ve got a fair backlog of mostly-done articles I can start throwing up over the next weeks that should let 4.1 launch with a solid chunk of knowledgebase right out of the gate, and then after that I can just go by article and class as we go.

      Alright. What about the future, then!?
      Plenty to discuss there. A good bit of stuff got some gnaw-on time on the side that can be rolled into 4.2 devhead once 4.1’s out the door either virtually immediately, or a little ways down the road.
      Such as?
      For the ‘big’ developments for 4.2, the primary core feature target would be entities and components, but that’s certainly not all!
      One silver lining of 4.1 taking a while is quite a bit of tangential work was done for various aspects and parts that can be fairly promptly brought into the engine once the version ticker rolls over.
      Things like:

      Physics work notions
      With entities and components coming back into the picture, it’s a good time to review, streamline, and optimize various aspects of the existing game classes and some of the systems that they use. 
      One of the big ones is physics.
      As-is, T3D has its Physics API wrapper, which lets stuff like Bullet or PhysX be activated and run through a common interface that game classes like Player can work with.
      The biggest issue is that one, the interface itself isn’t a 100% implementation of all potential features of the physics libraries(with some stuff that was rarely/never used like pxCloth being half-implemented and ultimately dropped) but also it leads to branched code paths and inconsistent interop’ing.
      Because even when we’re running the physics libraries stuffs, the stock Torque Physics and collisions are still used in a lot of places selectively or in duplication. Like how Players kinda work with the physics stuff, but still need Torque handling for zone/trigger detection.
      Or how Torque physics has RigidShape, but using the physics API has PhysicsShape.
      Or how Vehicles basically only use Torque Physics internally with minor wrappering for working with the physics API sim.
      Basically, it’s a bit of a mess, and that’s led to a load of jank and frustrations over time.
      However, a good bit of preliminary work’s gone into rectifying this stuff, a good bit of which was spearheaded by Marauder.
      Now, we don’t plan on completely axing the stock physics(TorquePhys) anytime soon because while it’s simulation and collision stuff isn’t crazy top tier for performance or accuracy, it comes with a big tactical advantage of being really, REALLY good for networked objects.
      That’s not something to just throw out the window all willy-nilly, but we can’t just leave it as-is either or we’re right back there with “duplicating a bunch of junk”.
      So?
      We bundle up the existing Torque physics stuff - alongside giving it a good dusting and review of it’s math to fix some of the jankier behavior - and put it into a sort of mini library. Then *all* classes can just use the Physics API/Physics Rep stuff internally, allowing a lot of standardization.
      Additionally, because PhysX is kinda deprecated, we’re looking at bringing Jolt in as an alternative library to bullet. It’s used in a number of other projects and engines, and is lightweight and flexible, and looks like it could serve as a good middle-tier selection if you don’t plan to really go “lemme simulate a million barrels”, and networking stuff isn’t the highest priority.
      Because components give us a general way to review and examine most all game class code when we port stuff up(because we plan on replicating all the existing game class/mechanical features of the engine via components rather than tossing out any functionality) it’s a great time and place to do this work to have it properly integrated and standardized.
      Better results, cleaner code, regardless of if you go with a 3rd party physics library, or just keep to Torque’s model.

      Rendering/Performance improvements
      Know what’s better than being able to render a thousand objects?
      Being able to render a thousand objects faaaaaaaaast.
      Before:

      After:

      That’s 1000 cubes all packed tightly together, each one fully shadow casting with the PSSM shadowmaps, which is kinda a worst case scenario for things right now. And if the text on the metrics is hard to read, that's 68 fps for the Before shot, and 680 for the after.
      Yeah.
      10x times difference for the same workload.
      Similar to the situation with physics, the rendering pipeline in T3D’s got a good deal of age and cruft to it. In large part because it started as an API interface for D3D9 and has been steadily upgraded over time, but there’s some aspects of the general rendering behavior that has some pockets of inefficiency.
      I’ve been doing various bits of R&D at how to make all that run much much faster, as per the above screenshots, as well as between talks we’ve done about approaches for updating the GFX system and stuff I’ve been doing poking into.
      I’m uncertain how much of this’ll get intro 4.2 vs another version, especially if we’re gunna try and keep the cadence tight, but there’s absolutely spots we can do a good bit of shoring up on to reduce unneeded/inefficient work even before getting to ‘update GFX/add Vulkan/Metal, so there’s plenty of gains to be had here.
      And when we DO get to updating GFX to target the more modern APIs/paradigms, we’ll get fun stuff like threaded drawcall submissions and resource loading so it’ll go even faster still!
      Debugging and Viz improvements
      Who likes useful rendering debuggable data?
      We do!
      This is from super early days experiments, tied with my R&D work into rendering as mentioned above, but some of this stuff shows some good promise in helping dial in your game in a number of ways.
      For example:
      Shader complexity viz!

      I hadn't gotten it working on terrains yet, so ignore that, but the basic idea is we give a score value to ShaderFeatures and build out a rough complexity valuation of any given material so you can at-a-glance gauge where you're eating up shader time in your scene.
      Longer term, I'd like to try and tap into the shader compilation process entirely so we get a bit more 'ground truth' values for how many operations, samples, etc a shader does.
      Overdraw viz!

      Pretty self explanatory, blues are minimal overdraw, gradiented up to red to signal "Oh God, oh geeze what are you doing?!"
      Unsurprisingly, forests are monsters of overdraw.
      Texel Density Viz!

      Little funkier one, but does a similar gradient shindig, as so:

      It should help you see where the scale of things is out of wack, which can lead to things looking out of place, or is straight up wasted math calcs in your shaders for overly dense cases!
      Much like being able to eyeball G-Buffer and named render targets at a glance for debugging purposes, being able to turn on visualizers to see how your game is rendering things like that beyond pure target data can help with optimization and design quite a lot!
      I’m looking forward to adding a number of things like this for 4.2 to really help the polishing and optimization stages of development.
      Putting the initial game together is the “easy” part. Optimizing and polishing to get ready for release is a whole ‘nother beast that hasn’t been well acknowledged or wrangled, and that’ll be targeted much more better and specifically for 4.2.

      CSG Convex Shapes
      This one’s been kinda in the wings for a while. I added a CSG library to ConvexShape to give a more robust and flexible, non-destructive workflow. Way easier to just slap in windows or doors like this!

      Additionally, to facilitate that, ConvexShape ‘brushes’ now have a type. You have the normal Additive, then of course Subtract. But then you also have Detail, Collision-Only, etc to give far more flexibility in your blockout/base geometry constructions.


      And the CSG logic works on layers, so you can very, very finely control how everything interacts.
      And while I haven’t tested it to the extreme, it’s pretty danged fast to rebuild, so it may well be an option to use for dynamic destruction down the line.
      Longer-term beyond that, I wanna bring in vertex editing to make it more in line with ye olde Constructor, as well as potentially having a convex actually be made of multiple brushes so the geometry can be compiled down for more efficient rendering/colliding.
      All kinds of neat potential things to further build the tool out and make it more useable, and one I’ve been very much itching to get more time on fiddling with at some point in the future to get it ‘there’.

      SSR
      Not much to say here, but it’s cool and opens up a NUMBER of additional new techniques that use screen space data(like contact shadows, or SSGI!). I got it kinda-working but it needs refinement yet, so it’ll be a 4.2 thing, but it’s still neat!


      Planning, Issues, Roadmaps
      Now for the biggest piece.
      Obviously for all the plans and roadmaps we’ve tried to put together, real life has a habit of making things a bit of a spaghetti when it comes to planning.
      4.1 was supposed to have faster turnaround time, but obviously it ran long, like 4.0 did.
      In part, it’s because for a little while there we got a bit insularized with work. Idea was “hey we’ll have a private chat so it’s easy to focus on issues without clogging up main channels where other people may try and talk about other things than 200 message about me fiddling with probes”.
      Which sounds good conceptually, but it meant that as work was getting done and topics inevitably veered and segued, you guys in the community were left out of the loop. And new problems or issues to tackle are the juiciest, loudest, jangly keys of distraction to programmers.
      So things meandered, shifted, one problem being fixed became another one or two things to eyeball, and scope sprawled aggressively.
      When a big changeup did happen once work was done on it, since you guys were out of the loop for a good chunk of it, it came in as a bit of a blindside, and some of the decisions made had impact on people’s projects.
      Sometimes that’s necessary, but if it does happen, communication needs to be happening so no one gets haymakered by surprise.
      This was rightfully called out as being frustrating for you guys, and so we pretty much completely kiboshed the private chat and moved everything back to the main public chats in the discord, with a few tweaks like adding threads for bug reports so it’s easier to focus on specific topics in those cases.
      It also let me step back and review our working processes tied up in that, and realize that it was part of the problem with the scope overrun.
      As covered above, it HAS lead to some good work that can then go into future versions of the engine, but people only have so much time in the day, which means that it often comes at the expense of the core version targets getting done in a timely manner.
      So, given the new focus on keeping things in the public channels, I’m also going to try and keep a stronger general advisement on what’s getting worked on, how it relates to the roadmap stuffs, and get people’s feedback and thoughts sooner than later so we can work through stuff in a timelier manner.
      Some things’ll inevitably cause slowdowns and overruns, of course. The rewrite of the probes took a good bit because it needed to be really scalable, and also deal with some issues that came up in more real-world usage, like letting dark interior probes darken stuff at a distance past the shadowmaps cut off.
      It’s not a *critical* feature, exactly, but it helps keep visual coherency(and also can have gameplay impacts!)
      And that took time to puzzle out.
      It is how it is.
      But that doesn’t mean we can’t plan better and pre-emptively give ourselves wiggle room when that stuff comes up.
      One of the things I’ve been doing to help turnaround time for bugs, for example is a local test environment. I’ve got… well, a bunch of computer and gaming hardware. I’ve got a MacBook, my main gaming PC, a small form factor PC with a powerful integrated chip that I use for linux stuff, a Steamdeck, and even a Steam Machine!
      To date, though, testing any given report or fix, especially when other platforms get involved, has been slow going. I gotta get reproduction steps, reproduce it, try and iron out the core problem, draft a fix, test the fix - sometimes on multiple platforms - and then it can get PR’d.
      That’s just how the game goes, but it’s quite a bit of manual process even for relatively small issues - and again, especially so when other platforms or OpenGL vs D3D comes into the mix.
      So, what do you do about it?
      You automate the crap out of it!
      I set up build agents for my linux and mac machines, and am working on a script that’ll automatically deploy to the steamdeck and steam machine as well. I can draft a fix, run batched builds and try and see what breaks or doesn’t.
      Even got some tricks like abusing the fact that the SteamOS debugging toolkit lets you snag the logs or take screenshots remotely to try and catch stuff like that.
      It’s still in-progress, but the idea is more robust testing in a more automated way. Gets me a spread of data I can sift through at once and compare as opposed to spending protracted periods of time doing one step then the other, etc.
      I’d already been using it to a degree to chip through recent batches of fixes for PRs, and I plan on leaning into it much more going forward.
      This doesn’t act as a panacea, of course, but it does mean I can shave off quite a lot of manhours time on the bugfixing or testing phases, which is more time I can angle at on the big beefy features development for the major version targets.
      (And more manhours I can spend updating issues lists, roadmap stuff, or writing this workblogs).
      I’m not going to claim that 4.2 will be a perfect wonderland of hyper-efficient development, but very concrete and real steps are being taken to apply our time in a much smarter and more efficient way. Which should - in theory(fingers crossed) - mean that we can keep a better handle on the scope of any given version update of Torque, which keeps people in the loop better, and gets important updates and rollouts chugging along at a more predictable, preferable pace.
      Because ultimately, the end goal is a simple one.
      We want Torque3D to be an engine people can, and will, make games on. 
      The goal hasn’t changed, but the years have proven to be a good learning process for how to best keep moving towards that goal.
      Be seeing you all in a few weeks when we announce the Release Candidate version!
      Until then, 
      -JeffR

      Also, if you wanna help support us, feel free to throw a few bucks our way on the patreon! It helps cover all the hosting/web costs and all that important junk!
      https://www.patreon.com/cw/Areloch
      Thanks!
      -JeffR(again)
       
    • By JeffR in Torque 3D
      Greetings and salutations!
      It’s been a minute since I’ve last yapped. Certainly a thing that happens more than I’d like, but it’s also easy to let oneself get distracted by chasing down bugs, trying to do refinements, or features, and just generally getting improvements and updates to the engine done.
      Which, of course, is why people like reading me blather on. Find out about all the neat stuff that’s been worked on, rolled in, or is slated for future developments.
      So hey, let’s go ahead and dig into some of that stuff!

      So, what’s new?
      Oh man, quite a lot! Let’s start by doing a quick breakdown of some of the PRs that’ve been rolled in!
      All told, we had around 200 pull requests merged in, covering pretty much the full spectrum of things, from rendering to networking, AI to library updates.
      Since there’s so danged much, I figure I’ll just snag a few of the interesting ones to go over in specific:

      Rendering
      Rewrote GBitmap to better support for formats, cubemap images, and texture arrays Updates to probe data and some BRDF/IBL tweaks and improvements Fixed up ribbon particle seams bug Reworks to the wetness shaderstuffs Fixed up some shapes’ surfaces being erroneously shadows wrong Compiled shaders will now generate out a TSO file to help reduce shader load times where possible Physics
      Updated Bullet library Fixed a bug with ConvexFeature::collide that could cause collision to just be dropped Fixes for player class having a bug with a wrong var in the updatePos collision loop, as well as better handling for degenerate polysoup collisions so players can’t as easily clip through them TSStatic using the fallback shape now doesn’t break stuff with collisions Assets
      Image, Shape, and Material/TerrainMaterial assets converted over to utilizing AssetRef structure, and removal of the old DECLARE_ASSET-style macros for those, along with standardization of formatting/usage of setters/getters for actual using-classes of said asset types. Updates to Assimp and multiple fixes to deal with axis correction and other problem behaviors with FBX/GLTF due to DAE support being removed from all modern blender versions Cached.dts files can be encrypted now, and with those changes the version number of DTS has been increased from 28 to 29. Important to Note: The version change can potentially cause older builds to not play nice if you try and bring in a newer version of a dts file into an older engine build without doing the updates. Also, if you have the project password enabled, then obviously the files won't load into another Torque build unless that provides the password the shape was encrypted with. Better handling of parsing DSQ-vs-DTS datastuffs Fixed a bug with cleanup/teardown that would throw an exception on exit due to the hasAccumulation checks Networking of asset stuffs has moved to hashed Id’s instead of full strings, heavily reducing network transmission ImageAssets can represent and be used to ref named targets for consistency Editor Stuff
      Rebuilt the Particle Editor to now utilize the standard guiInspector controls instead of a fully custom adhoc gui, similar to what was done with the Material Editor previously. This means it’s much easier to change and expand editing of particles, emitters, explosions, etc, by just changing or adding fields to those classes’ initPersistFields, same as everything else, now. Retooled editor camera mode so it’s easier to expand to have new modes. For example, the AAK module will now list the AAKCamera as a valid camera mode in the popup list, and respect being toggled between. Various tweaks and fixes to the ShapeEditor gui Scripting
      Default arguments values are now a thing in TorqueScript FieldDescriptor builder api to more clearly and cleanly define out class fields using appending functions instead of a monolithic multi-param function. Better error tracking and reporting with exec calls, so it’s easier to pin down when something goes wrong if you’re executing logic in the console, or a command field, etc. Optional arg to eval() to have it just dump out what string is being evaled. Good for debugging Audio/SFX
      Major update to sfx to facilitate new features in the future like HRTF support, reverb, etc Crash fixes with blank sounds Network update bug for SFXEmitter Fixed channel 0 being muted by default AI/Navigation
      Fixed a cover-radius calc bug Added additional state checks for AI movement for if in the air, water, etc. Various improvements to the navmesh tooling and creation for stability and consistency Game Classes
      Reworks/expansions to Player class to rename hitboxes, add prone mechanics, turn animations, etc Added ability for derived classes to expand the actionAnim table Fixed some script execution behavior for the DamageModel module for better consistency UI
      Various fixes for the BaseUI module. Keybind persistence, mouse sensitivity slider, key remapping fixes, etc Update to guiPopupCtrl to fix handling of | characters Fix for positional drift with multiple GUI resizes Fixed a divide-by-zero error with scrollbar Controls menu/refresh bug fixes Core Engine Stuff/Libraries
      Refactored RefBase to work with Smart Pointers for better, more stable memory management across the board Updates to SIMD matrix math stuff Restored TAML reading/compilation for binary and json formats An XCode-specific bug that dealt with global statics being destructed incorrectly CI pipeline cleanups Libpng re-integrated Added vcpkg logic to the cmake build process. In large part because libSndFile library requires it to be built correctly and not cause a licensing crisis. Also adjusted to beter target strict library package versions and, if possible, only use the local/platform versions to avoid security vulnerability threats and keep things stable and consistent Shadergen can produce a ShaderData class, minimizing shader rebuilds when macros change Filestream can now write asynchronously to not stall the main thread Work on precompile headers usage to boost compilation speed Neat! So, how ‘bout that 4.1 release?
      Yep, yep! It’s been a slower cook than we’d wanted, to say the least.
      One part ‘R&D doesn’t have a guaranteed baking time’ and another part ‘getting distracted by fiddling and working on stuff that DOES deserve eyeballing, but maybe not so much a priority problem’.
      As it stands, the biggest question is, of course, “What’s left to do?”
      Fortunately? Not much. 
      To wit:
      Finishing out Asset Type Conversion
      I’d mentioned in the what’s new section about Shapes, Images, and Materials assets getting converted over to utilizing AssetRef stuff. To go into more detail about that and what that means:
      For the end user, like mappers, artists, etc? Basically nothing changes at all. The exposed field behavior and script functions, inspector fields, etc are all mechanically the same. It should by and large be a wholly seamless transition you shouldn’t notice.
      For people working in the actual code, it’s generally an improvement and cleanup.
      So, if you’ve fiddled with the classes that use assets, you may have seen macros like this before:
      DECLARE_SHAPEASSET_NET_REFACTOR(TSStatic, Shape, AdvancedStaticOptionsMask) Which isn’t exactly a super clean, ‘rolls of the tongue’ bit of code unto itself, but it’s actually a macro that does a LOT of stuff under the hood. Generally useful stuff, in that it sets up a bunch of boilerplate, utility methods, etc, but macros aren’t exactly fun to debug at the best of times, not all classes need all the bloat of the boilerplate, and everything was kinda built around protected methods for exposed fields which requires custom setter/getters every time, which is MORE boilerplate, etc, etc, etc.
      And when I say that they do a lot and expand into a lot of code boilerplate under the hood, I'm not kidding. This is what that one line above turns into for actual effective code:

      Whole WALL worth of stuff, which is also in the class header file, and so it even makes compile times longer!
      And then if you want Network-aware fields, that’s it’s own macro, like above, and then if you need an array of asset, like Material having an array of Image Assets to cover each stage, that’s ANOTHER macro, etc.
      So even with the ‘convenience’ of the macros, you were also looking at a lot of code duplication. Duplicated code that’s just not that easy to debug if(or when) something goes wrong, so on and so forth. So instead we shifted things up to a much, much leaner structure that was more targeted, easier to understand/read, easier to debug.
      More memory efficient.
      More robust to failure.
      Easier to use more directly in the actual classes.
      Easier to have work with fallbacks, not breaking if you accidentally typo’d something, or an asset fails to load so it doesn’t just blank out the field’s value.
      Easier to do error reporting if/when something goes wrong.
      …
      You get the idea.
      So what does that look like? Well, instead of a half-dozen special DECLARE_ macros and then another half-dozen macros spread throughout a class to implement things, using TSStatic from above, it now looks like this:
      AssetRef<ShapeAsset> mShapeAssetRef; Tadaaaa.
      I mean, yeah that’s not *everything*, but everything now just sorta ‘clicks’ to the AssetRef type. It self-initializes to empty in a pointer-safe way, and there’s integration for the console fields so you don’t have to do anything special there, either.
      It just handles it all internally. Setting, getting.
      Then with the added field constructor stuff mentioned above as well, you end up with:
      ADD_FIELD("shapeAsset", TypeShapeAssetRef, Offset(mShapeAssetRef, TSStatic))    .doc("Model to use for this TSStatic")    .network(AdvancedStaticOptionsMask); And as you can see there, you just have the Type*AssetRef field type, and it will Just Work.
      Setting the AssetRef var will do validation internally, and if successful, contains a valid asset ptr:
      shape = mShapeAssetRef.assetPtr->getShapeResource(); And you can do validity checks on it to make sure it’s all kosher first:
      if (mShapeAssetRef.isNull()) If you try and assign it an invalid assetId because something went wrong somewhere, it’ll internally store what you tried to assign it in an internal StringTableEntry, too. So you don’t lose any data. It’s ultimately pretty danged hard to break it in the event something goes weird somewhere, and usage of the data is pretty straightforward now.
      As a little aside, the bit on the ADD_FIELD demonstration up there? With the .network() bit?
      Yeah, that automatically flags the provided Bitmask as dirty when the field is changed. So you don’t have to do a bunch of manual function defines to just prod the net update anymore either.
      All in all, significantly more straightforward, clean, and legible, right?
      Which brings us to the TODO.
      The last ‘big one’ to convert over is SoundAsset. The other remaining types’ll need it too, but those aren’t as extensively utilized in a bunch of places throughout the engine, so those’ll be super easy to add their AssetRef bits.
      Sound’s the last of the ‘major’ types, and it’s already underway. I just gotta finish out the bits of conversion and standardization, followed by testing to make sure nothing’s OBVIOUSLY hideously broken.
      Since at its core it’s just standardization work, there’s nothing truly sexy or showy about it, but stuff just generally falls into a “It just works” category to keep things stable and reliable in a way that actual developers don’t even need to really think about 99% of the time.
      And everyone likes not having to put active brainpower at unimportant things.

      Probes and Probes Accessories
      This one’s a bit more a ‘big deal’ for shipping purposes. The problem we ran into at-scale with the current probe system is that internally, the manager registers and… well, manages, all the probes in a scene. Which is fine, of course. That’s expected. Manager manages.
      The problem is that there’s not really any true shuffling of probes to keep a reasonable cap on the internal arrays/memory. 
      See, when a probe loads in, it self-registers to the manager, gets it’s cached struct of probe info, and loads it’s cubemaps for IBL into the manager’s texture arrays.
      If there’s no free slots in the arrays, the manager allocates more. This happens basically seamlessly and you don’t really notice any of these movies parts in normal circumstances.
      All very clean and automagic.
      Until you have a complex or large enough scene with enough probes.
      Then it turns out that graphics APIs have a limit on texture arrays!
      And violating that leads to all kinds of very bad, no-good happenings!
      So in a small level, it’d never come up, but in a larger level, or a level that uses a lot of SubScene loading to bring in more content, you could run headfirst into a hardware limit and nuke your graphics driver, which is definitely bad.
      So, it needs a refactor.
      Good news is, we’ve got a plan for it, and a solid chunk of work done towards it, namely: Atlases.

      “That doesn’t exp-”
      Yes, yes, shuuuuush. Lemme explain.
      So, the reality is, that unless you’re going reaaaaaaally crazy with probes, pragmatically a normal scene, even in a AAA scene, is only going to have a small number of active, full, IBL-providing probes in the immediate space around the camera. Largely because probes are supposed to cover a larger space, like a room, or a hallway, etc and not one ever 2 inches. 
      That’s a whole different lighting system approach.
      So, if we know that we only really need a small handful of “real” probes, then we only load a small handful of probes into the texture arrays to render!
      What’s that?
      “What about stuff far away?”
      Alright, you got me on that one. The problem is that that means you only get IBL/reflections on stuff close with the full probes. Which brings us back to the original problem.
      That is, unless we bake down all our probes into a super efficiently compacted data structure that can be more easily referenced at-scale.
      This is where atlases come in. You may or may not be familiar with the general idea, but if you’ve ever looked at a Minecraft block texture sheet? That’s an atlas. A sliced up grid of a texture, where each cell holds a reliable chunk of info.
      In minecraft, the cell at a given coordinate is always associated to a given block type, like cobblestone.
      In the new probes setup, each cell will represent a piece of data that describes a probe. A whole row is the full data of a given probe, including the compressed diffuse lighting info of said probe.
      This means that instead of needing to submit dozens of cubemaps into the manager’s texture array, we can just hand up atlases and then do lookups of a whole bunch of probes in a much, much, much more efficient way. Fewer texture binds, fewer uniform binds. It’s all in the atlas sheet and we just look up by index.
      This means we can render basic info for WAY more probes at a time, including much further away, which means we can keep the inside of a house looking darker, as one would expect, without having to chokeslam your GPU with a million cubemaps to allow it to happen.
      Efficiency up. Memory use down. Wins all around.
      And as said, good chunk of the work’s at least prototyped, so it’s mostly just about turning it into the ‘full production-ready state’.
      If you’ve already got a level with probes, all you’ll need to do is re-bake, and otherwise in theory you don’t need to life a finger otherwise, and just sit back and enjoy the improvements.

      What Else?
      Nothing.

      Lies.
      Alright, alright, you got me. Sorta. Kinda. Ish. These aren’t “blockers” in the same way the above two things are, and can be worked on in parallel as the RC gets its beatups passes without stalling the show, but I’ll go over them in part two, as this is already getting pretty long in the tooth. The good news is, part two is 99% written, I just wanna space it out so people don’t get flashbanged by an entire novella all at once in an update.
      So, see you very, very soon for the remainder for 4.1 things, and what’s the plan for the future!
       
      -JeffR
    • By JeffR in Torque 3D
      Greetings! 
      It’s that time again, where I summarize up a bunch of work that’s been done and get the details laid out in a reasonably digestible way for you all to enjoy! Without further ado, here we goooo.

      What’s Been Done So Far?
      Since the last Workblog, or werkblerg, or wrgglglbnblglb depending on how much coffee you’ve had yet today, we’ve rolled in almost 160 PRs.
      Not quite as monstrous a list as last time, but it’s still pretty substantial.
      A good number of them were things on the TODOs from the last blog, so they may sound familiar, but a lot of them were bugfixes or QoL improvements that came up with feedback, reports, or just running into stuff when actually using the engine to make games.
      So, what do we have?

      General Fixes and Improvements
      This is where the vast bulk of the PRs were. Which makes sense, since I mentioned before that a lot of them were fixes and improvements(neat how that works out).
      So rather than plonking down a bullet point list of all 75 PRs, let me just pick through some of the highlights:

      Memory Leaks
      As with any piece of software, there is always a possibility or looming spectre of memory leaks. And while Torque’s had it’s fair share we’ve always made it a priority to chase them down.
      What we ended up spotting is that while there’d been prior cases of fairly obvious memory leaks that had been easy to fix, it was noticed that there was a much slower yet undeniable memory leak that had been an issue for some time.
      Letting a game run for an hour or two yielded gigabytes of memory consumption, so, you know, obviously that was bad.
      It took a lot of work and Az and Marauder doing some deep digging, but through multiple tweaks and fixes  and making it easier to track and chase down memory leaks with better integrated reports with any and every bit of memory the engine allocates and releases, we got everything playing significantly more memory stable
      Especially important for anyone trying to do long running games or servers.
      Path and Vehicle/Rigid Object tweaks
      A mix of small but important fixes across the board for these classes, such as fixing stabilizer behavior for hover vehicles when going over ground planes, shoring up some performance tweaks for rigid shapes(which also impacts vehicles), optimizations to networking of rigids and early outing on things like if an impulse is too small to mathematically matter, etc.
      For paths, there was tweaks to how the object snapping works(so objects trying to ride on a pathshape can still do normal things like jump) more reliably, as well as adjustments to workflow with them so they’re easier to use, like more consistent load behavior - especially when generating paths with gamelogic - and being able to copy/paste paths and shapes and having them behave more predictably.
      Networking Tweaks
      A few classes such as TSStatic got some tweaks to improve networking/ghosting efficiency. Nothing major this side, but it’s always good to refine how much we have to pipe across the network to save packet space for actual important gameplay stuff
      Subscene Stuff
      Az improved the logic for testing if a subscene could be triggered to load(since sometimes you’d want to condition a subscene loading based on gameplay logic or triggesr) to be more consistent/reliable.
      Similarly, there was just a bunch of small other tweaks like improving the workflow when creating a level asset and being able to flag it as a subscene immediately, having better in-place workflows for creating subscenes while working on a level, fixed an issue where MeshRoads would save/load into subscenes weirdly, etc.
      Nothing Earth-shattering, but it should just generally make subscenes easier to work with.
      Spawning
      Building off the work with the spawn chain mentioned in the prior blog, we did some cleanups and tweaks to how the callbacks and error reporting if something goes wrong work based on more people testing it and giving feedback.
      This means that it should be easier to drop stuff in and have it Just Work, as well as modules being easier and more reliable in how and when they’ll spawn stuff.
      Scripting
      Re-added the ability to kick off compileAll in order to forcefully compile everything to a dso. This is important because one of the features still on the TODO for the Project Manager is the ability to export a game build, which would include functionality like being able to compile scripts to binary files, or remove art source files and so on.
      Also added some unit tests for scripts as part of the build pipeline to better catch any regressions in the future next time we work on the script/console back-end.
      There was also some pruning done of old/redundant methods in a few spots which should help keep things clearer.
      Beyond that, shifted a bunch of object fields to utilize validators and range types to keep sane values on things. No more accidentally setting your gravity multiplier to a hundred billion and then wondering why the player can’t move!
      Jokes aside, it should generally just make it harder to have values go completely insane, as well as generally being better at straight-up plugging bad data into things and causing problems.
      Nothing major front-end wise, but should generally help stability overall.
      Recast overhaul
      What originally started as a “Oh, Navmesh preview renders funky-like on OpenGL” turned into a bit of a quagmire due to how NavMesh used to handle packing and presenting debugging data.
      Mar did a big overhaul to better use the library ‘as it was intended’ as well as packing in a bunch of additional utility features to help make working with it a little easier now, and opening up the opinion for new features in the future. 
      Plus, it’s always nice to be able to tell an AI to go a place and he actually manages to get there!
      GUI
      Gui stuff saw a smaller but important set of changes and fixes as well.
      The list of PRs for that includes:
      Fix escape menu keybind not working (Areloch). fix PopupMenu::checkItem filter (Azaezel).  Gametsctrl mouserefactor (Olathuss).  fix another potential crash with firstresponder code (Azaezel).  Enables onMouseMove for scripting on GameTSCtrl (Olathuss).  Better guiClockCtrl pause tracking and module callback integration with PlayGUI (Azaezel). expand playgui callbacks to let game modes inject element layers (Azaezel). game mode filterfix (Azaezel).  setFirstResponder safeties (Azaezel). guiClockHud augs (Azaezel). Adjust OpenAL device listing query for reliability (Areloch). Close Menu Implemented (Olathuss). Nothing absolutely earth shattering, but a lot of fixes and quality of life improvements. Stuff like the the fixes for the mouse handling for GameTSCtrl improves consistency, and the expanded callbacks and game mode filtering makes working with and interoping with gamemodes a lot easier.
      Being able to just drop stuff in and run with it in a more modular way goes a long way to improve iteration time, especially as we keep expanding the list of modules available for people to snag and use.

      Editor
      The big thrust of focus for 4.1 at it’s core was work on the editor suite, so predictably there was a lot done here.
      The highlights list includes:
      Material Editor Update/Inspector-ify
      The big one would be converting up the special-snowflake ad-hoc Material Editor, which looked like this:

      And shifting it to utilize the regular inspector class, so now it looks like this:

      Admittedly, not a gigantic space-magic powered visual change, but the backend code is much simpler and streamlined, it’s *standardized* to everything else that already uses the inspector like the normal world editor, and it means that if you add a new field or property to the material class, it Just Works and will appear in the MatEd for changing without having to hand-add it yourself.
      It also was an opportunity to pop the MaterialEditor out from being packed in with the main EditorGUI, so you can now edit the MaterialEditor with the GuiEditor.
      The other editors will follow suit from this as we go now that it’s shown that yeah, it’s pretty easy to do.
      In addition to the MatEd getting updated, the Cubemap editor was shifted over to it’s own standalone thing instead of piggybacking off the MatEd, and now there’s actually a full-fledged Composite Image Editor!

      Which basically lets you easily take a material with Ambient Occlusion, Roughness and Metalness maps, and quickly bake it down into a ORM Composite map for efficient use.
      Or technically any kind of composite texture, but that’s the main usage.
      You can also open it up via the right-click context menu in the Asset Browser on ImageAssets, so either direction works!
      Adding tab cycling between inspector sub-elements
      This is just a nice quality of life thing, but it means you can quickly hit tab to run through sub elements in the inspectors which should improve workflow speed
      Visibility Modes dropdown is an Extensible Menu
      This is likewise a QoL thing and ease of maintenance more than anything, but it makes it easy for expanding via stuff added in modules.
      For example, there’s the normal list:

      And if you’re using the Action-Adventure Kit module, it has some additional visibility modes:

      As you can see, we've injected in an entry for Showing Camera/Player blockers which are additional special volumes added with the AAK. 
      This makes expanding Viz stuff for modules or custom tooling way easier and thus making it much more actually useful.
      Ability to make GameModes or New MaterialAssets in Asset Browser
      This rectified an issue where neither of these types could be just made brand new via the AB itself, so now you can just make a new one like so:

      And it just creates it as expected for any other type and you can get cracking at the actual content your game needs without disrupting your flow or needing to leave the editor to  make them by hand in script.

      Prototyping UI moved to tools
      This is mostly just a standardization/cleanliness thing, but the Prototyping UI Az drafted up has it’s proper home in tools now.
      If you haven’t played with it yet, it’s a handy little shindig that lets you very quickly slap together objects and script functions(hence it’s name!)


      Additional Terrain Tools
      Az put in a little bit of additional elbow grease to finish out some work to add some nifty new brush modes to the terrain editor to facilitate stuff like thermal and erosion, as well as the ability to copy and paste sections:

       
      Color Picker Refactor
      Marauder overhauled the color picker to rectify a lot of weird under the hood oddities and now everything should behave far more consistently.

      Mind, that isn’t everything, and all told there were almost 30 PRs just for editor improvements, additions and fixes.

      Rendering
      Rendering saw a very similar number of PRs that largely targeted stability improvements. From fixing memory leaks to erroneous rendering behavior on the GL side of things, fixing wetness, mipmap handling, adjustments to PBR rendering to fit more correctly to model and some IBL/Probe issues.
      It was a lot of small but very important improvements.
      After all, no one wants their game to look like this:


      Platform/System And Libraries
      This largely was a small but straightforward list of changes, by which I mean it pretty much was mostly updating various libraries.
      Stuff like SDL, tinyXML2, OpenAL, etc.
      There was also improvements for logic to find said libraries on linux so our friends on that side of the OS divide don’t have to fret as much if it’ll get confused about which version of a library like SDL it should use.
      Also, also, there was some minor cleanliness changes like moving the libCurl stuff to resources as a module rather than trying to have that packed into the main engine build if most users aren’t likely to utilize it.

      Assets
      On the asset side, the main focus was retooling how Image and Shape assets handle their memory and references, as well as their loading and reloading logic.
      The end goal is to cut down on how much redundant handles we have everywhere, while being able to reliably manage and detect when Assets are loaded, pending, changed or reloading so actual game classes, like Players or TSStatics can react appropriately.
      This lets us do stuff like properly having Shapebase-based classes react when their shape is changed for hot reloading, or when an image is changed and needs to be reloaded and making the gui classes react appropriately.
      Beyond that, more cleanup and safeties in a bunch of spots to make the whole thing more robust.

      So, What’s Left?
      For the big todos:
      Finishing converting remaining ‘Special-Snowflake Editors’ to standard inspector-based stuff.
      It’s largely self-explanatory, but a few remaining editor UIs like the ParticleEditor utilize completely custom, ad-hoc GUis for their editors and standardizing those over to use inspectors like most everything else will make everything feel more consistent, be easier to maintain, and be easier to expand.
      Rework IBL/Probe memory management
      While the current setup works fine, it’s more that it works ‘fine’.
      Az discovered via his Warren test map that when you really start throwing a lot of probes into a mission you can pretty well strangle out the render API’s memory allocations in certain circumstances.
      The current method is ‘fine’ if you have a fairly small map, but once you start getting bigger and/or you need a lot of probes to wrangle lighting/reflections for indoor areas, you can brush up to that limit quickly.
      And it turns out GPUs are not a fan of having their VRAM mugged for spare bytes 😛
      So, I gotta rework how the internal arrays handle things.
      The frontend shouldn’t change at all, but the inner rendering logic’ll change to properly handle sublists of probes to allocate and deallocate as demand changes.
      Only actually allocating cubemaps for probes close to the camera will fix the issue of running into those memory allocation limits without meaningfully changing how the end user sees the IBL rendering happen.

      More Misc Fixes and Improvements
      We keep getting more and more feedback and bug reports as people use and beat up on the build, which is awesome and lets us really grind down on remaining issues that get in the way of usage.
      Stuff like funkiness with the Options Menu, to jank with how the level selection screen works, or other small workflow and QoL issues in the editors.
      All that kinda thing we’ll keep polishing as they get reported to make 4.1 as refined and smooth to use as is physically possible.
      libGit and it’s usage in Torque3D
      This isn’t really a make-or-break issue, but ties into the above about various pain points and user feedback.
      The new Project Manager generally has been well received, but there’s been an ongoing issue with some funkiness about how it utilizes the commandline calls to kick off git for downloading engine builds or modules.
      It works, but inexplicably it can run into issues sometimes, and because it’s routing blind through the commandline error reporting is basically non-existent. Which is always frustrating for everyone involved if no one knows what actually went wrong.
      Beyond that, people have expressed annoyance that it feels like there’s still a lot of hurdles for grabbing modules and being able to just… ‘go’.
      As-is the workflow is to grab the engine, then go to the resources github page, download whatever modules, toss them into your project, and then you can start playing with things.
      If you’re using the PM there’s a few less steps because it can present you module options more directly, but it’s still ‘external’ to the editor/project you’re working on.
      So we’re going to look at being able to build libGit into normal T3D as well and let you snag resources directly from the Asset Browser.
      While the Project Manager will still do it, as well as let you… well, Manage Your Projects, such as exporting a game-ready build, etc, a user would be able to in theory grab a binary build of Torque, launch into the editor, and start snagging modules that are instantly ready to go right there, without needing to leave the editor.
      If that approach shakes out, it means the hurdles and speed bumps for prototyping or bringing in content for your project would go down massively.
      You could be like “Dang I could really use some trees right now” to clicking on a Trees module in the AB, it downloading via git, and now having trees to paint into your map without even needing to leave the editor.
      Conveniently, Az has put in a lot of work getting the library module ready to go, so I can pretty much start testing out said above integrations immediately, so figuring out how to use and abuse it won’t have long of a wait.
      It’s a promising prospect, and something we’re gunna take a good look at testing out, because really, no one ENJOYS fiddly work. People want to be able to work on their actual games. And workflow improvements like that would go a long way towards that end goal.
      So That’s Everything Then?
      More or less, yeah.
      Obviously there’s bits and bobs of fine details, but that’s the brunt of it.
      A number of big reworks and fixup passes caused quite a bit of a grind there, but ultimately the engine is in better shape for it. 
      The todo list is very short at this point if you consider “Fixing issues as they get reported” as a single main-line category, so I’m hoping to get our first 4.1 Release Candidate out in the next month or so.
      So keep your eyes out for that because we’ll definitely want people jumping in there and really giving it a workout so we can polish things up to a mirror shine!
      And, as always, if you want to help pitch in to cover stuff like server/hosting costs and the like, feel free to swing over to the patreon:

      You even get a nifty role in the discord now if you support it!
      See you there!
      -JeffR
  • Topics

  • Show-Off

  • Built with Torque

×
×
  • Create New...