[Weapon] Bat'leth

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

[Weapon] Bat'leth

Post by bennyp » Tue Jun 19, 2012 6:13 pm

Wellp, the last time I picked up a modelling program was over 10 years ago, and even then I didn't go all the way with it. Nonetheless, Turner needs a Bat'leth, and Since no one else has stepped up to the plate just yet, I thought I'd dive in.


Image

I'm pretty stoked. It's tonnes of fun running around slicing rabbits with a klingon blade. I'm not the only one who's excited, heck, it even made it to the front page of slashdot!
just kidding
just kidding
I built the mesh and normal map in Blender, and did the texturing in Photoshop. The grip needs some work, and I could go back in and adjust the shading on the blade's edge but I'm basically satisfied.

You can download the mod from here, just unpack in Data/Custom and let her rip :)
bennyp.zip
Just unpack in Data/Custom/
(1.4 MiB) Downloaded 149 times
Let me know if you have problems or fixes.
Screen Shot 2012-06-22 at 2.24.46 PM.png
Screen Shot 2012-06-22 at 2.21.22 PM.png
Last edited by bennyp on Fri Jun 22, 2012 1:47 pm, edited 1 time in total.

User avatar
Gyrth
Posts: 225
Joined: Sat Sep 10, 2011 12:49 pm

Re: [Weapon] [WIP] Bat'leth

Post by Gyrth » Tue Jun 19, 2012 6:43 pm

I was also thinking of making a bat'leth. Modeling it in Blender turned out more difficult than I thought and I scraped it. Anyway, I can help you with the xml files if want when you're done.

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Tue Jun 19, 2012 7:34 pm

Should I try to stay within a certain polycount? Can I use quadrilateral polys or do i need to convert to triangles? What about texturing? Want to do that when I finish the mesh?

User avatar
Gyrth
Posts: 225
Joined: Sat Sep 10, 2011 12:49 pm

Re: [Weapon] [WIP] Bat'leth

Post by Gyrth » Tue Jun 19, 2012 7:46 pm

I made a model in Blender and then exported the obj file. And then just followed this tutorial.
http://wiki.wolfire.com/index.php/Makin ... 6_Textures

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Wed Jun 20, 2012 12:26 am

with the help of a user named 'traitor' in #blender, I made a new mesh (with no holes in it ;)) and I put together some textures. For some reason, though, the file doesn't appear in the menu when i open the editor.

Here's my item and object xml. most of the actual data here was just copied from Tonjevic's paper airplane, for testing purposes.
Batleth.xml

Code: Select all

<?xml version="1.0" ?>
<item>
    <type>weapon</type>
    <appearance obj_path = "Data/Custom/bennyp/Objects/Batleth.object.xml"/>
    <grip ik_attach = "rightarm"
          anim = "Data/Animations/r_doghammergripsharp.anm"/>
    <physics mass = "1.5 kg"/>
<points>
        <pommel x="0" y="-0.083" z="0"/>
        <guard x="0" y="0.12" z="0"/>
        <tip x="0" y="0.4" z="0"/>
    </points>
    <lines>
        <wood start="pommel" end="guard"/>
        <metal start="guard" end="tip"/>
    </lines>
    <anim_override idle = "Data/Animations/r_knifestancerear.xml"/>
    <attack_override moving = "Data/Attacks/knifeslash.xml"
                     moving_close = "Data/Attacks/knifeslash.xml"
                     stationary = "Data/Attacks/knifeslash.xml"
                     stationary_close = "Data/Attacks/knifeslash.xml"/>
    <range multiply = "0.8"/>
</item>
Objects/Batleth.object.xml

Code: Select all

<?xml version="1.0" ?>
<Object>
	<Model>Data/Custom/bennyp/Models/Batleth.obj</Model>
	<ColorMap>Data/Custom/bennyp/Textures/Batleth.color.tga</ColorMap>
	<NormalMap>Data/Custom/bennyp/Textures/Batleth.normal.png</NormalMap>
	<SharpnessMap>Data/Custom/bennyp/Textures/Batleth.sharpness.png</SharpnessMap>
	<ShaderName>cubemapobjitem</ShaderName>
</Object>

User avatar
Gyrth
Posts: 225
Joined: Sat Sep 10, 2011 12:49 pm

Re: [Weapon] [WIP] Bat'leth

Post by Gyrth » Wed Jun 20, 2012 6:28 am

