Dungeon optimization tools

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Dungeon optimization tools

Post by THOM »

One question to minmay (or to everyone else):

Is it possible to generate a list with all materials used in a mod?
I've added a lot assets (tilesets, but also item- and monstersets) and to shrink your dungeon.dat file it is advisable (as we all know) to erase all unused materials and textures. I try to do this - but it is a pain in the ass to figure out after deleting objectdefinions which material is not needed anymore. It would be a great help to have a list with all used materials...

Is this possible?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Dungeon optimization tools

Post by minmay »

Sure, the model format is even specified. It's quite easy to write a python script or w/e to list all materials used in a model, then it's just a matter of running that on every used model (presumably by traversing every .lua file looking for strings ending in ".fbx").
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Dungeon optimization tools

Post by Duncan1246 »

minmay wrote:...So you're launching the editor, running the script, then launching a second instance of the game and redirecting its output, and expecting that to somehow grab the output from the first grimrock2.exe instance - that was already printed? I think you are seriously confused and need to re-read the command prompt tutorial I linked to, and the step-by-step guide in the merge function's instructions.
I don't intended to use mergeObjects, so I did not read further, and I was wrong.
So I retry in this way:
1.Launch LG2 with low options, run editor, close LG2
2.Run grimrock2.exe>output.txt to redirect the report to a txt file before launching opt_utils.... but the crash occurs again
So I think my mod is, as you says, "beyond this sort of help"... (dat is 250Mo)
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Dungeon optimization tools

Post by minmay »

Just uploaded a serious bug fix for the object merger, specifically voidTiles.lua now has a field to change depending on whether you merged animations or not (like it does for pillars). Previously it assumed you didn't merge animations and I forgot about it.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Eleven Warrior
Posts: 736
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Dungeon optimization tools

Post by Eleven Warrior »

Love these tools thxs man :)
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Dungeon optimization tools

Post by Duncan1246 »

I have made some tweaks since a month, dat file is reduced from 250 Mo to 155, and I have used your script with following results:
Total objects/ components: 80912 / 165488
Full Save State: 9110 / 36025
Minimal Save State: 70912 / 126188
Unknown 950 / 3014
total name length 2210470

Minmay, does this seems a good level of MSS, and what can I do now to improves my mod on memory usage?
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Dungeon optimization tools

Post by minmay »

Duncan1246 wrote:what can I do now to improves my mod on memory usage?
remove materials
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Dungeon optimization tools

Post by AndakRainor »

I have a question about GameMode.showImage(filename):

Does it keep the image data in (video) memory permanently, or can it be used to show as much images as one would want ?
If it does, then I think video files would be the only way to use data in a dynamic memory way ?
Post Reply