Warscale - Equipment system (w/screenshot)
by Guimo · 06/17/2008 (9:36 pm) · 5 comments
Hi everybody!
A week passed... too fast...
Even when here in Australia the fathers day is celebrated on September (so I have been told), in Peru (my country) it was the last Sunday. I was hoping to use this special day just for myself, get in my room and start coding. Apparently my wife and son had other ideas. It was a wonderful day.
Anyway, even when I didn't made all the progress I wanted I managed to make a lot of changes.
What was planned
a. Load the models from www.GameContentPacks.com
Ori Cohen from Gamecontentpacks was really helpful with his models. It was really easy to adapt his orc to the game. My first creatures are the orc Warrior and the Orc Berserker! Check the screenshots.
b. Load a models from the MMOWorkshop critters pack
Also, I played around a little with the MMOWorkshop critters pack. I was able to change some texture names and change the names from some animations. Now I have a real Wolf which replaces the orc I was using up now! Nice models. I think I will buy all the other models packs.
c. Equipment system
At first, I was trying to create a complete system with an item editor, but I slowly noticed that maybe it was easier to get all the system integrated to the Creature/Spell/Artifact system so after hacking everything a little, I managed to get everything working together. So now I can edit and create items on the same editor used by all the game. Thats a lot of time saved.
This is nice because now I can create a magic item with special abilities and those abilities will be available to the wearer. So I can have a ring of strength, a ring of blinking, a ring of true seeing, etc.
I was even thinking about creating equipment units you can add to your army like A vorpal Sword unit (5% chance to kill your opponent). So you can cast the sword in any creature that can use a sword and thats all. Obviously, if the creature dies, the sword is also discarded. This may also allow for new kind of spells and other items like a Mace of Disruption, Sunder, Armor Breaking, lots of possibilities.
The problem with equipment is that its really hard to keep track of the equipment you summon. I still cannot imagine how to manage it visually. Maybe with icons on the side of the screen or really small icons on the side of your character or maybe some kind of markers or selectrons. I will leave it for future developemnt but the potential is there. For now, in the screenshot you can see an orc with a sword and an orc with an axe and a shield.
Special power menu
I enabled the special powers button. When a unit has mana and/or a special power, then the powers button is activated. In this second menu the powers that can be used are enabled. The remaining part is to allow to use the power.
What wasnt planned
Camera setup for the model info
When I changed the resources in order to use the new models, these just wont play nice with the GuiObjectViewer. I had to expose some attributes from the GUIObjectView camera in order to allow me to set a specific camera position for each model. Also I had to add more attributes to the models so now I can set an appropiate position for the camera to view the model. Its easy so use and looks nice.
Enhanced mount system
In order to make my life easier in mounting the equipment, I implemented this resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10304
Compiled at first attempt and worked fine. Had to implement some of the suggestions.
Equipment setup
As the models in the different packs may have some different naming conventions, I was required to define a mountpoint system so that each item knows where to get mounted. It worked as a charm
What wasnt solved
I wanted the units loaded in the GUIObjectView to show their root animation. So I loaded the animation using loadDSQ/setSequence and the models showed up nice! The problem is that after that, when I cleared the GuiObjectView control, the animation info was also cleared FROM ALL THE SYSTEM (or at least it looks like that). So I got many errors, orcs floating sideways, engine shutdown and more. I have disabled this right now but will try again later. Really looks better with the animated unit there.
Also, it looks like the GUIObjectView can only hold a single object and I really need to have more objects. I would like to use the GUIObjectView to setup a complete scene like the background scenes in Warcraft. This requires to load many objects with animations. I hope I can fix his.
Screenshot!
This screenshot shows the avatar which has summoned some creatures and some other creatures behind him. You can recognize the orc with a sword, an orc with an axe and a shield and the wolf.

