Journeywar - Page 44

Journeywar

PicassoCT's stunning mixture of game design and psychedelia, for your enjoyment!

Moderators: Moderators, Content Developer

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Journeywar

Post by AF »

But what is its purpose?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

deminishing smarthphone performance by looping endlessly... ;)

nah, it raises the waterlevel on the map. its counterpart lowers it.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

While we ponder at raptorphilosophical questions - what does this mean?
Error: why are you using CNullUnitScript anyway?
[f=0008200] Error: Invalid piecenumber
It does not give a number, not give you a unit? What is it?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

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
Anybody any idea why the terraintable i get from the game is always empty?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Journeywar

Post by zwzsg »

No, but I know that:

Code: Select all

      for z=1,Game.mapSizeZ-1, 1 do
         for x=1,Game.mapSizeX-1, 1 do
            Spring.SetHeightMap( x, z, 
You could save time and memory by using steps of 8 in loops dealing with heighmap:

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
What's wrong with using Spring.GetGroundOrigHeight ?


Code: Select all

TerrainMapWorkingCopy= orgTerrainMap
This won't copy the table content, but just a reference to it.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

zwzsg wrote:No, but I know that:

Code: Select all

      for z=1,Game.mapSizeZ-1, 1 do
         for x=1,Game.mapSizeX-1, 1 do
            Spring.SetHeightMap( x, z, 
You could save time and memory by using steps of 8 in loops dealing with heighmap:

Code: Select all

			for x=0,Game.mapSizeX,8 do
				for z=0,Game.mapSizeZ,8 do
					Spring.SetHeightMap(x,z, 
Good call, did that...
zwzsg wrote:

Code: Select all

--Creates the original TerrainTable
What's wrong with using Spring.GetGroundOrigHeight ?
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 enough

Code: Select all

TerrainMapWorkingCopy= orgTerrainMap
This won't copy the table content, but just a reference to it.[/quote]
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
Testin
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

could it be.. that holding a table as big as the heightmap is beyond the capabilities of lua? it crashes when it test for it

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

Re: Journeywar

Post by PicassoCT »

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

Re: Journeywar

Post by PicassoCT »

transparent building eating performance.. nom nom nom

Image

Still makes for a nice view

Image

Image

Image
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
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Journeywar

Post by Google_Frog »

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.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

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.
Attachments
jbehebetterversion2.png
(63.73 KiB) Downloaded 8 times
jbehebetterversion1.png
(89.36 KiB) Downloaded 8 times
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

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.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Journeywar

Post by SinbadEV »

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.
Snowmobiles run on tracks and the Old, Homebrew or specialty ones tend to look pretty frail.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Journeywar

Post by knorke »

Not all are frail, some are just unusual looking:

Image

Image

Image

Aardvark mine clearing vehicle:
Image
http://upload.wikimedia.org/wikipedia/c ... ehicle.jpg

Image
http://www.nist.gov/el/isd/owff2.cfm

space travel, srsbsnss:
Image
http://usrc.blogspot.de/2008/12/new-nas ... ncept.html

replace wheels with tracks = win:
Image
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

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

Image
Attachments
Oponnion.jpg
(160.93 KiB) Downloaded 7 times
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

Image

anthill now works as intended
Attachments
SomeMBsForAFsEyesOnly.jpg
(1022.78 KiB) Downloaded 7 times
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

trees growing into your base, get yourself a gammagardener..

Image

beheriths avveSum Map

Image
Attachments
gettinlow.jpg
(1.54 MiB) Downloaded 7 times
gettinghigh.jpg
(1.37 MiB) Downloaded 7 times
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

Image
Attachments
screen00374.jpg
(1.06 MiB) Downloaded 7 times
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

SubOrbital Strikeforce.. run for cover...

Image

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

Image
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
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Journeywar

Post by PicassoCT »

there is nothing as hot as a alien beauty cooked by heavy gama rays
Image
What? Garlic and chili makes exotic enough cuisine you say? Never been offworld, haeh?
Attachments
screen00384.jpg
(1.43 MiB) Downloaded 7 times
Post Reply

Return to “Journeywar”