spell/skill icon grid layer?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

spell/skill icon grid layer?

Post by akroma222 »

Hey folks,
Does anyone have a gfx atlas layer that fits for the skill (750x900 pix, 10x12 icons) and spell icons (256 x 256 pix, 5x5 icons)

Similar to the 1024x1024 gfx atlas black/white grid layer for the normal item icons

Akroma
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: spell/skill icon grid layer?

Post by Drakkan »

akroma222 wrote:Hey folks,
Does anyone have a gfx atlas layer that fits for the skill (750x900 pix, 10x12 icons) and spell icons (256 x 256 pix, 5x5 icons)

Similar to the 1024x1024 gfx atlas black/white grid layer for the normal item icons

Akroma
I am almost 100% sure that this atlas for default icons (spells / skills) is available in downlooable asset pack (textures / gui)
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: spell/skill icon grid layer?

Post by akroma222 »

I searched again but I could not find them?? :roll:
Anyways, I made a couple of grids (one for the skills- gfx atlas 750 x 900 and another for spells- gfx atlas 256 x 256)
http://ge.tt/6VdK2L32
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: spell/skill icon grid layer?

Post by Drakkan »

akroma222 wrote:I searched again but I could not find them?? :roll:
Anyways, I made a couple of grids (one for the skills- gfx atlas 750 x 900 and another for spells- gfx atlas 256 x 256)
http://ge.tt/6VdK2L32
if you download last asset pack, it is in mod_assets/textures/gui
spell icon 256x256 grid is spell_icons.dds file, for items are three spearate files.
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: spell/skill icon grid layer?

Post by akroma222 »

Link still seems to be broken :( :(
All good, Im in no rush, thanks fellas :D

EDIT: I missed #100 something for the skills atlas. Fixed now
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: spell/skill icon grid layer?

Post by bongobeat »

please can someone enlighten me about making an icon grid for spells?

does the icons have a certain size (minimum or ...)?
I've looked in the asset pack, the textures used is a 256x256, so how do you make the grid?

(I tried with the gfxatlas toolkit, the same way I use to make icons grid for items, after that method, there is no icons that correspond to the spell)
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: spell/skill icon grid layer?

Post by zimberzimber »

bongobeat wrote:please can someone enlighten me about making an icon grid for spells?

does the icons have a certain size (minimum or ...)?
I've looked in the asset pack, the textures used is a 256x256, so how do you make the grid?

(I tried with the gfxatlas toolkit, the same way I use to make icons grid for items, after that method, there is no icons that correspond to the spell)
Each atlas is a simple image with the icons placed next to each other. You don't create a grid, you just create an image, and the game reads it as a grid and adds whats located in certain places to what you assigned it to.

Now, lets take this image as an example:
Image

If we are to convert it to .DDS, place it inside the mod folder, and tell the spell to use it as an atlas, the game will automatically spread it into a grid, and give each cell an index. If we are to visualize this, it will look something like this:
Image

You tell the game which icon should be used through 'spellIcon', where you chose a cell, and the game uses whatever is in that cell as an icon for the spell you defined. Cells are numbered left-to-right, top-to-bottom. If you are to write " spellIcon = 1, " then the top left corner cell will be used as the icon.

The image itself is 256x256, but the game only reads 250x250 of it. I do not know if you need those extra 6 pixels on each side for technical reason or not, but I'll assume its required. (Otherwise it wouldn't have been there, right?)

You can use this as a template, where each checkered part is a 50x50 cell. (The red part is the unused part)
Image

you should know that items/traits, spells, and conditions use different dimensions (sizes) for their atlases and cells.
Cell sizes - Items/Traits 75x75 | Spells 50x50 | Conditions 32x32
Atlas size for Items is (probably) up to 1024x1024, can't say for sure about traits, spells, and conditions. I do know that condition atlases read only the first 4 cells (first 128 pixels from the left side) horizontally, and the 5th cell is under the 1st one. I assume this applies to everything, but at a different cell interval. (13 for items, 10 for traits, 5 for spells, and 4 for conditions)

About GFXAtlas Toolkit - It only works properly with items because of what I explained earlier.
My asset pack [v1.10]
Features a bit of everything! :D
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: spell/skill icon grid layer?

Post by minmay »

zimberzimber wrote:The image itself is 256x256, but the game only reads 250x250 of it. I do not know if you need those extra 6 pixels on each side for technical reason or not, but I'll assume its required. (Otherwise it wouldn't have been there, right?)
I've seen a lot of confusion about this. It's actually pretty simple, but not as simple as "all images should have dimensions that are powers of 2"; that is wrong.

If the image is only used in 2D contexts - item icons, drawing from all GraphicsContext functions, showing with GameMode.showImage(), MapGraphicsComponent images, etc. then there is no real reason to restrict yourself to powers of 2; use whatever size is appropriate for the image's contents. Most of the GUI images in the standard assets do not have power-of-2 dimensions.
If, on the other hand, the image is used as a texture in the 3D world (on a material or as a particle) then there are reasons to keep its dimensions powers of 2:
- old graphics cards (and some crappy new ones) can only draw these textures without mipmaps or wrapping. No problem for GUI images, big problem for materials. REALLY old/bad GPUs can't draw non-power-of-2 textures at all, but I doubt any GPU that old/bad can run Grimrock at all.
- even modern graphics cards just "pad" non-power-of-2 textures to power-of-2 dimensions when they receive them; a 513x754 texture is just going to be stored in memory as a 1024x1024 texture. So you don't actually save any video memory, and performance may be worse (it will certainly not be better).
- your mipmaps won't look as good, because your image's size can't be repeatedly halved.

Incidentally, this means the answer to "Is there any compelling reason to make this image's dimensions powers of 2?" is the same as the answer to "Does this image need mipmaps?"

The item icon atlases in the standard assets have power-of-2 dimensions but I am pretty sure this isn't actually necessary or even useful since they are only used in the 2D GUI.

Also, in the context of Grimrock, even 3D textures don't need to be square. A 256x32 or 16x1024 texture is fine.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: spell/skill icon grid layer?

Post by zimberzimber »

minmay wrote:-snip-
But power-of-2 boxes are the most satisfying, even when they're filled with all that empty useless nothingness 8-)
Jokes aside, is there a limit to how many cells Grimrock will read vertically? Kinda like when it skips a line after a few cells based on whats the atlas used for. (Whats the biggest image file you can use for, say, items)
My asset pack [v1.10]
Features a bit of everything! :D
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: spell/skill icon grid layer?

Post by Isaac »

As for the grid... the proper centering of your icons, just set the grid in your image editor to match the size of the icons [starting at the top left], then place your art snapped & centered on the grid cells.

**BTW, I must say that Paint.Net (for all its utility, and goto DDS export ability)... has the most useless [niche] grid feature that I have ever encountered. :?
Post Reply