The plan for this week
This week plan includes tuning the animations, fix some problems with the unit info view and make the berserker power work.
a.Weapon positions
If you notice, the weapons are out of the hands of the orcs. This is due to a problem with the said resource but nothing that a small tweaking cannot fix.
b. Animation setup
The problem is that some units may have a different number of animations. I.E. The wolf only has one animation but the orcs have about 10 death animations. I need to know how many animations are there on each one and which ones I can use in each situation and Warscale requires to know which animation to play in each situation.
I have to store the unit animations names somewhere. I think the unit datablock is the best place to do it. After that, I have to adjust the scripts so they can recognize and use this information.
c. Update the unit info
I want to mount the equipment in the unit info so that the unit in the mini view has all the equipment the unit has mounted. Also the unit information may require some work to display the bonuses gained from the items.
d. Make the Berserk power work
With a nicely setup unit comes new responsibilities. The berserk power should work and should show up. This may require to setup some kind of selectron in the unit to show that the power is activated. This will also force me to tune the spell target selection system.
e. Load the goblin shaman
This is another unit from the GamePack. The goblin shaman is a fairly interesting unit because it will allow to throw a small magic missile to a target in a range. I dont think this will be finished this week but at least will be included in the army and will show up.
Luck with your projects!
Guimo
EDIT: Forgot to post a little change in the engine that may help you a lot. When you mount an object to another, the GuiObjectView searched for the mounted object mountPoint node but only recognizes the translation and not the rotation. In order to fix this find this function:
void GuiObjectView::getObjectTransform( MatrixF *mat , S32 index)
Some lines down you will find these two lines:
parentTrans.mulP( subOffset );
parentTrans.setPosition( subOffset );
Add the following line between those two:
parentTrans.mulP( subOffset );
+ parentTrans.mul( subTrans );
parentTrans.setPosition( subOffset );
Thats all!
A week passed... too fast...
Even when here in Australia the fathers day is celebrated on September (so I have been told), in Peru (my country) it was the last Sunday. I was hoping to use this special day just for myself, get in my room and start coding. Apparently my wife and son had other ideas. It was a wonderful day.
Anyway, even when I didn't made all the progress I wanted I managed to make a lot of changes.
What was planned
a. Load the models from www.GameContentPacks.com
Ori Cohen from Gamecontentpacks was really helpful with his models. It was really easy to adapt his orc to the game. My first creatures are the orc Warrior and the Orc Berserker! Check the screenshots.
b. Load a models from the MMOWorkshop critters pack
Also, I played around a little with the MMOWorkshop critters pack. I was able to change some texture names and change the names from some animations. Now I have a real Wolf which replaces the orc I was using up now! Nice models. I think I will buy all the other models packs.
c. Equipment system
At first, I was trying to create a complete system with an item editor, but I slowly noticed that maybe it was easier to get all the system integrated to the Creature/Spell/Artifact system so after hacking everything a little, I managed to get everything working together. So now I can edit and create items on the same editor used by all the game. Thats a lot of time saved.
This is nice because now I can create a magic item with special abilities and those abilities will be available to the wearer. So I can have a ring of strength, a ring of blinking, a ring of true seeing, etc.
I was even thinking about creating equipment units you can add to your army like A vorpal Sword unit (5% chance to kill your opponent). So you can cast the sword in any creature that can use a sword and thats all. Obviously, if the creature dies, the sword is also discarded. This may also allow for new kind of spells and other items like a Mace of Disruption, Sunder, Armor Breaking, lots of possibilities.
The problem with equipment is that its really hard to keep track of the equipment you summon. I still cannot imagine how to manage it visually. Maybe with icons on the side of the screen or really small icons on the side of your character or maybe some kind of markers or selectrons. I will leave it for future developemnt but the potential is there. For now, in the screenshot you can see an orc with a sword and an orc with an axe and a shield.
Special power menu
I enabled the special powers button. When a unit has mana and/or a special power, then the powers button is activated. In this second menu the powers that can be used are enabled. The remaining part is to allow to use the power.
What wasnt planned
Camera setup for the model info
When I changed the resources in order to use the new models, these just wont play nice with the GuiObjectViewer. I had to expose some attributes from the GUIObjectView camera in order to allow me to set a specific camera position for each model. Also I had to add more attributes to the models so now I can set an appropiate position for the camera to view the model. Its easy so use and looks nice.
Enhanced mount system
In order to make my life easier in mounting the equipment, I implemented this resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10304
Compiled at first attempt and worked fine. Had to implement some of the suggestions.
Equipment setup
As the models in the different packs may have some different naming conventions, I was required to define a mountpoint system so that each item knows where to get mounted. It worked as a charm
What wasnt solved
I wanted the units loaded in the GUIObjectView to show their root animation. So I loaded the animation using loadDSQ/setSequence and the models showed up nice! The problem is that after that, when I cleared the GuiObjectView control, the animation info was also cleared FROM ALL THE SYSTEM (or at least it looks like that). So I got many errors, orcs floating sideways, engine shutdown and more. I have disabled this right now but will try again later. Really looks better with the animated unit there.
Also, it looks like the GUIObjectView can only hold a single object and I really need to have more objects. I would like to use the GUIObjectView to setup a complete scene like the background scenes in Warcraft. This requires to load many objects with animations. I hope I can fix his.
Screenshot!
This screenshot shows the avatar which has summoned some creatures and some other creatures behind him. You can recognize the orc with a sword, an orc with an axe and a shield and the wolf.
The plan for this week
This week plan includes tuning the animations, fix some problems with the unit info view and make the berserker power work.
a.Weapon positions
If you notice, the weapons are out of the hands of the orcs. This is due to a problem with the said resource but nothing that a small tweaking cannot fix.
b. Animation setup
The problem is that some units may have a different number of animations. I.E. The wolf only has one animation but the orcs have about 10 death animations. I need to know how many animations are there on each one and which ones I can use in each situation and Warscale requires to know which animation to play in each situation.
I have to store the unit animations names somewhere. I think the unit datablock is the best place to do it. After that, I have to adjust the scripts so they can recognize and use this information.
c. Update the unit info
I want to mount the equipment in the unit info so that the unit in the mini view has all the equipment the unit has mounted. Also the unit information may require some work to display the bonuses gained from the items.
d. Make the Berserk power work
With a nicely setup unit comes new responsibilities. The berserk power should work and should show up. This may require to setup some kind of selectron in the unit to show that the power is activated. This will also force me to tune the spell target selection system.
e. Load the goblin shaman
This is another unit from the GamePack. The goblin shaman is a fairly interesting unit because it will allow to throw a small magic missile to a target in a range. I dont think this will be finished this week but at least will be included in the army and will show up.
Luck with your projects!
Guimo
EDIT: Forgot to post a little change in the engine that may help you a lot. When you mount an object to another, the GuiObjectView searched for the mounted object mountPoint node but only recognizes the translation and not the rotation. In order to fix this find this function:
void GuiObjectView::getObjectTransform( MatrixF *mat , S32 index)
Some lines down you will find these two lines:
parentTrans.mulP( subOffset );
parentTrans.setPosition( subOffset );
Add the following line between those two:
parentTrans.mulP( subOffset );
+ parentTrans.mul( subTrans );
parentTrans.setPosition( subOffset );
Thats all!
#2
Dont worry, next week you will see your shaman in action.
Luck!
Guimo
06/17/2008 (9:50 pm)
Then you should wait for future units. The orc berserker is a 2nd level unit. In the future more units will be added with better stats and better weapons.Dont worry, next week you will see your shaman in action.
Luck!
Guimo
#3
06/17/2008 (10:03 pm)
just remember in 4th edition DnD, magic missile no longer auto hits
#4
06/17/2008 (10:33 pm)
Thanks for the comment Edward. Thats something that I will fix inmediatly in my books with some liquid paper and a fine ball pen... as soon as they arrive...
#5
06/17/2008 (10:36 pm)
This is turning out sweet! 
Torque Owner Ori Cohen
Ori Cohen
i would love to see my orc mounted with all of his equipment, belt, necklace, skirt armor, helmet, backpack, etc.