Jump to content
The Dark Mod Forums

Rotation hack strikes back


stgatilov

Recommended Posts

Everyone has probably heard that setting non-orthogonal "rotation" (scaling or shear) on entity is bad, and such entity can misbehave under various circumstances. The dmap warnings for it were added in 2.08. The developer discussion about eradicating this hack is almost year old now. There was even one type of "solution" in 2.08 beta, quickly removed from it.

The main problem with rotation hack is that it is used all over all existing FMs. The challenge is how to forbid it completely in the engine, but leave existing FMs in working condition (preferably in fixed condition) without updating all of them. I believe I have solved the problem in latest dev builds without too much hacks in the engine. Now non-orthogonal rotation is always stripped from the entity, and all of its models are wrapped into "proxies" which copy and transform them on load.

While it works well for 99% of cases, it breaks on some nontrivial cases. They classify into two groups: collision models and animated models. Having a rotation-hacked entity with such model in a map causes ERROR on load, making it unplayable. I hoped that nobody would ever risk to use rotation hack in such complicated cases, but alas. Luckily, the number of such maps is fairly small, so I hope they can be fixed manually.

 

Here is the list of FMs with the problem:

1) Collision models:

  • ws4_warrens: @grayman (I fixed it --- Grayman said OK)
  • rightful: @jysk  (no response --- I fixed it)

2) Animated models:

 

I'd like to hear authors' opinions and advice about it.

I think I can fix all these problems myself, although I would appreciate help from the authors. If you are author of one of these FMs, please write if you prefer fixing it yourself or prefer me to fix it. If I will fix a map, then I will post the suggested differences here and wait for approval.

 

Speaking of collision models, there are two ways to fix the problem:

  1. Add clipmodel spawnarg with the same value as model. However, it usually results in collision model not matching the visual model.
  2. Normalize rotation, removing scaling/shear. Since such entities are usually moveable, and moveables lose their scaling/shear immediately after first move, it sounds like a better fix.

Speaking of animated models, I have no idea how to fix the problem except for physically applying the transformation to .md5mesh file. I wonder if there is any existing tool which can do it easily. If not, I think can write a Python script.
 

P.S. I can post names of entities which cause issues if needed.

  • Like 2
Link to comment
Share on other sites

I updated siegeshop earlier this year to correct that. There are no more improperly scaled models in siegeshop. If the current one in the mission downloader still has bad rotations, then wait a few days for siegeshop v.5 which has proper models and much more.

System: Mageia Linux Cauldron, aka Mageia 8

Link to comment
Share on other sites

28 minutes ago, PranQster said:

I updated siegeshop earlier this year to correct that. There are no more improperly scaled models in siegeshop. If the current one in the mission downloader still has bad rotations, then wait a few days for siegeshop v.5 which has proper models and much more.

Yes, I used the state of FMs from the beginning of this year, so my information can be outdated.

I have downloaded version 5 of siegeshop (in-game downloader says it is version 5, pk4 size = 15172538).
Unfortunately, it still does not boot.

The error happens on entities of atdm:fish_animated_01 class. Their model is animated, and their rotations include scaling.

Link to comment
Share on other sites

Just now, stgatilov said:

Yes, I used the state of FMs from the beginning of this year, so my information can be outdated.

I have downloaded version 5 of siegeshop (in-game downloader says it is version 5, pk4 size = 15172538).
Unfortunately, it still does not boot.

The error happens on entities of atdm:fish_animated_01 class. Their model is animated, and their rotations include scaling.

Whoa. The in-game downloader should not have version 5 yet. It's only been linked directly to three players. Besides, version 5 is about 30 megabytes and version 4 was about 15. But If you want to see version 5, I'll happily send you my next build with no beta-test strings attached :)

The fish were definitely fixed earlier this year. I had several dozen models which I had scaled 'the old way', before having knowledge of the DR model scale tool, despite it being right there on the toolbar. But then again, I spent quite a while away from DR and many things had changed since I had built siegeshop 3 and 4.

System: Mageia Linux Cauldron, aka Mageia 8

Link to comment
Share on other sites

11 minutes ago, PranQster said:

Whoa. The in-game downloader should not have version 5 yet. It's only been linked directly to three players. Besides, version 5 is about 30 megabytes and version 4 was about 15. But If you want to see version 5, I'll happily send you my next build with no beta-test strings attached :)

The loading screen has small red digit "4".
So I guess version shown by downloader is greater by one (perhaps someone had to make a small update at some moment, which you did not count as new version).

Link to comment
Share on other sites

20 minutes ago, PranQster said:

Oh, how interesting. I thought the downloader got the version number from a text file in the .pk4 , so it would make sense if this was the 5th version posted to the server (4.4 was posted after 4.0).

The version number in database is an integer number, which must be increased every time you post something new.
Otherwise players with old version won't see new version in in-game downloader.

I'm not sure why this internal number is displayed to players though.
It would make more sense to show whatever author has written in txt file.
Perhaps that's because many authors forgot to change the version in txt file on update.

  • Like 1
Link to comment
Share on other sites

What bad thing does the player experience in WS4 if the rotation hack on "Cylinder2" is present?

I don't understand why we're purposefully forcing missions that have worked for years to suddenly crash on load starting with 2.09?

It is highly unlikely that I will have the time to re-release any of the Steele missions. It's about all I can do to finish the 3 remaining ones.

Please explain the justification.

Thanks.

 

Link to comment
Share on other sites

2 hours ago, grayman said:

What bad thing does the player experience in WS4 if the rotation hack on "Cylinder2" is present?
Please explain the justification.

