0
\$\begingroup\$

I want the player to be able to draw a simple symbol, even if it's pixelated black or white, that their character can have on their weapons, armour, forehead or even markers and monuments. How would I go about that, if I want to do it? Better if the suggestion is C#/Unity-specific.

PS: The game would be a turn-based, square grid RPG, maybe somewhat like Dofus, but it should probably be in 3D to allow for more flexibility.

\$\endgroup\$
5
  • \$\begingroup\$ Wouldn't that simply be an extra texture that gets drawn on top of the other textures in your model? So you would probably have to write your own shader in order to support such an operation, as AFAIK none of Unitys default shaders can do that \$\endgroup\$ Oct 23 '14 at 21:03
  • 2
    \$\begingroup\$ huh none of the default shaders have multi-texturing? Odd omission \$\endgroup\$
    – jhocking
    Oct 23 '14 at 21:26
  • 1
    \$\begingroup\$ There seem to be 2 easily separable questions here: How to let players draw their symbols and how to render those symbols onto equipment. We've already got questions on rendering decals, though it seems this may be more complicated in Unity. \$\endgroup\$
    – Anko
    Oct 24 '14 at 9:15
  • \$\begingroup\$ @jhocking there is the decal shader, however that one only supports vertex lighting and does IMO not look great on character models (also you might want to have at least normal mapping on a character model) \$\endgroup\$ Oct 24 '14 at 9:27
  • \$\begingroup\$ Are you sure you want that? Expect to see a lot of swastikas, obscenity and other stuff you don't want your game to be associated with. \$\endgroup\$
    – Philipp
    Nov 23 '14 at 11:01
1
\$\begingroup\$

You should probably let player use their own tool and allow them to mod/upload an icon for this purpose into the game. Drawing it in game, is a matter of tracking the mouse position and clicks, designing the drawing tools gui and simply adding and removing pixels at position (x, y). It is not complicated but sounds like a waste of time if you could allow them to upload an existing image that was created with a good tool. This depends on the budget of time / hours you have set for you game and how critical the painting of symbols is to your goals.

To place textures on top of existing ones, I would suggest you add a rectangular mesh to the model where you want the symbol to be and add the icon with a transparent background as a texture for that mesh.This should work well for starters and save you the trouble of writing extra code.

\$\endgroup\$
5
  • \$\begingroup\$ There is merit to having an in game tool for drawing decals, although it is in terms of "immersion" and the player not having to buy/download/use an external tool for that. I`m also not a big fan of your suggestion about using extra meshes for the decal (although it does work), as that "wastes" computational power (handling and drawing additional meshes is way more expensive than having an additional texture in a shader) and is not trivial to align if the model underneath is not completely flat (think of an arm for example) \$\endgroup\$ Oct 24 '14 at 9:34
  • \$\begingroup\$ @UnholySheep It is not difficult to align, it is normally a piece of mesh extracted from the model (like with extrude) but copied and pasted instead (from my experience it takes 15 minutes). I think it keeps things simple. I don't think you can back up the "wastes" computational power comment with a benchmark, it's highly negligible in reality. It could behave buggily however if not handled carefully cause the renderer might think its inside the model but that's another matter. Besides I was suggestion it cause someone said you couldn't layer textures on top of each other easily within Unity. \$\endgroup\$
    – AturSams
    Oct 24 '14 at 9:39
  • \$\begingroup\$ @UnholySheep I agree about the comment on ux and immersion but I don't think I want to be drawing things in a game unless it's done extremely well and even then it wouldn't add much to the gameplay experience if anything at all cause what I really want to do is kill things and find treasure. I do understand that doing this (uploads) could break immersion but that's why I would recommend using pre-generated symbols instead. I don't personally think custom symbols play a strong role in enhancing the game. \$\endgroup\$
    – AturSams
    Oct 24 '14 at 9:41
  • \$\begingroup\$ I appreciate both of your comments very much, but I think it would, I mean it'll have several experimental ideas, but in essence appealing to some that do strongly is more important to me than appealing to everyone. It wouldn't be far away from what Minecraft does with skins. A simple symbol for me to paint on the forehead of my mages or inscribe onto pillaged villages or even corpses sounds like a very satisfying deal to me, personally. \$\endgroup\$ Oct 25 '14 at 6:55
  • \$\begingroup\$ THat is fine, opinions are just opinions; like I said, drawing is a matter of tracking mouse events and designing a gui. It is not really something to cover in a question. \$\endgroup\$
    – AturSams
    Oct 25 '14 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.