a nice cavern filled with lava

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
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: a nice cavern filled with lava

Post by Eleven Warrior »

Cool Bongo can you make it a Draw Tile eg: lava_floor_tile, that way you don't have to put so many objects on the map :) Just asking that's all.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: a nice cavern filled with lava

Post by minmay »

This will be very bad for performance since you are making an additional light on every tile. I'd prefer to place fewer, larger lights manually.
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: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: a nice cavern filled with lava

Post by Eleven Warrior »

Yes I agree with you Minmay. I just made the Lava Floor Tile just then and on my system no issues, but on a lower performing PC it would be very bad :(
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: a nice cavern filled with lava

Post by Batty »

It does look good but I put down 6 of these tiles and lost 10fps :lol: so uuuhh I'd go easy on them.
User avatar
juho
Posts: 238
Joined: Mon Feb 27, 2012 1:18 pm

Re: a nice cavern filled with lava

Post by juho »

Shadows could be turned off to help performance. We usually didn't have shadows on on similar type of assets in the main game.
Follow me on Twitter: @JuhoMakingStuff
User avatar
Ciccipicci
Posts: 154
Joined: Mon Oct 08, 2012 12:55 am

Re: a nice cavern filled with lava

Post by Ciccipicci »

Cool!!!
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: a nice cavern filled with lava

Post by bongobeat »

glad you like it.
I suppose that this can eat a lot of ressource on the map, specially if you fill an entire map.
(need to try)
I don't know if it will be better to make a full new lava floor, as I'm using the wallfire particle which is very cool, but maybe it is not optimized for this?
anyway, it runs without lag with a geforce gtx 660 with full details. But I don't wanna know how it will act on my old computer :oops:

For safety I have disabled the light and the particle of the fire_emitter on the central lava square (by unchecking the particle and the light in the editor). This works well and you don't notice that they are missing.
shadows is still on.
Maybe the particles of the dungeon fire pit is not necessary as the wall_fire looks great without anymore particles.

I forgot about the chasm: you need to use the falling script that kill the party, if you go through lava.
in this thread viewtopic.php?f=22&t=8569
Or just put invisible wall
Daveyx0 wrote:Really nice! I was wondering what would be the best way. Now just add an invisible platform and make the golem walk over it >:D
well this can be cool, if you add some special effect when the golem walk. :D
actually it's a little strange, because he walks on the fire, but the fire looks like "inert"
there is a problem with the golem height too, it is too big for this area. When he moves, his head or his arm go trough the ceiling
Eleven Warrior wrote:Cool Bongo can you make it a Draw Tile eg: lava_floor_tile, that way you don't have to put so many objects on the map :) Just asking that's all.
well I dont know how to do that actually:
I have tried to put the chasm definition and the fire emitter definition in the same object, but as there is 2 models, only one model will be used.
The problem is, how to add the wall_fire model in a object and transform it as a particle.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: a nice cavern filled with lava

Post by Diarmuid »

This looks great! Ultima Underworld memories arise...
User avatar
Slade
Posts: 45
Joined: Tue Oct 21, 2014 6:31 pm

Re: a nice cavern filled with lava

Post by Slade »

Beautiful!
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: a nice cavern filled with lava

Post by AndakRainor »

Hi!

I've been playing with lava recently, and I would like to know what you think about it :
SpoilerShow
Image
Another test with range = 10 and brightness = 4 for thre light source of lava_effects, which do you prefer ?
SpoilerShow
Image
The idea was to combine the fire emitter with an animated water mesh. I thought the wall_fire model alone made tiles too obvious, and lacked some animation.

The lava definitions :
SpoilerShow

Code: Select all

defineObject{
  name = "lava_effects",
  components = {
    { class = "Model",
      model = "assets/models/effects/wall_fire.fbx",
      sortOffset = 1,
      offset = vec(0, -0.6, 0),
    },
    { class = "Light",
      offset = vec(0, -0.8, 0),
      range = 6,
      color = vec(2.8, 1.2, 0.7),
      brightness = 2,
      castShadow = true,
      shadowMapSize = 64,
      staticShadows = true,
      staticShadowDistance = 0,   -- use static shadows always
    },
    { class = "Particle",
      particleSystem = "dungeon_fire_pit_2",
      offset = vec(0, 0, 0),
    },
  },
  placement = "floor",
  editorIcon = 88,
}

defineObject{
  name = "lava_surface_underground",
  baseObject = "base_floor_decoration",
  components = {
    {
      -- updates global reflection and refraction maps
      class = "WaterSurface",
      planeY = -0.4,
      fogColor = math.saturation(vec(0.26, 0.09, 0.042), 0.5) * 0.5,
      fogDensity = 0.4,
      reflectionColor = vec(1.5, 0.9, 0.27) * 0.9,
      refractionColor = vec(1.5,1.0,0.5),
    },
    {
      -- builds a continuous mesh from underwater tiles
      class = "WaterSurfaceMesh",
      material = "lava",
      underwaterMaterial = "water_surface_underwater",
      offset = vec(0, -0.4, 0),
    },
  },
  dontAdjustHeight = true,
  editorIcon = 264,
}

defineMaterial{
	name = "lava",
	shader = "ocean_water",
	diffuseMap = "mod_assets/textures/env/lava_dif.tga",
	normalMap = "assets/textures/env/ocean_normal.tga",
	displacementMap = "assets/textures/env/ocean_disp.tga",
	doubleSided = false,
	--lighting = true,
	alphaTest = false,
	--castShadow = true,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 0,
	depthBias = 0,
	texOffset = 0,
	foamOffset = 0,
	foamAmount = 0,
   waveAmplitude = 0.3,	
   onUpdate = function(self, time)
     self:setTexcoordScaleOffset(1, 1, math.cos(time*0.15)*0.5, math.sin(time*0.15)*0.5)
   end,
}

defineParticleSystem{
   name = "dungeon_fire_pit_2",
   emitters = {
      
      -- fog 1
      {
         emissionRate = 5,
         emissionTime = 0,
         maxParticles = 50,
         boxMin = {-1.3, 0,-1.3},
         boxMax = { 1.3, 0.5, 1.3},
         sprayAngle = {0,360},
         velocity = {0.1,0.2},
         objectSpace = true,
         texture = "assets/textures/particles/fog.tga",
         lifetime = {3,3},
         color0 = {1.25,0.4,0.2},
         opacity = 0.5,
         fadeIn = 2.2,
         fadeOut = 2.2,
         size = {0.75, 1.5},
         gravity = {0,0.1,0},
         airResistance = 0.5,
         rotationSpeed = 0.3,
         blendMode = "Additive",
      },
      
      -- fog 2
      {
         emissionRate = 5,
         emissionTime = 0,
         maxParticles = 50,
         boxMin = {-1.3, 0,-1.3},
         boxMax = { 1.3, 0.5, 1.3},
         sprayAngle = {0,360},
         velocity = {0.1,0.2},
         objectSpace = true,
         texture = "assets/textures/particles/fog.tga",
         lifetime = {3,3},
         color0 = {1.25,0.4,0.2},
         opacity = 0.5,
         fadeIn = 2.2,
         fadeOut = 2.2,
         size = {0.75, 1.5},
         gravity = {0,0.1,0},
         airResistance = 0.5,
         rotationSpeed = -0.3,
         blendMode = "Additive",
      },

      -- stars
      {
         emissionRate = 40,
         emissionTime = 0,
         maxParticles = 300,
         boxMin = {-1.3, 0.0,-1.3},
         boxMax = { 1.3, 0.5, 1.3},
         sprayAngle = {0,360},
         velocity = {0,0},
         objectSpace = true,
         texture = "assets/textures/particles/firefly_dif.tga",
         lifetime = {0.5,3},
         color0 = {4, 0.4, 0.2},
         opacity = 1,
         fadeIn = 0.1,
         fadeOut = 0.1,
         size = {0.05, 0.1},
         gravity = {0,0.5,0},
         airResistance = 0.1,
         rotationSpeed = 5,
         blendMode = "Additive",
      },

      -- smoke
      {
         emissionRate = 3,
         emissionTime = 0,
         maxParticles = 30,
         boxMin = {-1.3, 0, -1.3},
         boxMax = { 1.3, 1.0, 1.3},
         sprayAngle = {0,20},
         velocity = {0.4, 0.8},
         texture = "assets/textures/particles/smoke_01.tga",
         lifetime = {1,3},
         color0 = {0.25, 0.20, 0.17},
         opacity = 0.5,
         fadeIn = 0.3,
         fadeOut = 0.9,
         size = {1.5, 2},
         gravity = {0,0.3,0},
         airResistance = 0.1,
         rotationSpeed = 0.5,
         blendMode = "Translucent",
      },
   }
}
The mine water tiles :
SpoilerShow

Code: Select all

defineTile{
	name = "mine_floor_water",
	editorIcon = 192,
	color = {40,80,120,255},
	builder = "dungeon",
	floor = {
		"mine_floor_01", 1,
	},
	ceiling = {
		"mine_ceiling_01", 50,
		"mine_ceiling_02", 50,
	},
	wall = {
		"mine_elevation_edge", 1,
	},
	ceilingShaft = "mine_ceiling_shaft",
	underwater = true,
}

defineTile{
	name = "mine_floor_crystal_water",
	editorIcon = 192,
	color = {43,86,150,255},
	builder = "dungeon",
	floor = {
		"mine_floor_01", 1,
	},
	ceiling = {
		"mine_ceiling_01", 50,
		"mine_ceiling_02", 50,
		"mine_ceiling_03", 7,
	},
	wall = {
		"mine_elevation_edge", 1,
	},
	ceilingShaft = "mine_ceiling_shaft",
	underwater = true,
}
Just place some water tiles (elevation -1 max) in your dungeon and add a lava_surface_underground object to the map. Then add the lava_effects objects to each tile (elevation 0).

Also, I reduced the number of particles from your definition as it seems to hit performance with a lot of lava tiles. Now does any one know how I could add magma bubbles effects or any other idea to improve this ? :)
Post Reply