Modelling problems

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).
Eksekk
Scout
Scout
Posts: 172
Joined: 19 Jul 2016

Modelling problems

Unread postby Eksekk » Sep 17 2022, 20:48

I have started doing some modelling in Blender, since there's an astounding lack of people doing it, compared to coding. Currently I am making small dungeon (which in hindsight might be harder than some models for outdoor map) and have had many many problems (I've dealt with 3D only a few days few years ago, but it was hard and I gave up). I overcame most of them except those written below:

1. Why does my (Blender) screen jump when I enter/leave flight mode? It started about two hours ago and before everything was fine. - fixed already, if link is dead, here's a copy
2. How to create doors? Do you need to explicitly do a part with its own walls etc. to be able to move it? What faces should be selected when making door? How to determine face normal directions as a number for pasting into MMEditor? Why does a door from original map (markham's manor) not fully move but instead one face moves?
3. I made a secret stash closed with a wall (couldn't create door), and now every time I recalculate normals one of faces gets them wrong (doesn't display when viewed from certain position in MM). How to correctly recalculate normals in such case?
4. How to deal with materials/textures? Currently I use shading to get them to look good enough in blender (UV maps are unchanged), game displays them in correct size, but different faces with same material are not lined up correctly. I could fix it manually in editor, but I would have to do it every time I reimported a dungeon, which will surely happen a lot of times as I change things. I tried UV maps, but had to spend literally several hours to get one corridor to look good both in Blender and game.
5. I imported a chest, rotated and duplicated it, and now all top faces have got wrong texture direction (in MM, Blender is fine). UV map seems to be the same as that of freshly imported chest. When I checked "correct face attributes" option while rotating, it looked even worse. I suspect there's no way of fixing these "broken" chests, but is there a way to avoid it in the future? EDIT: this one was answered already by Tomsod. His answer is just below.
6. Is there any way to have snap align rotation to target actually work when aligning object to face in edit mode? Currently it produces really weird rotations. In object mode everything works correctly, and my workaround is to perform rotation snap in object mode, apply adjustments if needed, and use edit mode for further snapping without aligning rotation.
7. I've not delved into it yet, but is there an easy guide for portals? I understand they're a facet which separates two rooms. Is assigning texture with name "_portal_" enough to make game recognize it? How to make doors "open up" an area on the minimap when their state changes? How to actually break up a dungeon into rooms?
8. How to correctly export a dungeon to blender and import from blender to game so portals won't cause a console error and rooms won't disappear?
9. Why some faces' edges show up on minimap, and some not? This happens even in my own dungeon. I mainly want a way to remove them from minimap, but a way to add them would also be very useful. I checked normals/MM editor face properties, nothing worked.

I have tried to do all these things (except 7) on my own, but there's no information pertaining to MM games, and overall information is really hard to find. MMEditor documentation is severely lacking. I started doing a small "guide", but it's not completed yet and won't contain any advanced information because I'm a beginner.

Thank you. I hope that in this topic people will post their own questions, and answers will help create that guide I wanted.
Last edited by Eksekk on Sep 21 2022, 13:00, edited 7 times in total.

Tomsod
Scout
Scout
Posts: 155
Joined: 31 Jul 2020

Re: Modelling problems

Unread postby Tomsod » Sep 17 2022, 22:09

I'm probably even worse at this than you, but I can answer the chest one, as it bit me too. The game's engine cannot rotate or mirror textures at all, so chests that are facing different directions have to use different top textures that are essentially just rotations of each other. Thus, if you get a chest and then rotate it 90 degrees, you'll have to change some of the textures and probably their UVs, too. And, say, rotating a chest 45 degrees is not even possible with existing textures.

EDIT: oh, and did you solve that modified map re-importing problem after all? I still think a script would work well.

Eksekk
Scout
Scout
Posts: 172
Joined: 19 Jul 2016

Re: Modelling problems

Unread postby Eksekk » Sep 18 2022, 15:58

Thank you for the information. I will have to modify map so chests can be rotated how the game supports it.

I have just tried to do reimporting script, but when I reimport file everything gets packed into one room, and when I use settings in blender to split rooms into objects, console error appears when reimporting. Due to this I've added another question to the list.

Also when I try to dump this big room (dump(Editor.State.Rooms[2])) game freezes and I have to kill it. In debugger I can see there's some lua error happening (a register contains error string), but game won't ever unfreeze.

Eksekk
Scout
Scout
Posts: 172
Joined: 19 Jul 2016

Re: Modelling problems

Unread postby Eksekk » Sep 22 2022, 13:13

Sorry for double post (is this allowed?), but I wanted to share that my dungeon might be ready for showcase soon. (keep in mind that there are no decorations yet like columns, also its quality doesn't even come close to neutonm's. Also, it's gotten a bit bigger than "small") And I've added another question (and resolved the flight one, also I now know how to get door directions for MM (normals), but I will update that question when I have figured out all about doors).

User avatar
Kinox
Peasant
Peasant
Posts: 60
Joined: 14 Sep 2019

Re: Modelling problems

Unread postby Kinox » Sep 29 2022, 10:17

Eksekk wrote: Sep 17 2022, 20:48 I have started doing some modelling in Blender, since there's an astounding lack of people doing it, compared to coding. Currently I am making small dungeon (which in hindsight might be harder than some models for outdoor map) and have had many many problems (I've dealt with 3D only a few days few years ago, but it was hard and I gave up). I overcame most of them except those written below:
Hi, there; so, consider for Blender that, besides Blender StackExchange, there are several other places to get help. Like, Discord communities, such as Blender Community and Blender Discord (there are full dedicated Helping sections there); also, Blenderartists forum is relevant. Consider always reading just a bit on Blender Manual site, for some basics on whatever tool or domain (e.g., Modelling) in Blender you are doing:
https://docs.blender.org/manual/en/latest/index.html

I'll try to answer, but very often it is very difficult to visualize specific cases without screenshots and/or videos; and that sometimes is true, even if the technical terms used in making the question are matching perfectly the UI.
Eksekk wrote: Sep 17 2022, 20:482. How to create doors? Do you need to explicitly do a part with its own walls etc. to be able to move it? What faces should be selected when making door? How to determine face normal directions as a number for pasting into MMEditor? Why does a door from original map (markham's manor) not fully move but instead one face moves?
Doors that "Transform" (like in realtime or 3D Animation, or on a game engine), might need to be Rigged; that is, it means creating mechanics for the personal controlling of the motion that you want the Door to have. In Blender, usually there is often not a unique way of doing things; there are multiple approaches or methods to a single problem; but naturally it will happen that some approaches would be more optimal for achieving certain goals.
A simple and well organized approach in my opinion would be that a Door that can open/close might just be composed of 3 Objects: The Wall Mesh Object, the Door Mesh Object, and the Armature Object. So what you do is that the Mesh of the Wall and the Door are Separated into 2 different Mesh Objects (you may even start Modelling the Door in the same Mesh Object than that of the Wall, but then you can Separate only the Mesh Island for the Door, turning it into a secondary Mesh Object: a Door Mesh Object). Then, you can start considering Rigging the Door Mesh Object, by Parenting it to the Armature Object (which could be considered the "skeleton" or the "set of Dungeon Controllers" for this kind of mechanical Rigging; [always check the names of Operators, Options and Tools with F3. But to Set Parent To Bone, you need first to have a "Door" Bone in the Armature Object, and have that Bone Positioned on Edit Mode and knowing this Bone's Bone Roll might be relevant, because this will give understanding on the orientation of the Bone's Axes (XYZ) in 3D space (this is not to be confused with the Object's Displaying Axes); While having the Armature Object Selected in the 3D Viewport Editor, you can go to the Properties Editor » Objec Data Properties Tab (stick figure icon) » Viewport Display Panel » Check Roll Option. (¿you see how this Car Door Bone is Positioned?
https://continuebreak.com/media/images/ ... t-jpeg.jpg or perhaps this Double-Door Bones https://i.stack.imgur.com/tf9WR.png )
To make the Parenting properly, on Edit Mode for the Armature Object, you need to have a single Selected Door Bone (as the Active element), then go back to Object Mode, Select the Door Mesh Object, Shift-LMB Click Select (multi-Selection) the Armature Object (that now is the Active element between the 2 Selected Objects but on Object Mode), Ctrl+P or Object Menu » Parent Sub-Menu » Set Parent To Bone. Now, if you Select only the Armature Object on Object Mode, then go on Pose Mode (Ctrl+Tab), you can "Pose" the Door Mesh Object by Rotating the Door Bone on one of its Axes; for example: Select the Door Bone, press R (Rotate) → press Z (Z Axis) → press Z again (Local Z Axis) → move the mouse around (LMB to validate or RMB to cancel) or type a number Value such as "90" (can also be a Negative one, like "-60") and press Enter; so you'll have the Door Mesh Object Rotate wholely on Pose Mode; Select All the Bones (with A key) and press Alt+R to Clear Rotation Transforms for all the Selected Bones, then go back to Object Mode. Your Hard Surface Modelled Door is now Rigged: Posable; at least inside Blender.
Eksekk wrote: Sep 17 2022, 20:48What faces should be selected when making door? How to determine face normal directions as a number for pasting into MMEditor? Why does a door from original map (markham's manor) not fully move but instead one face moves?
Sorry, I'm not sure I understand everything, but those can be useful tips:

It depends on the project. But, usually, it's relevant for a Door Mesh (because we might have to see it from both sides as it opens/closes) to be a two-sided Mesh (but you can start Modelling it and working with it as just a one-sided Mesh if you are using the Solidify Modifier; if the Door Mesh is not a Mesh Object of its own, you can still have that Object Modifier running on the Door Mesh only, thanks to Vertex Group; but this would be slightly more complicated to set up; so it's easier just to have a Door Mesh Object with its own Solidify Modifier). At any moment you can Apply the Solidify Modifier and turn the one-sided Mesh into a double-sided Mesh; but it's nice to keep this stuff as long as required, because it makes life easier (half the Mesh to deal with); Exporting the blend file usually will automatically Apply the Object Modifiers anyways.

Displaying the Faces' Normals (must be on Edit Mode for a Mesh Object): in the 3D Viewport Editor » Header Region » Overlays Popover Menu » Normals (go far down) » Check Display Normals Option and adjust the Slider Button to a fair Value; you'd be then able to visualize the Face Normals (which directions are always facing the Positive, so you know if you have for example Flipped Face Normals to the wrong way); remember you can always use the Operators to Flip or Recalculate Normals: on Edit Mode, Select All or only the Mesh elements (Faces) that you want, then Mesh Menu » Normals » Flip Normals Operator, or Recalculate Outside Operator, or Recalculate Inside Operator. Alt+N, in the 3D Viewport Editor for a Mesh Selection on Edit Mode, is the keyboard shortcut for those kind of Operations.

About Lord Markham's Manor Dungeon Map's Doors, I believe you mean the fact that the Doors opens just sliding sideways instead of rotating on their vertical axes on their Door joints. If that is so, I believe that's a Dungeon Designer approach; the Dungeon Map is just too small and those Doors too large; if they Rotated on their Joints, that would create much encumberance, and plausibly having to displace and/or interpenetrate other Objects in 3D space. In terms of 3D Rigging in Blender, they've opted for a Location Transform instead of a Rotation Transform for those Door Meshes or Door Mesh Objects.

Note that, although I might be somewhat a Blender Expert (or maybe above depending on the field), I'm not familiar with Game Making Skill. Thus, I probably cannot offer optimal solutions for game engines and game projects; I might just have that Game Making Skill at Basic Level, but my Skill Points and Masteries are all going elsewhere.

This is just for the Question #2 for now. Hope that helps. ¡Good Luck!

Eksekk
Scout
Scout
Posts: 172
Joined: 19 Jul 2016

Re: Modelling problems

Unread postby Eksekk » Sep 30 2022, 18:46

First of all, thank you for taking the time to write such a detailed reply! I really appreciate that.
Kinox wrote:Hi, there; so, consider for Blender that, besides Blender StackExchange, there are several other places to get help. Like, Discord communities, such as Blender Community and Blender Discord (there are full dedicated Helping sections there); also, Blenderartists forum is relevant. Consider always reading just a bit on Blender Manual site, for some basics on whatever tool or domain (e.g., Modelling) in Blender you are doing:
https://docs.blender.org/manual/en/latest/index.html
Yes, I've not been asking any questions as of yet, except of CH and MM discord, idk why, maybe because I feel inferior to people who are doing "serious" modelling/animation etc. I've searched as much as I could, but rarely "read in advance".

The stuff you wrote about animation is really useful and I'll surely return to it in the future, but I don't think game engine supports that. The game is ancient and the way doors (and by the way by doors I mean any moving face) work is they are a collection of faces that move from one state to another. There are two states. You can specify arbitrary XYZ coords (from -1 to 1) and move length. To make the door display properly all faces need to have correct normals (game only displays those faces whose normals point in your direction).

My main issue is that you need to manually select the faces which become door (and move), and some faces need to be duplicated (both belonging to door and the level), otherwise you would have gaps in walls after the door moves. Here's what I mean (selected faces should move):

Image

And I don't think it's possible to reliably select (in MMEditor) two faces which are in the same location. I've made a workaround by extruding one wall a little so I can reliably select it:

Image

This wall will become part of door and that way parallel dungeon wall won't leave a hole.

(I didn't know what to do about this face:

Image

if I include it in the door there will be a hole in the wall after state change, and otherwise there would be hole in the door. (and I just had an idea that I can duplicate that face and extrude it to the top a little so I can select it, will try that soon))

But that introduces problems when recalculating normals (if anything is wrong, and it is when recalculating whole mesh, face won't display, idk if it will even block movement). I could recalculate only part that needs it, but I'm conditioned to recalculate everything. Is there a way to tell blender "that normal is correct and shouldn't ever change"?

Also I examined original maps' doors when exported to .obj, and they don't have these extruded faces. So probably I'm missing something.
Kinox wrote:About Lord Markham's Manor Dungeon Map's Doors, I believe you mean the fact that the Doors opens just sliding sideways instead of rotating on their vertical axes on their Door joints. If that is so, I believe that's a Dungeon Designer approach; the Dungeon Map is just too small and those Doors too large; if they Rotated on their Joints, that would create much encumberance, and plausibly having to displace and/or interpenetrate other Objects in 3D space. In terms of 3D Rigging in Blender, they've opted for a Location Transform instead of a Rotation Transform for those Door Meshes or Door Mesh Objects.
Yes, that would require either much more sophisticated 3D engine or at the very least doors with multiple states and support for rotation. And what I actually meant is when I export that door:

Image

(it starts in state 2, that is opened, and MMEditor exports it according to that) The selected face is the only left face of that door (there aren't any duplicates). So only that face moves, or maybe better, extrudes when you switch that door. I don't know how to make it happen. Possibly that's some export artifact.
Kinox wrote:Note that, although I might be somewhat a Blender Expert (or maybe above depending on the field), I'm not familiar with Game Making Skill. Thus, I probably cannot offer optimal solutions for game engines and game projects; I might just have that Game Making Skill at Basic Level, but my Skill Points and Masteries are all going elsewhere.
I really appreciate your help! The only problem is that game is really ancient and requires some diving in to change, and some techniques like animation don't apply and have to be done in some other rough way.

I will soon post the .blend file so anyone can take a look inside (I'm not good with videos, but if it's required I will do it).

Tomsod
Scout
Scout
Posts: 155
Joined: 31 Jul 2020

Re: Modelling problems

Unread postby Tomsod » Oct 1 2022, 5:43

If you're having problems selecting facets with mouse, I suggest using console. Last year when I was editing barrows sarcophagi, I had a small script that selected all facets with the same texture within a certain radius from the current selection. That way I could click on a sarcophagus, run the script, and hopefully select the entire thing (but not the others). If your doors have distinct textures, you could do the same, otherwise you could, say, use the TriggerOnClick bit instead of the texture as the criterion. Anyway, here's the script:

Code: Select all

function SelectNearby(distance)
    local facet = nil
    for id in pairs(Editor.Selection) do
        if facet then
            return "Multiple facets selected!"
        else
            facet = id + 1
        end
    end
    if not facet then
        return "Nothing selected!"
    end
    mfacet = Map.GetFacet(facet)
    Editor.Commands.SelectSameTexture()
    for id in pairs(Editor.Selection) do
        local mf = Map.GetFacet(id)
        if mf.MinX < mfacet.MinX - distance or mf.MaxX > mfacet.MaxX + distance
            or mf.MinY < mfacet.MinY - distance or mf.MaxY > mfacet.MaxY + distance
            or mf.MinZ < mfacet.MinZ - distance or mf.MaxZ > mfacet.MaxZ + distance then
            Editor.DeselectSingleFacet(id)
        end
    end
    Editor.UpdateSelectionState()
end

Eksekk
Scout
Scout
Posts: 172
Joined: 19 Jul 2016

Re: Modelling problems

Unread postby Eksekk » Oct 1 2022, 18:21

Thanks for the script! Unfortunately some of my doors are secret and should blend in (I'm having problems with that as well because even with perfect UVs there are visible "cracks" between faces). I could obviously assign them different texture in blender and change it back in editor, and will probably do it (selecting by other properties won't work until I figure out a way to do this facet properties-preserving script). I don't know how to easily separate door from the level so that they are same object, but with different faces for walls. Once I figure this out, your script will be very useful.

EDIT: Maybe simply duplicating required part of the mesh will work. I will test it.


Return to “Might and Magic”

Who is online

Users browsing this forum: No registered users and 17 guests