Looking good. Maybe you could use the basic staff xml as a reverence because you hold it in a similar fashion and the attacks are almost the same. The anim_override idle makes him hold it with 2 hands and also add hands = "2". To make it show up in the item menu you need to edit the custom.xml in Data/UI/spawner/objects/ and add something like this:

Code: Select all

modder = "bennyp";
section="Weapons";
addSection(tab_name,modder);

addCommunityItem(tab_name, "Bat'leth", modder, cf+modder+"/Items/bat'leth.xml", modder+"picture.png");
The points need to be further apart because the weapon is bigger than the airplane. Or else the weapon will not collide correctly with characters.

And also think about making a custom attack xml. That way you can control which animation it shows and how much damage, blood and direction the enemy falls.

Good luck!

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Wed Jun 20, 2012 3:40 pm

Okay, so I got the object to appear in spawner, and I can click on it, and then it appears that I'm placing it in the scene, but there's no bounding box and no model. Is my obj file no good? it uses quadrilateral polys.

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Wed Jun 20, 2012 7:16 pm

PROGRESS!! I loaded the obj in blender and triangulated all the faces, which let OG load it just fine. There are just a few "small" problems...
It's very large.
It's very large.
Seems an odd way to hold a sword.
Seems an odd way to hold a sword.
With my gigantic Bat'leth, I thee slay.
With my gigantic Bat'leth, I thee slay.
Aside from the scale issue, there also appear to be some odd artefacts appearing on some faces, like in the second screenshot there, you can see them like waves of interference across the blade's surface. is that my problem or does it have to do with the way the engine is applying the shader?

User avatar
Gyrth
Posts: 225
Joined: Sat Sep 10, 2011 12:49 pm

Re: [Weapon] [WIP] Bat'leth

Post by Gyrth » Wed Jun 20, 2012 7:33 pm

The "artifacts" are just fading to make a realistic weapon swinging animation. And to re-size and position the weapon I suggest importing a weapon from OG into blender next to the Bet'leth. Then you'll see how big it should be and where.

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Wed Jun 20, 2012 7:59 pm

OK, much better, but the grip is still off.. Is that all fixable through xml? how does the points key work?
Nice
Nice

User avatar
Djemps
Posts: 285
Joined: Thu May 13, 2010 11:11 am
Location: Rochester, NY
Contact:

Re: [Weapon] [WIP] Bat'leth

Post by Djemps » Wed Jun 20, 2012 8:52 pm

There are various hand grip animations in the 'animations' folder. Most two handed weapons like the spear are modeled 'vertically' and use the r_dogweapongrip.anm file. Again, load up the Spear in Blender and compare it next to your Bat'leth. Try to match their orientation and general relation to the 0 axis point. (I'm probably making up some of these terms as I go). Additionally, load up the Spear in the game to get an idea of where the hands are placed. This should help. But tweaking a Weapon-Item's .xml can take a lot of testing.

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Wed Jun 20, 2012 9:18 pm

Jackpot.
Screen Shot 2012-06-20 at 10.15.57 PM.png
Needs plenty of work on the texture and xml but it's basically playable.... and awesome. Will release when the texture is serviceable.

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Thu Jun 21, 2012 1:26 am

Ok the texture is much better, but I can't get the shader to do what I want. Here's the texture:
Texture
Texture
. The alpha channel has the majority of the blade at around 70% black and the edge at about 30%
Looks great in PS, let's go to the video tape:
Too bright
Too bright
See that? way too bright. The cubemap shader jacks up the brightness. I could darken the texture, but that seems overkill. There's also this:
The heck?
The heck?
See them jaggies? what do I do about that? They appear on both sides, but mostly on the bottom side. something to do with the lighting/shader combo.

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: [Weapon] [WIP] Bat'leth

Post by Endoperez » Thu Jun 21, 2012 3:09 am

When calculating shadows, Overgrowth kind of saves them based on the object's UV space. So re-using the same UV space will cause double lighting / double shadows.

It looks like at least your blade uses the same UV space twice. Try moving one of the UV spaces away for now, and see if the shader works better afterwards. If that's the only thing causing problems, fixing the UVs and copying parts of the texture shouldn't take too long.

bennyp
Posts: 142
Joined: Sun Jun 10, 2012 3:13 pm

Re: [Weapon] [WIP] Bat'leth

Post by bennyp » Thu Jun 21, 2012 4:29 pm

I don't want to have to unwrap and retexture all over again. You recommended I move one of the UV spaces away. How do I do that?

Post Reply