HexFarm - Now with destroyables bridges - Page 4

HexFarm - Now with destroyables bridges

All map release threads should be posted here

Moderator: Moderators

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: HexFarm - Now with destroyables bridges

Post by jK »

hints:
  • Spring.SetGroundDraw(false)
  • Use the new gl.Texture("$info") to support F2 mode etc.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: HexFarm - Now with destroyables bridges

Post by zwzsg »

jK wrote:Spring.SetGroundDraw(false)
I used to do that. But it had some tiny graphical bug. My memory about what exactly is hazy, sorry, but AFAIK it was something about how it didn't render walls & wreckages, and maybe other things. So later I moved to using a transparent map texture instead.
jK wrote:Use the new gl.Texture("$info") to support F2 mode etc.
Are they writeable?






While you're here: Knorke recently discovered the fog cause tremedous loss of performance on his setup. I only use the fog with two skins, Pastoral and Geological, so it was easy to see the fog was the culprit. All other skins fade to black, which is done with a much simpler gl.Color({0,0,0,1}). But for Pastoral and Geological, I wanted a colored bottomless pit. I'm curious to know why is that his computer choke on the fog, while mine runs fine. Fog is done by layering a hundred translucent quads:

Code: Select all

	local function SkyboxAndFogVertices()
		-- The skybox:
		-- [...]
		-- Here I draw ten huge quad as a sort of custom skybox, removed in this extract to keep it short
		-- [...]

		-- The fog
		local u=1.5/(TextureWidth or 4096)
		local v=2.5/(TextureHeight or 1024)
		for y=y1,y0,(y0-y1)/100 do
			gl.Color(1,1,1,((y-y0)/(y1-y0))^2)
			gl.TexCoord(u,v)
			gl.Vertex(x1,y,z1)
			gl.TexCoord(u,v)
			gl.Vertex(x1,y,z2)
			gl.TexCoord(u,v)
			gl.Vertex(x2,y,z2)
			gl.TexCoord(u,v)
			gl.Vertex(x2,y,z1)
		end
		gl.Color(1,1,1,1)
	end



		if UseSkyboxAndFog then
			gl.Blending(true)
			gl.BeginEnd(GL.QUADS,SkyboxAndFogVertices)
			gl.Blending(false)
		end
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: HexFarm - Now with destroyables bridges

Post by jK »

zwzsg wrote:
jK wrote:Spring.SetGroundDraw(false)
I used to do that. But it had some tiny graphical bug. My memory about what exactly is hazy, sorry, but AFAIK it was something about how it didn't render walls & wreckages, and maybe other things. So later I moved to using a transparent map texture instead.
It doesn't render grounddecals in that case. Still keeping the engine drawing is no option. Cause you make the `hidden` parts of the terrain very bumpy (to make it unpassable) this makes ROAM going crazy and eats whole CPU & RAM. So better disable engine terrain drawing and use typemaps to make areas unpassable (yes, Lua can change square's groundtype).
zwzsg wrote:
jK wrote:Use the new gl.Texture("$info") to support F2 mode etc.
Are they writeable?
No? o_O
zwzsg wrote:Fog is done by layering a hundred translucent quads:
You are killing the GPUs bandwidth (=pixelfillrate). Use the ground fog gadget included in map blueprint.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: HexFarm - Now with destroyables bridges

Post by zwzsg »

jK wrote:It doesn't render grounddecals in that case.
No grounddecals is ok, it's even somewhat desirable since grounddecals gets stretched in ugly ways over cliff, and reveal the spikes there when they extended to the bottom. Plus possible tearing between it and my texture.

However, not seeing the wall you just built, or the wreckage that block units, was really problematic, and something I really had to find a way around.

Then I just tested and apparently in Spring 91 the bug about new feature being invisible when SetDrawGround(false) is no more.




jK wrote:
zwzsg wrote:
jK wrote:Use the new gl.Texture("$info") to support F2 mode etc.
Are they writeable?
No? o_O
They I fail to see of what use they would be in the context of that map.



jK wrote:(you make the `hidden` parts of the terrain very bumpy (to make it unpassable) this makes ROAM going crazy and eats whole CPU & RAM. So better disable engine terrain drawing and use typemaps to make areas unpassable (yes, Lua can change square's groundtype).
I know. In fact, this very map does use Spring.SetMapSquareTerrainType extensively. The void is set as a zero speed zone. However, the units would still glady drive into it. They won't get out, but still want to go in. So I would end up with piles of units getting stuck on the border, and a tar pit isn't the effect I was looking for.

Somehow, units are more afraid of slope than of no speed, so I use spiky terrain in addition to null speed. It's better, but not enough. The pathfinder still drive units into the void. So I have the gadget place any units found in the void back on nearest tower/bridge if there's one nearby (and explode the unit if it's too far into the void). It's still not enough and units still manage to end up far into the void. But at least now it happens seldom, or in heavy traffic jam, instead of losing half your units each time you cross a bridge.

Also, buildings can still be constructed in null speed zone, but not over spiky terrain. Well, at least in common mods where every building has a MaxSlope.

If you know extra terrain type tags to truely make an area impassable and unbuildable, please speak up.
yanom
Posts: 323
Joined: 10 Jul 2009, 23:34

Re: HexFarm - Now with destroyables bridges

Post by yanom »

How does the lua for this work? I'm trying to make a similar procedurally-generated map for my own game. How do you put lua scripts inside the map?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: HexFarm - Now with destroyables bridges

Post by zwzsg »

How do you put lua scripts inside the map?
In this HexFarm map, I am using a gadget in \LuaRules\Gadgets\
This is the wrong way to do it.

The right way is to put the gadget in \LuaGaia\Gadgets\

Make sure you have the two tiny draw.lua and main.lua inside your \LuaGaia\
yanom
Posts: 323
Joined: 10 Jul 2009, 23:34

Re: HexFarm - Now with destroyables bridges

Post by yanom »

zwzsg wrote:
How do you put lua scripts inside the map?
In this HexFarm map, I am using a gadget in \LuaRules\Gadgets\
This is the wrong way to do it.

The right way is to put the gadget in \LuaGaia\Gadgets\

Make sure you have the two tiny draw.lua and main.lua inside your \LuaGaia\
oh, so maps can have LuaRules and LuaGaia folders just like mods do? Cool!

I am trying to make a map that's regenerated every time you play that's based on the Perlin noise function for terrain.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: HexFarm - Now with destroyables bridges

Post by zwzsg »

yanom wrote:oh, so maps can have LuaRules and LuaGaia folders just like mods do? Cool!
LuaRules is meant for mods
LuaGaia is meant for maps
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: HexFarm - Now with destroyables bridges

Post by bobthedinosaur »

So I guess there is a bug fix due for the next release?

Also if possible I guess either the option to have no bridges or maybe have a game mode detection for no bridges (would that work?) options would be greatly appreciated for floating island style maps.
SolaEvoli
Posts: 6
Joined: 04 Sep 2015, 04:23

Re: HexFarm - Now with destroyables bridges

Post by SolaEvoli »

Whenever I tried to play Hex-farm with the Tech Annihilation mod, it was broken.

I think I were using version 7.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: HexFarm - Now with destroyables bridges

Post by Silentwings »

See https://springrts.com/wiki/Bugs if you're expecting anyone to actually do something!
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: HexFarm - Now with destroyables bridges

Post by zwzsg »

Yes, sorry, I had an index wrong, and so it didn't work in Spring 99 and over.

There, I fixed it: http://springfiles.com/spring/spring-maps/hexfarm8

The fix is only 4 character long, and it took me over five months to release it, but better late than never.
Post Reply

Return to “Map Releases”