Terrain sheet overflow

Information and discussion for custom maps and mods.
Post Reply
eddie
Posts: 47
Joined: Sun Feb 23, 2014 8:42 am

Terrain sheet overflow

Post by eddie » Tue Mar 18, 2014 11:35 am

I am having difficulties adding new tiles to the temperat terrain. The game crashes giving me this exception log:
Red Alert Mod at Version release-20131223
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 2.0.50727.5477
Exception of type `OpenRA.Graphics.SheetOverflowException`: Terrain sheet overflow. Try increasing the tileset SheetSize parameter.
bei OpenRA.Graphics.Theater.<Theater>c__AnonStorey83.<>m__199()
bei OpenRA.Graphics.SheetBuilder.Allocate(Size imageSize, float2 spriteOffset)
bei OpenRA.Graphics.SheetBuilder.Add(Byte[] src, Size size, float2 spriteOffset)
bei OpenRA.Graphics.SheetBuilder.Add(ISpriteFrame frame)
bei OpenRA.Graphics.Theater.<LoadTemplate>m__19A(ISpriteFrame f)
bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
bei System.Linq.Buffer`1..ctor(IEnumerable`1 source)
bei System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
bei OpenRA.Graphics.Theater.LoadTemplate(String filename, String[] exts, Dictionary`2 sourceCache, Int32[] frames)
bei OpenRA.Graphics.Theater..ctor(TileSet tileset)
bei OpenRA.Graphics.WorldRenderer..ctor(World world)
bei OpenRA.Game.StartGame(String mapUID, Boolean isShellmap)
bei OpenRA.Game.LoadShellMap()
bei OpenRA.Mods.RA.DefaultLoadScreen.TestAndContinue()
bei OpenRA.Mods.RA.DefaultLoadScreen.StartGame()
bei OpenRA.Game.InitializeWithMod(String mod)
bei OpenRA.Game.Initialize(Arguments args)
bei OpenRA.Program.Run(String[] args)
bei OpenRA.Program.Main(String[] args)
What have I done wrong? What is a tileset sheet size parameter?

User avatar
Sleipnir
Posts: 777
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir » Tue Mar 18, 2014 10:33 pm

The tileset artwork is combined into one big image when the game starts, which allows it to efficiently render the ground. The default texture size is 512x512(x4 channels), which is enough to store 1764 individual tiles for RA/TD, or 1024 individual tiles for D2K. D2K already has more than 1024 tiles, and so it specifies "SheetSize: 1024" in arrakis.yaml, which raises this limit to 4096 tiles.

You can do the same thing: add "SheetSize: 1024" on a new line below "Extensions: .tem, .shp" in temperat.yaml.

eddie
Posts: 47
Joined: Sun Feb 23, 2014 8:42 am

Post by eddie » Wed Mar 19, 2014 9:16 am

Adding "SheetSize: 1024" stopps the game from crashing. Thank you.

However some of my tiles do appear in game as black squares (see screenshot below). This is strange as they do look absolutely perfect in the map editor. May this issue be connected to the issue concerning the sheet size?
Attachments
blacktiles.png
blacktiles.png (124.03 KiB) Viewed 4167 times

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko » Wed Mar 19, 2014 4:32 pm

Is this the tileset which did not fit quality standards?

Looks fitting to me.
Hail to the soviets!

Matt
Posts: 1023
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt » Wed Mar 19, 2014 6:09 pm

Yeah, maybe we should just take the cobblestone without the houses which were criticized for being out of scale. We probably need some YAML and sprites to actually help here.

User avatar
Sleipnir
Posts: 777
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir » Wed Mar 19, 2014 10:31 pm

I wouldn't object to that, but Scott did when I mentioned this in IRC.

As for the actual problem, i'm not sure. The editor doesn't share any rendering code with the game, and it is interesting to see that it works where the game does not - it is usually the opposite situation.

eddie
Posts: 47
Joined: Sun Feb 23, 2014 8:42 am

Post by eddie » Thu Mar 20, 2014 10:01 am

I posted the .tem files here: http://www.sleipnirstuff.com/forum/view ... c&start=45
I hope you can figure out what's wrong with them as I really would like to finish this project. I really appreciate your help.

User avatar
zypres1
Posts: 258
Joined: Mon Oct 24, 2011 8:22 pm

Post by zypres1 » Tue Mar 25, 2014 8:43 pm

Try removing the tree and sam sites? It could be too close to the road, and then "share" place..

Matt
Posts: 1023
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt » Wed Mar 26, 2014 9:06 am

No, road is terrain and sam sites as well as trees are actors which are placed on terrain. I doubt the sprites are bogus. It seems to be just syntax errors in your terrain YAML and the editor is more fault tolerant than the engine, for example:

Code: Select all

	Template@619&#58;
		Id&#58; 619
		Image&#58; cobendn2dirt
		Size&#58; 3,2
		Category&#58; Cobblestone
		Tiles&#58;
			0&#58; Clear
			1&#58; Road
			2&#58; Clear
			4&#58; Road
Size: 3x2=6, but only 4 tiles are defined. You forgot Tiles 3 and 5.

eddie
Posts: 47
Joined: Sun Feb 23, 2014 8:42 am

Post by eddie » Wed Mar 26, 2014 11:53 am

I don't think the problem is in the YAML file. I've created some road images that are non rectangular. So I only added those tiles to the YAML file that do exist. There is no frame no. 3 and 5 in those files.

However the non rectangular images work fine in game. Only those files which have »PickAny: True« in the YAML file are not working properly in game.

eddie
Posts: 47
Joined: Sun Feb 23, 2014 8:42 am

Post by eddie » Thu Mar 27, 2014 8:53 am

I've been playing around with existing and fine working files. Now I am sure the problem is the PickAny parameter. However I just don't know why.

I edited the YAML file: I changed the size of existing files to "1,1" and added "PickAny: True". Now the same thing happened to those files as to mine. Some of the tiles appear black in game (see screenshot) but not in the editor.

Either I am using "PickAny: True" wrong or there's an issue in the code.
Attachments
blacktiles.png
blacktiles.png (14.31 KiB) Viewed 3997 times

Matt
Posts: 1023
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt » Sat Mar 29, 2014 7:55 am

Are you using the latest development version or the old stable christmas release? There have been some changes and cleanups in that regard so a potential issue could already been fixed.

eddie
Posts: 47
Joined: Sun Feb 23, 2014 8:42 am

Post by eddie » Sat Mar 29, 2014 1:00 pm

The problem occurs in the stable release as well as in the development version.

I finally know what is causing this: The files that use PickAny and work have 16 frames. Seems to me you can not use PickAny if you have created files with more or less than 16 frames. The game will use 16 frames if they are there or not. If not they appear as black tiles. I don't know if this is a bug or intended behavior. However adding the missing frames solved the problem.

Matt
Posts: 1023
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt » Sat Mar 29, 2014 4:58 pm

You can try if my ingame map editor already solves this https://github.com/OpenRA/OpenRA/pull/4496

eddie
Posts: 47
Joined: Sun Feb 23, 2014 8:42 am

Post by eddie » Sun Mar 30, 2014 8:30 am

The bug is not in the map editor but in the game itself. That may be the reason why the same bug shows up in your map editor just as well. If I try to place tiles that are defined in the YAML file as »PickAny« but have less than 16 frames some of them appear black in your map editor too.

Btw I really don't understand how PickAny works after all. The tiles are not really randomized. The map editor does not create a random number and chooses the corresponding frame. It rather creates a certain pattern that is always repeated. Look at the screenshot with the cliff tiles I posted above. There is the same pattern over and over again but not a random selection.

Post Reply