Vanblam Resource Packs - Red Cave - Beta 0.3

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
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Vanblam Resource Packs - Red Cave - Beta 0.3

Post by vanblam »

Image

Red Cave has been a journey to tell you that much, but thanks to the community for all the help and suggestions I'm excited to release this beta version of Red Cave Resource Pack. Red Cave was inspired by an area in "Shadowgate 2014". The way it gripped me, motivated the creation of this set. I hope you experience the same passion when exploring this project.

This set contains 160 place-able pieces and 11 items. 10 tiles sets for inside and outside. I will have a better description on the parts contained later, for it is a beta at the moment ( I consider it complete but I need your input before I release it on the Nexus).

I expect there to be some bugs/problems ( I hope minimal) when testing this set for your self. But please if you can explain the problem in as much detail as possible, that would be appreciated. If you have a better solution for something, do not hold back, as I still have much to learn :).

I left dungeon file intact, it will show how things are put together, for the most part its automatic.

---RELEASES---

Red Cave Resource Pack - Beta 0.3 • 8-23-2019

Red Cave Resource Pack - Beta 0.2 • 8-6-2019

Red Cave Resource Pack - Beta 0.1 • 8-1-2019

---CHANGE LOG ---BETA 0.3---

Scripts
- Added item constrain boxes and projectile colliders to many objects. Many of the objects now have item constrain boxes and projectile colliers to prevent item loss.
- Cleaned up a few scripts for optimization.
Models/Objects
- Moved many objects/models to the "General" Resource folder. I pulled many objects to the general folder due to the fact that they can be used in a "general" fashion. NOTE: The general resource pack will be required for all future packs including this one. Once "Red Cave" is complete I will separate the two packs.
- Added elevation edge stairs. (Stone and Rock, both up and down)
- Made edge height fixers from Negative 2 to Negative 4. These fixes are to hide the open areas above the elevation edge stairways from -2 to -4. I have auto build fixers that will add the grounds, platform and wall. ( 3 different grounds to choose from) NOTE: Be aware that when using "stairs up" at -2, it will protrude through the floor above. I recommend going down to -3 or -4 when using any stairs up.
- Added pillar positions for most lights.
- Added a portcullis pillar.
- Added 6 dead trees, 2 are animated. Dead tree 01 and 02 are animated.
- Added a clean floor tile ground. Same floor tiles you see now just un-damaged in a tight pattern.
- Added more grass/weeds and adjusted the color for outside.
- Added some outside visual structures. A smaller 2x2 structure and a 4x4 structure.
- Added a 2x3 building that can be entered. Has a door frame that can be used with the Grimrock 2 doors I added to the General resource folder. I also recommend using a 4x5 grid of the clean floor tiles for the ground below the building. (On the outside of the building is a brick curb, looks good with the clean floor tiles. Up to you of course :) )
- Added an invisible gate for blocking walls that can be walked through. Best used for the 2x3 building and the rc_dun_wall_01_full set, or anything else that needs a wall collider.
- Added a general bridge. Has 3 bridge sections along with a top support, middle/bottom support, edge support and a bridge handrail. Each bridge section has a different set of planks to give variety. The handrail has a collider.
- Added dungeon style walls plus full walls to create more outside/inside structures and dungeons. As you know I use mostly the "mine" builder for all my walls, these new walls are set up for the "dungeon" builder. The full walls can be used outside ( or inside) to create structures or anything else you decide to build. So far it comes with 1 wall, 1 doorway, 1 door frame, 1 window, 2 broken walls, pillar and 2 broken pillars. ( one of the pillars has a broken part laying on the ground) Each wall also has a no foot option (trim at the bottom of the wall) for stacking.
- Added a general upstairs wooden floor. This a wooden framed floor to use for upper levels to a house or building. (basically a bridge)
- Added a one level wooden ladder. This is meant to be used to go up one floor. Does not look good stacked :P.
- Added most of the Grimrock 2 doors solo. The doors I chose will work with my 2x3 building and rc_dun_wall_01_full_door_frame. NOTE: The double doors will not work on the 2x3 building. (or will not look right)
Textures/Materials
- Moved many textures to the "General" resource folder. Like I said before I pulled models/objects to the "General" resource folder, these textures were also moved to the "General" resource folder because they are mostly used in a general fashion.
- Modified/replaced and added more textures to "Red Cave" and "General" resource folders. Trees, grass, column, wood, bark, and ground.

