Palladium - Dymanic Heightmap - Page 2

Palladium - Dymanic Heightmap

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Palladium - Dymanic Heightmap

Post by zwzsg »

Pxtl wrote:I think it'd be fun to just make maps that have heightmap-tweaks working on fixed intervals. Like a chokepoint map where the chokepoints open and close on fixed intervals (anything in the chokes when it switches is destroyed).
Yeah.
IllvilJa wrote:But very, very, very cool stuff nevertheless. Heck, could turn the game into a sick platform game! You build something at position X to open up passage Y, so you get to some new area with gizmoid amounts of whatever fantastic resource you want! You could even open up a passage way that let loose some gaia controlled nastiness (CRABS! THE CRABS!) that swarm out and cause issues for your enemies
Yeah.

So many things are possible and not done!
But don't count on me to make them all.

And all those post about "wow" or "awesome" or "win", or even more precisly, "volcano", make me sad as they show how this Spring community has the attention span of a bird. Don't you remember all those threads where Trepan posted his cool effects, like, I don't know, that one?
Beherith wrote:Does this map only work with kernel panic or does it also work with other mods? Because I had some trouble launching it in a ba game.
It was supposed to work with other mods too, however, well, see this thread. Since no one explained me how to correct my issue with LuaGaia or even if it was a true bug or some wacky but intented behavior, I guess I'll have to keep using the LuaRules but without main.lua and draw.lua this time. I'll probably release a v0.4 in an undetermined amount of time.
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Re: Palladium - Dymanic Heightmap

Post by Saktoth »

lurker wrote:
Saktoth wrote:Random map plz.
We already have random.smf
Youwhatnow?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Palladium - Dymanic Heightmap

Post by zwzsg »

Saktoth wrote:Random map plz.
I don't know what lurker is talking about, but http://forums.smoth.net/viewtopic.php?f=76&t=2513





New version!
Palladium_0.4_(beta).sd7
Changelog:
- A couple Map Options, to choose which sides you want your ramps to be made and unmade
- No more main.lua and draw.lua, for hopefully better any-mod compatibility

Download link is still the same: http://jobjol.nl/1965
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Palladium - Dymanic Heightmap

Post by lurker »

There's a map called 'Random'
It's random in the same way as that xkcd.
User avatar
IllvilJa
Posts: 90
Joined: 08 Sep 2008, 00:01

Re: Palladium - Dymanic Heightmap

Post by IllvilJa »

lurker wrote:There's a map called 'Random'
It's random in the same way as that xkcd.
Being a big fan of randomly generated maps (like in Freeciv for instance) I have to admit that you managed, in a sophisticated and compact way, to produce one of the most offensive posts on this forum (in my subjective humble opinion) I have ever seen so far.

Brrrrr.... even joking about such epic game mechanics that are so longed for and deeply missed in spring. Don't you have any morals?

No. I won't report you to the moderators. I'll just focus on recovering from reading your post and try to forget it even existed.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Palladium - Dymanic Heightmap

Post by lurker »

Deeply missed? If that's true I like to think someone would have coded it a while ago.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Palladium - Dymanic Heightmap

Post by zwzsg »

lurker wrote:Deeply missed? If that's true I like to think someone would have coded it a while ago.
But I was coding it last week! I probably won't ever finish, because:
- Spring engine use original heightmap, instead of current heightmap, when culling maps polygons from view.
- I am waiting for lurker to code me Lua hooks to rearrange tiles. My test map looks unreadable without, and I'm too lazy to try if recoloring map with decals or lua would be a viable alternative.
- I realised it's not that easy to algorithmy design random but playable map, and I'm too stubborn to limit the randomness from what I had planned.

To tell the truth, I made Palladium when I realised making a random map generator would be a never ending task and that I'd be better first release a map using dynamic heightmap which was already underused enough without having to aim for something with even more more complexity, and that this way I would tackle one problem at a time, and let time for Spring devs to acknowlege and fix the bugs I was noticing.

Anyway, there's no denying random map generator feature request is MTR. YTR at least.
lurker wrote:There's a map called 'Random'
It's random in the same way as that xkcd.
You're talking about this http://jobjol.nl/527 I suppose. Mentionning it may be funny or not depending on your sensibility, but anyway, once you understand what it is, you realise how irrelevant it is past the joke.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Palladium - Dymanic Heightmap

Post by lurker »

MTR isn't deep, just persistent.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Palladium - Dymanic Heightmap

Post by zwzsg »

So, because, when I lower ramps, I have stuff drawn on the texture map that are not matching the heightmap, I attempted to redo the texture as well as the height.

Before asking for new Lua hooks to switch tiles, I thought I should first test the existing Lua, such as gl.DrawGroundQuad which trepan mentionned in his own Dymanic Heightmap thread.


The texture I applied is in the deep black areas: as my texture doesn't include the greenish detailtex, it looks blacker than the normal black tiles.

The blackness eating the hill at the bottom of the screen is because of the bug where Spring uses the original heightmap to decide which bits of terrain are out of camera view, this is unrelated to the nodeeptest/tearing issue these pics are about.



With DepthTest off (default), it's drawn over the terrain that should hide it, not good:

Image

Image



With DepthTest on, there is fighting between map tile and Lua'ed texture to know which is on top, not good either.

Image


With tons of help from lurker at #lua, I'm actively trying different approaches, but chances that we'll find something simple, fast and perfect, aren't looking that great.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Palladium - Dymanic Heightmap

Post by BaNa »

zw,

