Maximum images/core

Started by Clean0nion, January 30, 2014, 01:02:53 PM

Previous topic - Next topic

Clean0nion

Am I correct in saying that a core can hold a maximum of 8 images? I'm looking to have 135 images on a core.

knucracker

Where do you get 8 from?  Did I write that down somewhere and forget about it?  I don't remember there being any limit other than practicality and performance.

Lost in Nowhere

I remember reading that somewhere on the wiki, and assumed that it was quite outdated along with the majority of the page at that time. Going and looking for it, I can't find it now...
Don't die! :)

Clean0nion

Quote from: virgilw on January 30, 2014, 07:16:32 PM
Where do you get 8 from?  Did I write that down somewhere and forget about it?  I don't remember there being any limit other than practicality and performance.
Ah, that's a relief. If I find that it can't hold as much as I want I'll stick a post about it here. Or in Support, depending on whether G scolds me again  ;D

MagmaMcFry

135 images? You could always make those images individual cores.

Clean0nion

#5
So, after a successful code-making session, I now have a core with 10,000 images attached.
The only performance decrease I have noticed is in saving from the worldeditor - which freezes the game for about ten seconds before finally saving. I will need to A) Lower the amount of images on the core and B) Make sure it doesn't freeze when saving on a normal playthrough.


Quote from: MagmaMcFry on February 01, 2014, 01:00:16 PM
135 images? You could always make those images individual cores.
No. 135 moving cores is a tad too much - let alone 10,000.

EDIT: I lie - it was actually 90,000. I've now lowered this to 400.

EDIT EDIT: 400 images only subtracts a few seconds from the previous lag.

knucracker

What it the world are you trying to do? :)

Thousands of attached images means thousands of attached quads of geometry.  The serialization alone will make the save game rather large and time consuming to generate and parse.

Clean0nion

#7
Quote from: virgilw on February 01, 2014, 01:37:28 PM
What it the world are you trying to do? :)

Thousands of attached images means thousands of attached quads of geometry.  The serialization alone will make the save game rather large and time consuming to generate and parse.
I'll PM you with a link to the project and the .cw3. Everyone else can download it from CS in a few days/weeks/months.

knucracker

Ok, if you are trying to create a giant image made up of tiles then a few notes.

1:  In the next build I have set a limit of 1024 custom images per tower.  When I try to load the map you sent, it never completes (never being defined as the 5 minutes I waited).  So I now make SetImage fail after 1024 images have been attached. 

2: If you want to cover a map completely in images, you don't need as many as you have been talking about.  You can have a 256x256 custom image.  If you take a 4k display it is 3840 pixels wide.  That's 15 custom images wide (3840/256).  Lets just assume a square display for simplicity.  So you need 225 custom image tiles to cover the screen.  Since you can zoom out of a map so things are half scale, you need 4 times that number to completely cover a giant display zoomed all the way out.... assuming you want these images to zoom out.  So you need 900 custom images, or only 255 if they don't scale with the zoom.  This assumes you care about pixel fidelity at these dimensions.  Note that the current void background image isn't anywhere near this large.  It's a 2048x2048 image if memory serves and gets scaled to fill the window.

3: If you want to create tiled images that mesh against each other, you should use the "pp" images.  "pp" stands for pixel perfect and it means that the textures that the image comes from does not have any antialiasing applied.  If you don't use Custom0_256pp the edges of you custom images will be fuzzy.  So if you are tiling images, use the "pp" versions.  Note also that you need to set the scale appropriately to maintain pixel perfect output.  A tower displays its image so that it covers 3 games cells, or 24 pixels.  That means a scale of "1" on a custom image produces an output image that is 24x24 pixels big (at default zoom).  For a 256x256 image you need a scale of 256/24 or 10.667 to maintain pixel perfect output.  So set the scale of your images to 10.667 and a 256x256pp image will come out pixel perfect... and that is what you want when you are tiling images.  One more thing, the tile image you are using in the project you sent me doesn't tile perfectly.  The top edge has raised brightness that looks like a light gray line when tiling the images.  This is because when you cropped in photoshop (or whatever you used), your had an antialias edge setting enabled.  How do I know this?  Well there is the very undocumented feature of the editor where you can press "i" when in edit mode (on the terrain menu) and all embedded images will get written out to an "extractedimages" subdirectory in the project dir.

4: Creating even a thousand custom images isn't really something I intended in the game.  It's at the very edge... and will make the save game files larger and longer to create and read.  You should evaluate if the effect you are trying to achieve is worth the costs for you and the player.  If you are trying to make what appears to be an infinitely large world, then remember the the player will still want to know where the edges of the world are since everything outside the actual map is no-man's land.


Clean0nion

Quote from: virgilw on February 01, 2014, 02:48:03 PM
Ok, if you are trying to create a giant image made up of tiles then a few notes.

1:  In the next build I have set a limit of 1024 custom images per tower.  When I try to load the map you sent, it never completes (never being defined as the 5 minutes I waited).  So I now make SetImage fail after 1024 images have been attached. 

2: If you want to cover a map completely in images, you don't need as many as you have been talking about.  You can have a 256x256 custom image.  If you take a 4k display it is 3840 pixels wide.  That's 15 custom images wide (3840/256).  Lets just assume a square display for simplicity.  So you need 225 custom image tiles to cover the screen.  Since you can zoom out of a map so things are half scale, you need 4 times that number to completely cover a giant display zoomed all the way out.... assuming you want these images to zoom out.  So you need 900 custom images, or only 255 if they don't scale with the zoom.  This assumes you care about pixel fidelity at these dimensions.  Note that the current void background image isn't anywhere near this large.  It's a 2048x2048 image if memory serves and gets scaled to fill the window.

3: If you want to create tiled images that mesh against each other, you should use the "pp" images.  "pp" stands for pixel perfect and it means that the textures that the image comes from does not have any antialiasing applied.  If you don't use Custom0_256pp the edges of you custom images will be fuzzy.  So if you are tiling images, use the "pp" versions.  Note also that you need to set the scale appropriately to maintain pixel perfect output.  A tower displays its image so that it covers 3 games cells, or 24 pixels.  That means a scale of "1" on a custom image produces an output image that is 24x24 pixels big (at default zoom).  For a 256x256 image you need a scale of 256/24 or 10.667 to maintain pixel perfect output.  So set the scale of your images to 10.667 and a 256x256pp image will come out pixel perfect... and that is what you want when you are tiling images.  One more thing, the tile image you are using in the project you sent me doesn't tile perfectly.  The top edge has raised brightness that looks like a light gray line when tiling the images.  This is because when you cropped in photoshop (or whatever you used), your had an antialias edge setting enabled.  How do I know this?  Well there is the very undocumented feature of the editor where you can press "i" when in edit mode (on the terrain menu) and all embedded images will get written out to an "extractedimages" subdirectory in the project dir.

4: Creating even a thousand custom images isn't really something I intended in the game.  It's at the very edge... and will make the save game files larger and longer to create and read.  You should evaluate if the effect you are trying to achieve is worth the costs for you and the player.  If you are trying to make what appears to be an infinitely large world, then remember the the player will still want to know where the edges of the world are since everything outside the actual map is no-man's land.


Thank you very much for this wealth of information. I have discovered that the .cw3 in question was broken to some extent (I'm still not sure why) so I have recovered all scripts and the opening conversation and imported them to a new map which fits monitors better and is easier to see. Kind of like the bombings of Berlin in WW2 - the damage was so much that they had to rebuild, and they rebuilt it better.
Thank you again. 10.667, 30x30. Thanks!