[DONE] Grimrock Model Tookit

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] Grimrock Model Tookit

Post by JohnWordsworth »

Grimrock Model Toolkit 0.3.1.1
GMT Homepage ~ Direct Download

A quick point release which hopefully fixes Assimp DLL problems (DLL was being put in the wrong place by the installer) and ensures that animations always have a name shown (even if the animation has no name in the actual file itself, which is the case for the grimrock animations I think). Thanks @Isaac for raising these.

@Fhizban: The GMT uses a large library called 'Assimp' to import 3D assets from a variety of formats, and fortunately, LWO (LightWave) appears to be supported. However, you would have to be very lucky for them to work out of the box - it is likely that Wizadry uses a different scale for it's 3D models or that it faces a different direction 'forward'. It's also very unlikely that it has a walk animation that moves forward exactly '1 grimrock square', which walk animations are expected to do for Grimrock. I'm not sure how much work it would be to get it to work properly in Lightwave or Blender I'm afraid.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: [WIP] Grimrock Model Tookit

Post by Phitt »

JohnWordsworth wrote: @Phitt: Would be interested to hear how you get on. Assimp actually imports Normals, Tangents and BiTangents if you can get 3DS Max to export them!
Great update! Exporting collapsed meshes now exports as one node with one segment per material. Exporting multiple nodes (and naming them) is no problem either. Unfortunately the only thing I couldn't get to work yet is the export of tangents. None of the formats of the Assimp library I can use seem to export them. The only format that exports them I could find was...fbx. But I would gladly hear any suggestions about possible formats that export them. I tried 3ds, ase and stl so far (which is all I can use without installing a plugin).

EDIT: I've modded ES games for quite a long time and there is a tool similar to yours called Nifskope. It is open source and has an option to 'update tangent space'. That works really well, it even had better tangent space calculation than the nif exporter for max for quite some time (until they implemented it into the exporter as well). I have no idea about programming, but maybe you could use the tangent space calculations from Nifskope and implement them into your own code? Or is that impossible since it's a different format? Anyway, source code is available here in case it helps:

http://niftools.sourceforge.net/wiki/NifTools/Using_Git
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: [WIP] Grimrock Model Tookit

Post by JKos »

Ciccipicci wrote:JKos a little tip. To try it into my dungeon exactly where I'll have to put one by one this codes? And how can I learn where to put all of them simply by reading them and not asking? thanks! ;)
Just copy paste those scripts for example in mod_assets/scripts/objects.lua or any .lua file and save the spell_projectile to mod_assets/models/

you can shoot the magic missile using shootProjetile - function. Sadly that's the only way to make properly working projectile spells currently, because custom spell support is broken IMO.
Example:
shootProjectile('magic_missile', party.level, party.x, party.y, party.facing, 14, 0, 0, 0, 0, 0, 20, party, true)

If you want to make working magic missile spell you also have to add this in your .lua files

Code: Select all

defineSpell{
	   name = "magic_missile",
	   uiName = "Magic missile",
	   skill = "fire_magic",
	   level = 0,
	   runes = "A",
	   manaCost = 15,
	   description = "The mage creates a bolt of magic force that unerringly strikes one target. ",
       onCast = function(caster, x, y, direction, skill)
           shootProjectile('magic_missile', party.level, party.x, party.y, party.facing, 14, 0, 0, 0, 0, 0, 20, party, true)
      end
	}
Now it can be casted by selecting the rune A. But even now it does not give XP to the caster or party if he kills a monster with magic missile. It is possible to implement that by using monster:onProjectileHit-hook and damageTile-function but it's far beyond this post. See LoG Framework thread if interested.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] Grimrock Model Tookit

Post by JohnWordsworth »

Grimrock Model Toolkit Release 0.3.2.0

GMT Home Page ~ Direct Download

Another release with a small number of changes, but hopefully some very good ones (I'll wait for @Phitt to say if it's worked or not!).
  • Improved tangent/bitangent generation.
  • Added short-cuts for menu items, such as Ctrl-R to reload the material library.
@Phitt: I'd love to hear how you get on with the new Tangent/Bitangent generation. My normal generation is still off (but that's one of those things with lots of different possibilities, some of which work better than others in certain circumstances), but it's simple to import normals, as opposed to tangents so that's not a high priority.