I am happy for this because it is the first concrete implementation i see. When the concept first came out, it somehow didnt work ingame for me, so i thought "meh, concept thing that wont work yet ingame"
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Re: Palladium - Dymanic Heightmap

Post by Noruas »

I'd love to see random snow slides, earthquakes, etc, control camera, and shakes screen, destroys everything in the area as the ground terraforms every 2 minutes gradually, not all at once for lag.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Palladium - Dymanic Heightmap

Post by smoth »

people would not play a map with random disasters when they can play maps without random disasters.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Palladium - Dymanic Heightmap

Post by zwzsg »

Which is why the disaster needs to be not random but player controlled.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Palladium - Dymanic Heightmap

Post by REVENGE »

The skyslate maps in OTA had random meteor showers.

How is this done? Are you actually changing the heightmap or faking it? Does the pathfinder reload for changes?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Palladium - Dymanic Heightmap

Post by zwzsg »

REVENGE wrote:How is this done? Are you actually changing the heightmap or faking it? Does the pathfinder reload for changes?
To find the answers to your questions, I would suggest checking it by yourself: http://jobjol.nl/1965 it's only 180Kb!

But yes, the heightmap is actually changed, the pathfinder takes it into account and find new paths, and I wouldn't call it "faked".
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Palladium - Dymanic Heightmap

Post by Neddie »

I always wanted to play on a dy-manic map. Dynamic. I tested on it, quite fun, z.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Palladium - Dymanic Heightmap

Post by zwzsg »

Ok, back to my attempt to also change the texture so they match height:

Before, I had one gl.DrawGroundQuad per ramp:
- Either gl.DepthTest(true) and then the old ground texture tears trough
- Either gl.DepthTest(false) and then my texture gets drawn over the foreground

So I made it test if any of the four corner of the ramp was hidden by something in the foreground, choose gl.DepthTest(true) if so, gl.DepthTest(false) else.

Game was still smooth, and it was only half as bad.


So today I tried to do that choice on each 32x32 square instead of each ramp. That way I get the see-trough tearing only on the squares touching the foreground instead of the whole ramp.

It does what I want, but the performance drop is hugely noticeable. So unless someone can hugely optimize my following code, I will have to ask either a huge improvement to gl.DrawGroundQuad or to have tile index Lua hook implemented.

Code: Select all

else -- UnSynced

function IsTerrainHidden(x1,y1,z1)
	local xs,ys=Spring.WorldToScreenCoords(x1,y1,z1)
	local _,pos=Spring.TraceScreenRay(xs,ys,true,false)
	if pos then
		local x2,y2,z2=unpack(pos)
		if math.sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)>30 then
			return true
		end
	else
		return nil
	end
	return false
end

function IsxzTerrainHidden(x1,z1)
	return IsTerrainHidden(x1,Spring.GetGroundHeight(x1,z1),z1)
end

function gadget:DrawWorldPreUnit()
	if (not Spring.GetMapOptions()) or (not Spring.GetMapOptions()["palladium_draw_ground_quad"]) or (Spring.GetMapOptions()["palladium_draw_ground_quad"]=="1") or (Spring.GetMapOptions()["palladium_draw_ground_quad"]=="2") then
		local per_square = (Spring.GetMapOptions() and Spring.GetMapOptions()["palladium_draw_ground_quad"] and Spring.GetMapOptions()["palladium_draw_ground_quad"]=="2")
		if SYNCED.PalladiumMap then
			gl.ResetState()
			gl.Texture("maps/32x32kpybs.png")
			-- After synced -> unsynced the table # is zero
			-- and ipair doesn't find any element
			-- which is why sipairs must be used
			for _,a in sipairs(SYNCED.PalladiumMap.ReTexturedAreaList) do
				if Spring.IsAABBInView(a.x1,Spring.GetGroundHeight(a.x1,a.z1),a.z1,a.x2,Spring.GetGroundHeight(a.x2,a.z2),a.z2) then
					if IsxzTerrainHidden(a.x1,a.z1) or IsxzTerrainHidden(a.x1,a.z2) or IsxzTerrainHidden(a.x2,a.z1) or IsxzTerrainHidden(a.x2,a.z2) then
						if per_square then
							for x=a.x1+32,a.x2,32 do
								for z=a.z1+32,a.z2,32 do
									if IsxzTerrainHidden(x-32,z-32) or IsxzTerrainHidden(x-32,z) or IsxzTerrainHidden(x,z-32) or IsxzTerrainHidden(x,z) then
										gl.DepthTest(true)
									else
										gl.DepthTest(false)
									end
									gl.DrawGroundQuad(x-32,z-32,x,z,true,0,0,1,1)
								end
							end
						else
							gl.DepthTest(true)
							gl.DrawGroundQuad(a.x1,a.z1,a.x2,a.z2,true,a.u1,a.v1,a.u2,a.v2)
						end
					else
						gl.DepthTest(false)
						gl.DrawGroundQuad(a.x1,a.z1,a.x2,a.z2,true,a.u1,a.v1,a.u2,a.v2)
					end
				end
			end
			gl.Texture(false)
			gl.DepthTest(false)
		end
	end
end

end
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Palladium - Dymanic Heightmap

Post by PicassoCT »

NeoTokyo 3.. Cityup, Citydown, Cityup, Citydown, Cityup, Citydown
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Palladium - Dymanic Heightmap

Post by Neddie »

False alarum, Shinji.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Palladium - Dymanic Heightmap

Post by PicassoCT »

sorry for that skyscraperspagat- it will never happen again, i sware.
Cityup, Citydown...
Thats like an Addiction, if you look upon it from a diffrent Angle
Post Reply

Return to “Map Creation”