The general problem is that rotation-hacked entities do not work properly under some circumstances. Mappers usually had to make such objects noshadows, non-solid, and probably something else, but given the number of such entities (100 FMs x 100 RH entities per mission), then often forget it. And testing is not very reliable, since players can bring any moveable/light to any position, but rarely do so.

I believe the cylinder in question does not cause any problems: since it is moveable, it should loose its scale immediately after FM starts.

Quote

It is highly unlikely that I will have the time to re-release any of the Steele missions. It's about all I can do to finish the 3 remaining ones.

I can do the fix for you.

Regarding WS4, the fix is as simple as replacing the current rotation:

"rotation" "0 1 0.0871563 -1 0 0 0 -0.0871563 1"

with normalized one:

"rotation" "0 0.9962234 0.0868271 -1 0 0 0 -0.0868271 0.9962234"

Dmapping is not necessary.

I have checked that it looks and works properly in-game.
My only worry is that I'm not sure what's the purpose of this cylinder in the mission (sorry, did not play it yet). Could you please clarify what important things should happen with this cylinder, so that I could test them?

Link to comment
Share on other sites

Near the cylinder is a small player, the object with what looks like a megaphone speaker sticking out.

If you pick up the cylinder (or any cylinders lying about, especially near other players), and lay it on top of the player, you will hear a prerecorded message. This is an Inventors' Guild device, and first appears in WS2. IIRC, every player that appears in the missions has a readable set of instructions on how to use it nearby.

Typically the messages are just music.

For Steele, the cylinders are also used to send audio messages back and forth between key characters.

When done listening to the sound (music or message), the player can drop the cylinder anywhere and the sound will stop playing.

You can leave the cylinder lying on the player and the sound will repeat.

I don't recall why some of the cylinders have weird rotations. The very first cylinder in WS2 has what looks like a hacked rotation, but since you've presumably tested that mission's load time, and no ERROR pops up (it doesn't; I tested), it must be an acceptable rotation.

Feel free to make whatever correction is needed (Thanks for volunteering). WS4 was not internationalized, so there are no concerns with multiple copies of files.

These cylinders will be appearing in WS2, 4, 6, 7, and 8. I've already fixed bad rotations in 6/7/8, because, though they were begun years ago (when hacking was the only game in town), they're still being worked on.

  • Like 1
Link to comment
Share on other sites

7 hours ago, grayman said:

Feel free to make whatever correction is needed.

Already done.

Replaced ws4_warrens.pk4 on all three mirrors, bumped version to 2.
Verified that I can update from old version to the new one in in-game downloader (unless this FM is installed --- I guess that's limitation of downloader).

Quote

If you pick up the cylinder (or any cylinders lying about, especially near other players), and lay it on top of the player, you will hear a prerecorded message.
Typically the messages are just music.
When done listening to the sound (music or message), the player can drop the cylinder anywhere and the sound will stop playing.
You can leave the cylinder lying on the player and the sound will repeat.

I have checked it both on trunk and 2.08: the cylinder looks properly, behaves properly in physical sense.
Placing it on the nearby player works as you describe. As you say, it plays music. Other cylinders nearby contains other pieces of music.

Quote

I don't recall why some of the cylinders have weird rotations.

I'm sure it was unintended.
One of the problems with rotation hack is that it was not reported (well, until recently), so it was very easy to use it without knowing/wanting it.

Quote

The very first cylinder in WS2 has what looks like a hacked rotation, but since you've presumably tested that mission's load time, and no ERROR pops up (it doesn't; I tested), it must be an acceptable rotation.

I tested all WS mission from 1 to 5, and I did not see any problems with the others.

Link to comment
Share on other sites

1 hour ago, Fieldmedic said:

Feel free to tweak as you see fit!

Could you at least start the FM, execute setviewpos 2754 192 -433, and confirm that this location is reachable by player?
It should have some "animated trees".

Because I tried teleporting there, and got an impression that it is isolated from the rest of the map.

Link to comment
Share on other sites

  • 1 month later...

So sorry for not noticing your post until now. Haven't been active on the forum...I guess this tree location is added by Bikerdude when he made improvements to the mission. The location in question is the skybox and shouldn't be reachable by the player...and should be isolated from the rest of the map.

 

/Fieldmedic

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

Repacked Night To Remember.

I simply commented out the transformations. Now the trees are huge if you teleport there. Also, I played the mission myself, and did not see neither the trees nor the sky, so I guess these trees are some random trash left from early experiments.

Uploaded the new version to mirrors, internal version bumped to 3.

  • Like 1
Link to comment
Share on other sites

2 hours ago, grayman said:

Bye bye, Mr. rotation hack.

Not really 😄

But now if a map entity uses rotation hack, then the game embeds this "rotation" into the model automatically during map load, i.e. creates a scaled model.
So yes, the game engine has said goodbye to it completely.

As for maps and mappers... don't know.

  • Like 1
Link to comment
Share on other sites

1 hour ago, grayman said:

With the latest SVN build, I get this error playing WS4: The Warrens:

"ERROR:idMoveable 'Cylinder2': cannot load collision model models/_roth_gen/voice_cylinder_06f5f4bb48a4828a.proxy"

I thought the proxies were working around this?

Did you download the updated version of your FM?
It should be in the in-game downloader.

Link to comment
Share on other sites

On 11/18/2020 at 11:26 AM, grayman said:

There's no new WS4 available through the in-game downloader when I use the latest SVN build (built by me).

Apparently the in-game loader can't see updates if the mission in question is currently installed.

Install a different mission, and the update becomes visible.

Seems like odd and non-intuitive behavior.

  • Like 1
Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

  • Recent Status Updates

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 1 reply
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...