---CHANGE LOG ---BETA 0.2---
SpoilerShow
Scripts
- Removed unnecessary null components.
- Removed unnecessary occluders.
- Removed replacement default chest. ( left the animation events)
- Reconfigured the rc_lava_surface, no longer uses "WaterSurfaceMeshComponent" or "WaterSurfaceComponent". Uses
"FogParams" that apply when you drop below 0. I highly recommend that you place the rc_lava_surface in the middle of your map( Huge thanks to minmay).
- Changed many objects that have an onInit hook to destroy them selves and spawn a new model with a minimalSaveState. Such as
rc_rock_chasm_1x6. For all stairs down just use void underneath to remove the ground piece.
- Fixed all (hopefully) automap issues.
- Removed "gfxIndexContainer" on unnecessary items.
- Redesigned the rc_ground_01 and rc_ground_02 system (again thanks to minmay :) ). Same behavior as the objects with an onInit hook.
Models
- Changed the portcullis model to work better if placed side by side.
- Removed rc_portcullis_large. Was too clunky, and looked ridiculous lol.
- Added 2 portcullis doors. One is a door that travels down and the other is double sided spike door (opens left and right). That was for you THOM :D
- Fixed the ladder clipping into the elevation edge (modified the elevation edge).
- Created another version of the wood ladder just added longer poles to reach the rock surface.
ToDo
- Need to make some model changes by combining some that do not need to be separate parts.
Last edited by vanblam on Sat Aug 24, 2019 7:07 am, edited 6 times in total.
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by minmay »

Stuff I noticed in a quick skim:
- gen_area_light_low and rc_light_motes have completely useless NullComponents.
- rc_ground_tiles_*, rc_ground_pebbles_*, and rc_rocks_trim_* have occluders that they shouldn't have - the occluder should only be on the floor object beneath them. Having multiple copies of the same occluder in the same location just adds CPU pressure for no benefit.
- there's no need for the chest_replacement object, you can restore the chest sounds to the vanilla chest object (and any other custom ones the user may have!) using animation events alone:

Code: Select all

