Journeywar
Moderators: Moderators, Content Developer
Re: Journeywar
deminishing smarthphone performance by looping endlessly...
nah, it raises the waterlevel on the map. its counterpart lowers it.

nah, it raises the waterlevel on the map. its counterpart lowers it.
Re: Journeywar
While we ponder at raptorphilosophical questions - what does this mean?
It does not give a number, not give you a unit? What is it?Error: why are you using CNullUnitScript anyway?
[f=0008200] Error: Invalid piecenumber
Re: Journeywar
Code: Select all
function gadget:GetInfo()
return {
name = "WaterLevelManager",
desc = "Recives the terraFormInformation. applies the actuall terraforming, informs Units about the currentWaterLevelOffset",
author = "PicassoCT",
date = "7 b.Creation",
license = "GNU GPL, v2 its goes in all fields",
layer = 0,
enabled = true -- loaded by default?
}
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- synced only
if (gadgetHandler:IsSyncedCode()) then
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--various Tools
--function validates Unit Table
function validateUnitTable(tableToValidate)
x=table.getn(tableToValidate)
for i=1,x,1 do
if Spring.ValidUnitID((tableToValidate[i][1]))~= true then
table.remove(tableToValidate,i)
x=x-1
i=i-1
end
end
return tableToValidate
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local boolGameIsNotOver=true
local gWaterOffSet=0 --global WaterOffset
local UPDATE_FREQUNECY=4200
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
boolFirst=true
--Table contains all the WaterLevelChanging Units
local WaterLevelChangingUnitsTable={}
--Table contains all Units who perform Terraforming - and thus need to be informed of rising waterLevels
local LandLordTable={}
local TerrainMapWorkingCopy={}
local orgTerrainMap={}
GG.addWaterLevel = 0
GG.subWaterLevel = 0
--function collects the stored changedate from the WaterLevelingUnits
function getGlobalOffset()
returnVal=GG.addWaterLevel-GG.subWaterLevel
GG.addWaterLevel=0
GG.subWaterLevel=0
return returnVal
end
--Every unit signs up, is checked for its UnitdefId beeing that of a WaterAdder or a WaterSubstractor
function gadget:UnitCreated(unitID, unitDefID, unitTeam)
if unitDefID==UnitDefNames["cwaterextractor"].id or unitDefID == UnitDefNames["jwatergate"].id then
Spring.Echo("Registrated WaterUnit")
subTable={}
subTable[1]=unitID
subTable[2]=unitDefID
subTable[3]=unitTeam
index=(table.getn(WaterLevelChangingUnitsTable))+1
WaterLevelChangingUnitsTable[index]={}
WaterLevelChangingUnitsTable[index]=subTable
end
if unitDefID==UnitDefNames["mdiggmex"].id or unitDefID == UnitDefNames["jdrilltree"].id then
Spring.Echo("Registrated DigUnit")
subTable={}
subTable[1]=unitID
subTable[2]=unitDefID
subTable[3]=unitTeam
index=(table.getn(LandLordTable))+1
LandLordTable[index]={}
LandLordTable[index]=subTable
end
end
--Creates the original TerrainTable
function forgeFirstTerrainMap()
for out=1,Game.mapSizeX,1 do
SubTable={}
Spring.Echo("Adding to the Max")
for i=1,Game.mapSizeZ,1 do
SubTable[i]=Spring.GetGroundHeight(out,i)
end
orgTerrainMap[out]={}
orgTerrainMap[out]=SubTable
end
assert(orgTerrainMap)
end
--adds the WaterLvl to the heightmap
function computateWaterHeightmap()
TerrainMapWorkingCopy= orgTerrainMap
local WaterOffset= getGlobalOffset()
--assert(TerrainMapWorkingCopy)
--Spring.Echo("Here we go again")
--assert(WaterOffset)
outerLimit=Game.mapSizeX
innerLimit=Game.mapSizeZ
-- Spring.Echo(outerLimit)
--Spring.Echo("the table getn", table.getn(TerrainMapWorkingCopy))
--Spring.Echo(innerLimit)
for out= 1, outerLimit, 1 do
for i= 1, innerLimit, 1 do
TerrainMapWorkingCopy[out][i]=(TerrainMapWorkingCopy[out][i])+ WaterOffset
end
end
end
function applyTerraInform()
if boolFirst == true then
boolFirst=false
orgTerrainMap= forgeFirstTerrainMap()
else
computateWaterHeightmap()
end
if getGlobalOffset ~= 0 then
Spring.SetHeightMapFunc(function()
for z=1,Game.mapSizeZ-1, 1 do
for x=1,Game.mapSizeX-1, 1 do
Spring.SetHeightMap( x, z, TerrainMapWorkingCopy[x][z] )
end
end
end)
end
end
function gadget:GameFrame(f)
if f%UPDATE_FREQUNECY == 0 then
--applyChanges to Map
applyTerraInform(gheightMap)
end
end
end
Re: Journeywar
No, but I know that:
You could save time and memory by using steps of 8 in loops dealing with heighmap:
What's wrong with using Spring.GetGroundOrigHeight ?
This won't copy the table content, but just a reference to it.
Code: Select all
for z=1,Game.mapSizeZ-1, 1 do
for x=1,Game.mapSizeX-1, 1 do
Spring.SetHeightMap( x, z,
Code: Select all
for x=0,Game.mapSizeX,8 do
for z=0,Game.mapSizeZ,8 do
Spring.SetHeightMap(x,z,
Code: Select all
--Creates the original TerrainTable
Code: Select all
TerrainMapWorkingCopy= orgTerrainMap
Re: Journeywar
Good call, did that...zwzsg wrote:No, but I know that:
You could save time and memory by using steps of 8 in loops dealing with heighmap:Code: Select all
for z=1,Game.mapSizeZ-1, 1 do for x=1,Game.mapSizeX-1, 1 do Spring.SetHeightMap( x, z,
Code: Select all
for x=0,Game.mapSizeX,8 do for z=0,Game.mapSizeZ,8 do Spring.SetHeightMap(x,z,
Problem is that i dont want to flood the engine with calls every half minute (i allready do once i start terraformin), so i just get the heightmap once, and then add to a copy of the org (+ waterheightmap)+calced in heightmapchanges by the miningunits) and that should be expensive enoughzwzsg wrote:What's wrong with using Spring.GetGroundOrigHeight ?Code: Select all
--Creates the original TerrainTable
Code: Select all
TerrainMapWorkingCopy= orgTerrainMap
Got it and fixxed...
Code: Select all
function table.copy(t)
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
end
return t2
end
Re: Journeywar
transparent building eating performance.. nom nom nom

Still makes for a nice view



Still makes for a nice view
- Attachments
-
- banner3.png
- ||
- (86.34 KiB) Downloaded 5 times
-
- jwct.png
- (88.35 KiB) Downloaded 5 times
-
- jw1.png
- |
- (71.73 KiB) Downloaded 5 times
-
- screen00354.JPG
- (170.52 KiB) Downloaded 5 times
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Journeywar
Why not Spring.AddHeightMap if you want to move everything up or down by a certain amount? Then you don't need to know the starting height.
Re: Journeywar
the problem starts when not everything moves equally up and down ( the mountains and holes dug by the miningvehicles) - but you are right of course.. its not a good solution to permanently hold the heightmap in the lua stack maschine.. or worser even pushed back on the harddrive.
My Question.. is it cheaper to engine call the original value every time and re-computate the changed heightmap.. or would it be cheaper to just get the current value, and add up (doesent make a big difference though, come to think of it)- or (that one would be a suprise) is it actually cheaper to store the heightmap..
Still have to apply that portioning of the terraform upon 16 frames
Better write a todoList:
-JwLandlord //thats the terraformgadget -> DivAndDistribBy16 Function
-JwElectric //still troubles in the RoastBeefFunction
-AddBehes glowing Barrels to the Hedgehog
-Efence needs a new Sound, thinking about the one that flies make when they get into one of those electric traps. Fits somehow.
Journey: Tree. Conroach. And a BuildUnit.
Lots of additional bugfixxing.
Isnt it nice, i can look into the future. Thats my summer right there.
My Question.. is it cheaper to engine call the original value every time and re-computate the changed heightmap.. or would it be cheaper to just get the current value, and add up (doesent make a big difference though, come to think of it)- or (that one would be a suprise) is it actually cheaper to store the heightmap..
Still have to apply that portioning of the terraform upon 16 frames
Better write a todoList:
-JwLandlord //thats the terraformgadget -> DivAndDistribBy16 Function
-JwElectric //still troubles in the RoastBeefFunction
-AddBehes glowing Barrels to the Hedgehog
-Efence needs a new Sound, thinking about the one that flies make when they get into one of those electric traps. Fits somehow.
Journey: Tree. Conroach. And a BuildUnit.
Lots of additional bugfixxing.
Isnt it nice, i can look into the future. Thats my summer right there.
- Attachments
-
- jbehebetterversion2.png
- (63.73 KiB) Downloaded 8 times
-
- jbehebetterversion1.png
- (89.36 KiB) Downloaded 8 times
Re: Journeywar
Im searching for something paradox.. im searching for maschinery on tracks, which looks frail, and im searching for a unique setup for this tracked maschinery. If you have something inspiring and want to share.. post it. Even just unique shapes watched from above..
frankly i tried everything for a weekend now, and im all out of ammo.
frankly i tried everything for a weekend now, and im all out of ammo.
Re: Journeywar
Snowmobiles run on tracks and the Old, Homebrew or specialty ones tend to look pretty frail.PicassoCT wrote:Im searching for something paradox.. im searching for maschinery on tracks, which looks frail, and im searching for a unique setup for this tracked maschinery. If you have something inspiring and want to share.. post it. Even just unique shapes watched from above..
frankly i tried everything for a weekend now, and im all out of ammo.
Re: Journeywar
Not all are frail, some are just unusual looking:



Aardvark mine clearing vehicle:

http://upload.wikimedia.org/wikipedia/c ... ehicle.jpg

http://www.nist.gov/el/isd/owff2.cfm
space travel, srsbsnss:

http://usrc.blogspot.de/2008/12/new-nas ... ncept.html
replace wheels with tracks = win:




Aardvark mine clearing vehicle:

http://upload.wikimedia.org/wikipedia/c ... ehicle.jpg

http://www.nist.gov/el/isd/owff2.cfm
space travel, srsbsnss:

http://usrc.blogspot.de/2008/12/new-nas ... ncept.html
replace wheels with tracks = win:

Re: Journeywar
a draft... after diggesting the suggestions.. the thing is not final.. as the first hedgehog approach wasnt..

- Attachments
-
- Oponnion.jpg
- (160.93 KiB) Downloaded 7 times
Re: Journeywar
anthill now works as intended
- Attachments
-
- SomeMBsForAFsEyesOnly.jpg
- (1022.78 KiB) Downloaded 7 times
Re: Journeywar
trees growing into your base, get yourself a gammagardener..

beheriths avveSum Map

beheriths avveSum Map
- Attachments
-
- gettinlow.jpg
- (1.54 MiB) Downloaded 7 times
-
- gettinghigh.jpg
- (1.37 MiB) Downloaded 7 times
Re: Journeywar
SubOrbital Strikeforce.. run for cover...

Oh.. wait.. nukes in every projectile? Nevermind. Stay and enjoy the sunrise.

Oh.. wait.. nukes in every projectile? Nevermind. Stay and enjoy the sunrise.
- Attachments
-
- subOrb.jpg
- (374.3 KiB) Downloaded 7 times
-
- corrida.jpg
- (2.06 MiB) Downloaded 7 times
-
- afwontlikethis.JPG
- (189.67 KiB) Downloaded 7 times
Re: Journeywar
there is nothing as hot as a alien beauty cooked by heavy gama rays

What? Garlic and chili makes exotic enough cuisine you say? Never been offworld, haeh?
What? Garlic and chili makes exotic enough cuisine you say? Never been offworld, haeh?
- Attachments
-
- screen00384.jpg
- (1.43 MiB) Downloaded 7 times