- Spring.SetGroundDraw(false)
- Use the new gl.Texture("$info") to support F2 mode etc.
HexFarm - Now with destroyables bridges
Moderator: Moderators
Re: HexFarm - Now with destroyables bridges
hints:
Re: HexFarm - Now with destroyables bridges
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:Spring.SetGroundDraw(false)
Are they writeable?jK wrote:Use the new gl.Texture("$info") to support F2 mode etc.
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
Re: HexFarm - Now with destroyables bridges
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: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:Spring.SetGroundDraw(false)
No? o_Ozwzsg wrote:Are they writeable?jK wrote:Use the new gl.Texture("$info") to support F2 mode etc.
You are killing the GPUs bandwidth (=pixelfillrate). Use the ground fog gadget included in map blueprint.zwzsg wrote:Fog is done by layering a hundred translucent quads:
Re: HexFarm - Now with destroyables bridges
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.jK wrote:It doesn't render grounddecals in that case.
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.
They I fail to see of what use they would be in the context of that map.jK wrote:No? o_Ozwzsg wrote:Are they writeable?jK wrote:Use the new gl.Texture("$info") to support F2 mode etc.
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.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).
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.
Re: HexFarm - Now with destroyables bridges
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?
Re: HexFarm - Now with destroyables bridges
In this HexFarm map, I am using a gadget in \LuaRules\Gadgets\How do you put lua scripts inside the map?
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\
Re: HexFarm - Now with destroyables bridges
oh, so maps can have LuaRules and LuaGaia folders just like mods do? Cool!zwzsg wrote:In this HexFarm map, I am using a gadget in \LuaRules\Gadgets\How do you put lua scripts inside the map?
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\
I am trying to make a map that's regenerated every time you play that's based on the Perlin noise function for terrain.
Re: HexFarm - Now with destroyables bridges
LuaRules is meant for modsyanom wrote:oh, so maps can have LuaRules and LuaGaia folders just like mods do? Cool!
LuaGaia is meant for maps
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: HexFarm - Now with destroyables bridges
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.
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.
Re: HexFarm - Now with destroyables bridges
Whenever I tried to play Hex-farm with the Tech Annihilation mod, it was broken.
I think I were using version 7.
I think I were using version 7.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: HexFarm - Now with destroyables bridges
See https://springrts.com/wiki/Bugs if you're expecting anyone to actually do something!
Re: HexFarm - Now with destroyables bridges
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.
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.