defineAnimationEvent{
	animation = "assets/animations/env/treasure_chest_open.fbx",
	event = "playSound:chest_open_2",
	frame = 0,
}
defineAnimationEvent{
	animation = "assets/animations/env/treasure_chest_close.fbx",
	event = "playSound:chest_close_2",
	frame = 0,
}
- rc_lava_surface's WaterSurfaceMeshComponent is not needed.
- you may not want minimalSaveState on rc_lava_surface, since it will make the animation reset upon loading. I also don't think you want to have a maxUpdateDistance on its AnimationComponent, unless you want the lava to suddenly freeze when the player is far enough away from the object.
- the onInit hooks on rc_lava_surface, rc_lava_window_01, rc_floor_grate, rc_rock_chasm_1x6, rc_elevation_edge_01, rc_elevation_edge_02, rc_ceiling_shaft, and rc_rock_skull will run again every time the game is loaded because these objects have minimalSaveState. It doesn't look like you've taken this into account, particularly with rc_elevation_edge_* which will spawn more and more and more objects every time the game is loaded. Also remember that all Components have the onInit hook, if the object already has another Component then you don't need to add a NullComponent just for an onInit hook.
- you probably want to make rc_elevation_empty and rc_remove_* destroy themselves after they're done removing stuff.
- gfxIndexContainer is only used if the object has a ContainerItemComponent (it's the icon used when the container is open).
- Models that are split into multiple meshes are rendered less efficiently. Generally only have multiple meshes in a model file if you need them for animation (such as in a lever model) or for DoorComponent. rc_floor_grate.model for example would ideally just be one mesh.
- There is a huge problem with your base_cave_ground system: because the objects based on them (rc_ground_01 and rc_ground_02) have minimalSaveState, they will spawn additional decorations again every time the game is loaded, which will make the dungeon unplayable after a few loads. Of course just taking away minimalSaveState is not a good solution either since these objects will presumably be used a LOT and that will hurt savegame performance a lot.
Instead, use an object that spawns both the decorations and an object with a ground model and an occluder, which can then have minimalSaveState safely, and then destroys itself. Here is what that would look like (can't test right now so sorry if I made a typo):

Code: Select all

defineObject{
	name = "rc_ground_01",
	baseObject = "base_floor",
	components = {
		{
			class = "Null",
			onInit = function(self)
				-- autoDecoFloor01 stuff
				local g = self.go
				local choice = math.random()
				if choice >= 0.6 then
					  spawn("rc_grass_01a",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.4 then
					  spawn("rc_grass_01b",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.2 then
					  spawn("rc_grass_01c",g.level,g.x,g.y,math.random(0,3),g.elevation)
				end
				choice = math.random()
				if choice >= 0.94 then
					  spawn("rc_ground_tiles_01",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.88 then
					  spawn("rc_ground_tiles_02",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.82 then
					  spawn("rc_ground_tiles_03",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.76 then
					  spawn("rc_ground_tiles_04",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.7 then
					  spawn("rc_ground_tiles_05",g.level,g.x,g.y,math.random(0,3),g.elevation)
				end
				choice = math.random()
				if choice >= 0.8 then
					  spawn("rc_ground_pebbles_04",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.6 then
					  spawn("rc_ground_pebbles_01",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.4 then
					  spawn("rc_ground_pebbles_02",g.level,g.x,g.y,math.random(0,3),g.elevation)
					elseif choice >= 0.2 then
					  spawn("rc_ground_pebbles_03",g.level,g.x,g.y,math.random(0,3),g.elevation)
				end

				-- spawn floor object, which destroys this object due to replacesFloor
				g:spawn("rc_ground_01_real")
			end,
		},
	},
	replacesFloor = true,
	tags = { "red cave", "vanblam" },
}
defineObject{
	name = "rc_ground_01_real",
	placement = "floor",
	components = {
		{
			class = "Model",
			model = "mod_assets/vanblam/red_cave/models/env/rc_ground_01.fbx",
			staticShadow = true,
			offset = vec(0, -0.05, 0),
		},
		{
			class = "Occluder",
			model = "assets/models/env/dungeon_floor_01_occluder.fbx",
		},
	},
	replacesFloor = true,
	minimalSaveState = true,
}
This approach would be handy for many of those other minimalSaveState objects with onInit hooks that I listed above, I think.

Looks very nice though; thanks for sharing the great art assets with the community!
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
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by THOM »

After a quick investigation some bug reports from me:

- in the outdoor level there is the highest ladder at 11,2 clipping into the edge of the ground floor

- the burning wood in the floor_torch could need a glow (could be done with a loc_light that also could be switched off if needed)

- almost all doors (if not all) have no automap icon

no atomap icons also on
- rc_porticullis_gate
- rc_large_crystal bed (haven't checked the others)
- the bridge over the lava

- I think the pit with gratings should have no automap
- and something (e.g. on level 2 16,21) has a wrong automap (rocky wall instead of nothing)

- maybe you want to give the porticullis gate also an own kind of door? (maybe one that swings open...) - the mine_spear_door looks a bit unsuitable here

Beside that I also have to say that this looks really amazing and is a great addition to Grimrock modding .
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by vanblam »

minmay, THOM, thanks guys I'm working on those issues right now :)
Pompidom
Posts: 497
Joined: Sun May 06, 2018 9:42 pm

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by Pompidom »

minmay wrote: Fri Aug 02, 2019 4:58 am - There is a huge problem with your base_cave_ground system: because the objects based on them (rc_ground_01 and rc_ground_02) have minimalSaveState, they will spawn additional decorations again every time the game is loaded, which will make the dungeon unplayable after a few loads.
Just out of curiosity, is this a permanent issue that carries over into your save game files permanently? Or does this "reset" after exiting Grimrock 2 and then starting up grimrock 2 again continueing your latest save file?
User avatar
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by vanblam »

minmay wrote: Fri Aug 02, 2019 4:58 am - rc_lava_surface's WaterSurfaceMeshComponent is not needed.
When I remove this component the lava surface disappears.

I understand now what you mean about the onInit hook, I could just attach it to the class model if I wanted to, and the null class is not really necessary. But I think I want it separate just in case the user does not want auto destroy objects. ( I would really not see why, but you never know :D ). Oh and I really see why you don't want 2 onInit hooks on the same object definition LOL.
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by minmay »

vanblam wrote: Sat Aug 03, 2019 5:46 am
minmay wrote: Fri Aug 02, 2019 4:58 am - rc_lava_surface's WaterSurfaceMeshComponent is not needed.
When I remove this component the lava surface disappears.
Sorry, I should have looked closer at this object. I see now that you're taking advantage of WaterSurfaceMeshComponent's transform setting behaviour to fix the animation clobbering the model's offset. That's the most clever Grimrock hack I've seen yet!
But uh, for future reference, you could accomplish the same effect with less overhead (WaterSurfaceMeshComponent adds 200 triangles per water tile), by changing your ModelComponent's definition a bit:

Code: Select all

		{
			class = "Model",
			model = "mod_assets/vanblam/red_cave/models/env/rc_lava_plane.fbx",
			onInit = function(self)
				self.go:setWorldPosition(self.go.map:getWidth()*1.5,-0.2,self.go.map:getHeight()*1.5)
			end,
		},
Unrelated comment on the same object: you might want to consider getting rid of the WaterSurfaceComponent, or splitting it off to a separate object. If there's a WaterSurfaceComponent on a level, it will always render a reflection map, even if no reflective materials are visible - this has a considerable performance cost even when the level has no models marked for reflection. Removing the WaterSurfaceComponent improved my render times on the 4th example level by around 33% in most places! And you aren't actually using the reflection at all, just the underwater fog...doesn't seem worth it to me.
vanblam wrote: Sat Aug 03, 2019 5:46 amOh and I really see why you don't want 2 onInit hooks on the same object definition LOL.
There is nothing wrong with having two onInit hooks on the same object.
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
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by vanblam »

minmay wrote: Sat Aug 03, 2019 7:36 am Unrelated comment on the same object: you might want to consider getting rid of the WaterSurfaceComponent, or splitting it off to a separate object. If there's a WaterSurfaceComponent on a level, it will always render a reflection map, even if no reflective materials are visible - this has a considerable performance cost even when the level has no models marked for reflection. Removing the WaterSurfaceComponent improved my render times on the 4th example level by around 33% in most places! And you aren't actually using the reflection at all, just the underwater fog...doesn't seem worth it to me.
I removed all of that from the lava surface, it is now just a model that animates lol, it looks fine on the surface, but when you drop in
obviously there is no fog. Is there another way to get fog without using the WaterSurfaceComponent? Or can I just have a screen effect that is 1 solid color that's slightly transparent? But how I would I trigger that.. hmm
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by minmay »

Use FogParamsComponent and on every frame, check whether the party's world position is above/below the lava and enable/disable it accordingly. Like this:

Code: Select all

		{
			class = "FogParams",
			fogMode = "dense",
			fogColor = vec(1, 0.4, 0)* 0.8,
			fogRange = {0,10},
		},
		{
			class = "Timer",
			timerInterval = 0,
			currentLevelOnly = true,
			onActivate = function(self)
				local y = party:getWorldPositionY()
				if y < -1.4 then
					self.go.fogparams:enable()
					-- "fade in" the fog a little as the party falls into the lava
					self.go.fogparams:setFogRange({0,10/math.min(1,-1.3-y)})
				else
					self.go.fogparams:disable()
				end
			end,
		},
I know, I know, it's a little weird, but it's a huge performance improvement!
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
vanblam
Posts: 243
Joined: Sun Nov 09, 2014 12:15 am

Re: Vanblam Resource Packs - Red Cave - Beta 0.1

Post by vanblam »

minmay wrote: Mon Aug 05, 2019 1:58 am Use FogParamsComponent and on every frame, check whether the party's world position is above/below the lava and enable/disable it accordingly. Like this:

Code: Select all

		{
			class = "FogParams",
			fogMode = "dense",
			fogColor = vec(1, 0.4, 0)* 0.8,
			fogRange = {0,10},
		},
		{
			class = "Timer",
			timerInterval = 0,
			currentLevelOnly = true,
			onActivate = function(self)
				local y = party:getWorldPositionY()
				if y < -1.4 then
					self.go.fogparams:enable()
					-- "fade in" the fog a little as the party falls into the lava
					self.go.fogparams:setFogRange({0,10/math.min(1,-1.3-y)})
				else
					self.go.fogparams:disable()
				end
			end,
		},
I know, I know, it's a little weird, but it's a huge performance improvement!
Cool, lol when I sober up ill jump on that tomorrow :lol: Thanks minmay :)

EDIT: That worked like a charm, I like how I have better control over the fog too.
Post Reply