Page 137 of 396

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 9:12 am
by minmay
zimberzimber wrote:Attaching a model to a node for monsters with scaled down animations scales down the attached model, but the parent mesh gets resized to its original state :lol:
Rescaling models didn't help fixing it
Can you rephrase that? I don't know what you are saying here. Do you mean that using the parentNode property on a ModelComponent is changing the parent model somehow?

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 9:44 am
by zimberzimber
minmay wrote:
zimberzimber wrote:Attaching a model to a node for monsters with scaled down animations scales down the attached model, but the parent mesh gets resized to its original state :lol:
Rescaling models didn't help fixing it
Can you rephrase that? I don't know what you are saying here. Do you mean that using the parentNode property on a ModelComponent is changing the parent model somehow?
I have an ogre, that uses scaled down animations. (Like the micro ogres someone made for LoG1)
Attaching a model to a node on the model causes the attached model become smaller, and the model that gets the attachment becomes biger (normal sized)
Like so:
Image

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 10:59 am
by bongobeat
zimberzimber wrote:scripts set the stairs to their location, stairs have invisible models and a custom location. However, I assume this'll be problematic if a player is to save/load a game.

Biggest issue is the stairs killing pillars/floors/ceiling.
Floor isn't a problem, can be added to the stairs up as their model, and set the material based on what you need,
Placing ceilings manually works fine.
Pillars though... I have no idea how to fix em without a custom model. I tried using a high pillar and just place them below/above the required location, but placing the upper one didn't work because it got removed by stairs_down. An impractical fix would be editing a pillars model to look like its where you need it, but its real location is on a lower height.
thanks for the tip, with the fade in set to 0, the transition looks better, except for the teleport jump effect.

nice trick with placing the stairs elsewhere, but I prefer using a wall decoration, and have the stairs placed and shown at his exact position.

For the pillars, I use some double pillars object defined as a wall_decoration:
its based on dungeon pillars model, so no new model, only a new object, with offset that pop them on each side of the wall.
SpoilerShow

Code: Select all

defineObject{
	name = "stairs_up_open_double_pillar",
	baseObject = "base_wall_decoration",
	components = {
		{
			class = "Model",
			model = "assets/models/env/dungeon_pillar.fbx",
			staticShadow = true,
			offset = vec(-1.5,0,0),
		},
		{
			class = "Model",
			name = "pillar2",
			model = "assets/models/env/dungeon_pillar.fbx",
			offset = vec(1.5,0,0),
			staticShadow = true,
		},
	},
	minimalSaveState = true,
	replacesWall = false,
}
is there anything wrong with performance or something else if I put an occcluder on a wall decoration?
It's only for adding them to the side walls

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 12:23 pm
by zimberzimber
nice trick with placing the stairs elsewhere, but I prefer using a wall decoration, and have the stairs placed and shown at his exact position.
Your trick is more reliable because a) it doesn't create a mess in the editor, and b) it won't break if you are to save/load a game
For the pillars, I use some double pillars object defined as a wall_decoration:
its based on dungeon pillars model, so no new model, only a new object, with offset that pop them on each side of the wall.
Nice, gonna use this then.

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 7:17 pm
by minmay
bongobeat wrote:is there anything wrong with performance or something else if I put an occcluder on a wall decoration?
No. You can put an OccluderComponent on anything, and in this case you should. Also remember that "wall decoration" isn't actually a meaningful distinction internally in Grimrock 2, it's just shorthand for a GameObject with wall placement and not replacesWall.
zimberzimber wrote:I have an ogre, that uses scaled down animations. (Like the micro ogres someone made for LoG1)
Attaching a model to a node on the model causes the attached model become smaller, and the model that gets the attachment becomes biger (normal sized)
Okay, I see what you are saying, but I cannot reproduce the issue. I tried attaching a ModelComponent to a scaled node that has mesh data, and the node retained its scale. I think there's something funny about your animation. You aren't scaling local_srt or something like that are you?

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 7:36 pm
by zimberzimber
minmay wrote:
zimberzimber wrote:I have an ogre, that uses scaled down animations. (Like the micro ogres someone made for LoG1)
Attaching a model to a node on the model causes the attached model become smaller, and the model that gets the attachment becomes biger (normal sized)
Okay, I see what you are saying, but I cannot reproduce the issue. I tried attaching a ModelComponent to a scaled node that has mesh data, and the node retained its scale. I think there's something funny about your animation. You aren't scaling local_srt or something like that are you?
I followed these instruction:
Isaac wrote:In Blender, Import the ogre, select the armature, import the animation.

Change the pivot to the cursor
Center the cursor ( <shift> + S )
Then select the game_matrix object, and scale it down.
Then press <CRTL> + A to apply scale.

https://www.dropbox.com/s/r14f98w0flrhk ... k.avi?dl=0
And I think I see where the problem is. (correct me if I'm wrong)
Scaling game_matrix also scales local_srt, so I should just scale the rig?

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 10:40 pm
by Isaac
Aha! so it's my fault. :P

I'm not at home, and no Blender here. I suppose one would need to drop further down the hierarchy before scaling and applying. I've made custom monsters before, but never with the Blender export script.

(But I am about to, and plan to use node parenting; so I'm very interested in the process, and its pitfalls)

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 11:01 pm
by minmay
I can't test it myself at the moment, but I think you should try making your animation scale all of local_srt's children and not local_srt itself. You can do this easily by opening your existing animations and applying local_srt's scale (which just transfers it to the children). It is possible that this will just result in the same problem though.

Re: Ask a simple question, get a simple answer

Posted: Mon Aug 08, 2016 11:16 pm
by Isaac
Experimental stairwell object. Looks nice, works as intended; has no [noticeable] fade...
But it has a bit of a (really bad :() snag; one that I'd like to fix, but haven't figured out how to do it yet.
At the end of the ascent or descent, the engine always displays a single frame with the party grossly off-center.

The staircase is a single asset, placed on the map; at the top of the [single] elevation change.

*Project includes a new [variant] dungeon stairs model.



https://www.dropbox.com/s/v1mkijllq4yct ... s.zip?dl=0
Image


If I can't find a fix for the glitch, I think I will try some other method, without using the stairs component.

Re: Ask a simple question, get a simple answer

Posted: Tue Aug 09, 2016 12:10 am
by zimberzimber
So, scaling local_srt instead of game_matrix fixed the model getting larger, but the attached model will still get scaled down.
Worked around it by creating a new model, which is just a rescaled spear. I'll be using it to rotate it into the right position, because changing world rotation for the model through the definition changes nothing.
I'm not going to add it to the monsters model itself because I plan on having these monsters walk around with different weapons.

EDIT: Apperantly some animations deform if you scale through local_srt and not through the game_matrix. Scaling through root_node flips normals. I've noticed the problematic animations have everything but the 3 main parents move. (game_matrix, root_node, and local_srt)