@Phitt (again!): Great to hear that exporting multiple nodes etc is working via Assimp importing. FBX is still on the todo list, but unless a helpful C# library comes into play, it's going to be a bit of a mission to wrap the C++ library in a C# library, so I'll probably leave it for a while and focus on some other features for a while (if Assimp provides sufficient import options!). I don't know which version of 3DS Max you're using, but I downloaded the trial of 2013 and there seems to be a comprehensive DAE exporter in the File Export options (AutoDesk Collada).
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: [WIP] Grimrock Model Tookit

Post by Xanathar »

As far as I know, the Collada exporter in 3dsmax is the same plugin and code which does the FBX export, which has 3 choices - binary, textual (in a kind of somewhat-like-JSON-format-but-not-entirely) or Collada XML. Of course, some features might be supported only in some of the formats, most likely with Collada being the one which has more sparsed support.

But, taking into account that most features cannot be reexported in the grimrock model format anyway, I think Collada support is more than enough.

My 2 cents obviously, you all might disagree :)
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] Grimrock Model Tookit

Post by JohnWordsworth »

@Xanathar: I'm pretty sure you're right, I remember reading somewhere that the FBX SDK also supports Collada import/export (back when I thought I was going to be using that instead of Assimp first). :)
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: [WIP] Grimrock Model Tookit

Post by Phitt »

JohnWordsworth wrote:Grimrock Model Toolkit Release 0.3.2.0

GMT Home Page ~ Direct Download

Another release with a small number of changes, but hopefully some very good ones (I'll wait for @Phitt to say if it's worked or not!).
  • Improved tangent/bitangent generation.
  • Added short-cuts for menu items, such as Ctrl-R to reload the material library.
@Phitt: I'd love to hear how you get on with the new Tangent/Bitangent generation. My normal generation is still off (but that's one of those things with lots of different possibilities, some of which work better than others in certain circumstances), but it's simple to import normals, as opposed to tangents so that's not a high priority.

@Phitt (again!): Great to hear that exporting multiple nodes etc is working via Assimp importing. FBX is still on the todo list, but unless a helpful C# library comes into play, it's going to be a bit of a mission to wrap the C++ library in a C# library, so I'll probably leave it for a while and focus on some other features for a while (if Assimp provides sufficient import options!). I don't know which version of 3DS Max you're using, but I downloaded the trial of 2013 and there seems to be a comprehensive DAE exporter in the File Export options (AutoDesk Collada).
I tested the tangent generation on a dungeon tileset pillar (to make sure I have an already correctly working model for comparison) and unlike before the lighting looks now exactly like on the original pillar. Great work, seems like there is no need for tangent export anymore!

If you'd ask me you can forget about fbx, I wouldn't know what we could do with it that we cannot already do. Unless it would be needed for animation export, but I think at least some of the Assimp formats are capable of doing that, at least the node transform animations Grimrock supports.

I use max 8, and I have a trial of 13. There is an 8 plugin for dae as well, but it doesn't support tangent export and I don't need it anyway anymore now... :D
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] Grimrock Model Tookit

Post by JohnWordsworth »

@Phitt: That's what I like to hear! Hope you have all the tools required now to complete the Mine Wallset!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: [WIP] Grimrock Model Tookit

Post by Neikun »

JohnWordsworth wrote:@Phitt: That's what I like to hear! Hope you have all the tools required now to complete the Mine Wallset!
2nded[(ed)ed]
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: [WIP] Grimrock Model Tookit

Post by Phitt »

Seems like my reply was a bit premature...I'm still facing problems. While naming nodes works as expected (and is recognized by the game) the animations don't work properly. A secret door I made moves along the positive y axis instead of the positive z axis. I reset transforms, so that's not the problems. I tried to rotate the pivot by 90° degrees, I even rotated the whole model by 90° (without resetting transforms), but it always only moves along the y axis. Don't know what else I could do. The only thing I noticed is that the 'local to parent' node coordinates are quite different to the ones from the original secret door model. Tried all three formats I can use, it's the same problem with all of them. Any ideas what might be wrong?
Post Reply