Warscale 27 - Updated terrains
by Guimo · 11/09/2008 (3:12 pm) · 7 comments
Hi everybody!
This will be my last post for a couple of weeks. AS I commented you my boss is out for two weeks and will leave me alone. I'm strongly considering a 1 week vacation starting right now.
On a personal side, today it has been onye year since I arrived this beautiful country and even when I complain a lot about the weather I kinda like it. The food is great (not as in my country but great) and the wines are wonderful (compared to these, wines in Peru should be ashamed). It has been a hard year but a good one also.
This week was really fantastic in the Warscale side too. I made way more progress than expected.
What was planned
Map editor
I really was afraid of this and I dont really know why. In fact Warscale maps are standar Torque maps but free of any paths or start points. The only point to consider is a point whis is going to be used as the center of the map (thus called WSMapCenter) and the battle will develop around that point.
So I picked a fresh copy of AFX, cleaned all the play GUI, added some Warscale classes and scripts to show the map grid and... all was ready! A quick and easy to use map editor. Of ourse its not finished as I would like to add the ability to create blockmaps (that is areas where creatures cannot walk into), but its not a critical item.
As a test, I created a simple map using the AFX orc village... easy cake...
What wasnt planned
Create at least 3 maps
So, after solving the map editor problem so fast I went and picked a copy of the RTS environment pack. I was tempted to get the one from Apparatus (and I will... later... its just an amazing pack). The other packs were too dark in the textures for the style I wanted so I let them pass. I had some minor problems adapting the RTS Environment pack to the editor but, after cleaning everything, I got 4 working maps, Swamp, Desert, Volcano and Winterland (feel free to suggest other names). I tweaked them a little and imported them to Warscale and that was all... you can witness the new maps in the screenshots.
The nice part with warscale is that the map doesnt need to be overtly complex as the terrain is just small. This allowed me to use those packs with almost no editting.
Add the map selection features to the Game Lobby
Of course I got new maps but then I needed to allow the players to pick them. I added a small control to the game room which requests the server to change the map and inform the other players.
Adjust the battle so it can handle the new map formats
I did this while writing the editor. Fortunately I had already considered this in the design so it was fairly simple to make the game use the map center and compute all the game positions around it.
Update the battle UI
Some elements from the battle UI have been updated and you can notice that in the screenshots. I.E. The bar at the upper portion of the screen. Im still in doubt if I should leave the UI as this or add some additional things. I.E. I was thinking about those dynamic option menues where you click a unit and some circles appear around your character with the different things it can do. May simplify the UI but as somebody told me... if it works... dont fix it.
Some messages in the screen have also been updated to be easier to understand. Also, the game response is faster. When the player sends a command to the server it is executed inmediatly in his client. The server will broadcast the command to the other plaers but wont send it back to the same client. That was a big-big mistake I was doing.
Screenshots
This week its time to show the terrain system. First, this is a shot with the terrain selection in the game room.

The second shot is the terrain while in the game.

This is a second terrain.

The plan for this week (well... at least for any free time I get)
Defile the graveyard
Originally, I was considering to place the undeads in an area behind your avatar and see the undeads as ghosts standing over their graveyards. The idea is cool... the implementation is not.
Unfortunately this has many drawbacks. First, a lot of the terrain must be devoted to the graveyard. Second, if you want to explore the graveyard you must move the camera to focus the graveyard and return. Even whe I have implemented an automatic camera, its just too complex and annoying and breaks the focus on the game. Third, you must render all the dead characters so, as the game progresses, all the game becomes slower. Fourth, the ghosted version of the creatures cannot be easilly distinguished, you only see a white shape and you may recognize the creature but its not a nice way to see it.
All these for a portion of the game that may be important but its just not worth it. Instead I'm planning to implement a window with a list of the creatures. If the mouse moves over a name, the information will be displayed in the lower right portion of the screen. This way you can invoke and close not only your graveyard but also any other graveyard. The implementation may be also used for other spells like those which allows you to see your opponent armies.
Improve the chat. Start reading about Green Ear integration.
So, Green Ear looks like a wonderful platform and I want to use it. Even if I wont really have time for development, maybe I can just start reading the examples and try to figure out an integration plan.
65 days for Warscale alpha version.
Snippet
The last week - bank - (the user) suggested me to implement some functions using C++. It was a nice idea so I did it and I feel glad about that. Thanks bank!
This week snippet is about a simple quicksort function using TorqueScript. Its called qSortOnDistance because I used it for distance the first time but I have used it for a lot of things since. I use it for small sets of about 50 entries and works fine.
[b]
function qSortOnDistance(%units, %dists) {
//If this is the last unit, end the analysis
if(getWordCount(%units) <= 1)
return %units;
%closerUnits = "";
%closerDists = "";
%fartherUnits = "";
%fartherDists = "";
//The first unit will be my control unit (Should use the mid unit)
%cdist = firstWord(%dists);
%cunit = firstWord(%units);
%dists = restWords(%dists);
%units = restWords(%units);
//For each element in the list, any unit with a distance lower than the control unit is sent to closers
//else it is sent to farthers. If at the end all are in closers, the control unit goes to farthers
// but if at the end all the units are in farthers, the control unit goes to closers
while(getWordCount(%units) > 0) {
%dist = firstWord(%dists);
%unit = firstWord(%units);
%dists = restWords(%dists);
%units = restWords(%units);
if(%dist < %cdist) {
%closerUnits = %closerUnits SPC %unit;
%closerDists = %closerDists SPC %dist;
}
else {
%fartherUnits = %fartherUnits SPC %unit;
%fartherDists = %fartherDists SPC %dist;
}
}
%closerUnits = trim(%closerUnits);
%closerDists = trim(%closerDists);
%fartherUnits = trim(%fartherUnits);
%fartherDists = trim(%fartherDists);
if(getWordCount(%closerUnits) == 0) {
return %cunit SPC qSortOnDistance(%fartherUnits, %fartherDists);
}
if(getWordCount(%fartherUnits) == 0) {
return qSortOnDistance(%closerUnits, %closerDists) SPC %cunit;
}
return qSortOnDistance(%closerUnits, %closerDists) SPC qSortOnDistance(%fartherUnits, %fartherDists);
}
[/code]
Usage:
I commonly use it like this:
%units = "1534 2048 1905 3456"; //references to objects
%dists = "34 48 5 56"; //distances of the objects (what you want to sort)
%res = qSortOnDistance(%units, %dists); //sort from lower to higher distance
echo(%res);
>> "1905 1534 2048 3456"; //references to objects, sorted by distance
Any optimization is welcome.
Good luck with your projects!
Guimo
This will be my last post for a couple of weeks. AS I commented you my boss is out for two weeks and will leave me alone. I'm strongly considering a 1 week vacation starting right now.
On a personal side, today it has been onye year since I arrived this beautiful country and even when I complain a lot about the weather I kinda like it. The food is great (not as in my country but great) and the wines are wonderful (compared to these, wines in Peru should be ashamed). It has been a hard year but a good one also.
This week was really fantastic in the Warscale side too. I made way more progress than expected.
What was planned
Map editor
I really was afraid of this and I dont really know why. In fact Warscale maps are standar Torque maps but free of any paths or start points. The only point to consider is a point whis is going to be used as the center of the map (thus called WSMapCenter) and the battle will develop around that point.
So I picked a fresh copy of AFX, cleaned all the play GUI, added some Warscale classes and scripts to show the map grid and... all was ready! A quick and easy to use map editor. Of ourse its not finished as I would like to add the ability to create blockmaps (that is areas where creatures cannot walk into), but its not a critical item.
As a test, I created a simple map using the AFX orc village... easy cake...
What wasnt planned
Create at least 3 maps
So, after solving the map editor problem so fast I went and picked a copy of the RTS environment pack. I was tempted to get the one from Apparatus (and I will... later... its just an amazing pack). The other packs were too dark in the textures for the style I wanted so I let them pass. I had some minor problems adapting the RTS Environment pack to the editor but, after cleaning everything, I got 4 working maps, Swamp, Desert, Volcano and Winterland (feel free to suggest other names). I tweaked them a little and imported them to Warscale and that was all... you can witness the new maps in the screenshots.
The nice part with warscale is that the map doesnt need to be overtly complex as the terrain is just small. This allowed me to use those packs with almost no editting.
Add the map selection features to the Game Lobby
Of course I got new maps but then I needed to allow the players to pick them. I added a small control to the game room which requests the server to change the map and inform the other players.
Adjust the battle so it can handle the new map formats
I did this while writing the editor. Fortunately I had already considered this in the design so it was fairly simple to make the game use the map center and compute all the game positions around it.
Update the battle UI
Some elements from the battle UI have been updated and you can notice that in the screenshots. I.E. The bar at the upper portion of the screen. Im still in doubt if I should leave the UI as this or add some additional things. I.E. I was thinking about those dynamic option menues where you click a unit and some circles appear around your character with the different things it can do. May simplify the UI but as somebody told me... if it works... dont fix it.
Some messages in the screen have also been updated to be easier to understand. Also, the game response is faster. When the player sends a command to the server it is executed inmediatly in his client. The server will broadcast the command to the other plaers but wont send it back to the same client. That was a big-big mistake I was doing.
Screenshots
This week its time to show the terrain system. First, this is a shot with the terrain selection in the game room.
The second shot is the terrain while in the game.
This is a second terrain.
The plan for this week (well... at least for any free time I get)
Defile the graveyard
Originally, I was considering to place the undeads in an area behind your avatar and see the undeads as ghosts standing over their graveyards. The idea is cool... the implementation is not.
Unfortunately this has many drawbacks. First, a lot of the terrain must be devoted to the graveyard. Second, if you want to explore the graveyard you must move the camera to focus the graveyard and return. Even whe I have implemented an automatic camera, its just too complex and annoying and breaks the focus on the game. Third, you must render all the dead characters so, as the game progresses, all the game becomes slower. Fourth, the ghosted version of the creatures cannot be easilly distinguished, you only see a white shape and you may recognize the creature but its not a nice way to see it.
All these for a portion of the game that may be important but its just not worth it. Instead I'm planning to implement a window with a list of the creatures. If the mouse moves over a name, the information will be displayed in the lower right portion of the screen. This way you can invoke and close not only your graveyard but also any other graveyard. The implementation may be also used for other spells like those which allows you to see your opponent armies.
Improve the chat. Start reading about Green Ear integration.
So, Green Ear looks like a wonderful platform and I want to use it. Even if I wont really have time for development, maybe I can just start reading the examples and try to figure out an integration plan.
65 days for Warscale alpha version.
Snippet
The last week - bank - (the user) suggested me to implement some functions using C++. It was a nice idea so I did it and I feel glad about that. Thanks bank!
This week snippet is about a simple quicksort function using TorqueScript. Its called qSortOnDistance because I used it for distance the first time but I have used it for a lot of things since. I use it for small sets of about 50 entries and works fine.
[b]
function qSortOnDistance(%units, %dists) {
//If this is the last unit, end the analysis
if(getWordCount(%units) <= 1)
return %units;
%closerUnits = "";
%closerDists = "";
%fartherUnits = "";
%fartherDists = "";
//The first unit will be my control unit (Should use the mid unit)
%cdist = firstWord(%dists);
%cunit = firstWord(%units);
%dists = restWords(%dists);
%units = restWords(%units);
//For each element in the list, any unit with a distance lower than the control unit is sent to closers
//else it is sent to farthers. If at the end all are in closers, the control unit goes to farthers
// but if at the end all the units are in farthers, the control unit goes to closers
while(getWordCount(%units) > 0) {
%dist = firstWord(%dists);
%unit = firstWord(%units);
%dists = restWords(%dists);
%units = restWords(%units);
if(%dist < %cdist) {
%closerUnits = %closerUnits SPC %unit;
%closerDists = %closerDists SPC %dist;
}
else {
%fartherUnits = %fartherUnits SPC %unit;
%fartherDists = %fartherDists SPC %dist;
}
}
%closerUnits = trim(%closerUnits);
%closerDists = trim(%closerDists);
%fartherUnits = trim(%fartherUnits);
%fartherDists = trim(%fartherDists);
if(getWordCount(%closerUnits) == 0) {
return %cunit SPC qSortOnDistance(%fartherUnits, %fartherDists);
}
if(getWordCount(%fartherUnits) == 0) {
return qSortOnDistance(%closerUnits, %closerDists) SPC %cunit;
}
return qSortOnDistance(%closerUnits, %closerDists) SPC qSortOnDistance(%fartherUnits, %fartherDists);
}
[/code]
Usage:
I commonly use it like this:
%units = "1534 2048 1905 3456"; //references to objects
%dists = "34 48 5 56"; //distances of the objects (what you want to sort)
%res = qSortOnDistance(%units, %dists); //sort from lower to higher distance
echo(%res);
>> "1905 1534 2048 3456"; //references to objects, sorted by distance
Any optimization is welcome.
Good luck with your projects!
Guimo
#2
Hand - Units in the player hand
Play - Units in play
Graveyard - Units in the graveyard
Mana - Mana cost or available mana
Life - Remaining life for the avatar
Creature - A creature unit
Artifact - An artifact unit
Sorcery - A spell or sorcery
Item - A single use object
Equipment - A wearable object
The icons should have three states so that they can be used as buttons. States should be Normal, Highlighted and pressed. No need for disabled state.
If you want to help and get credits in the game just send me a mail. If you want to charge for this job send me a quote also.
Luck!
Guimo
11/09/2008 (3:46 pm)
I would like to ask for help. If somebody would like to help and consider himself/herself able to make quality icons (16x16) for the following concepts.Hand - Units in the player hand
Play - Units in play
Graveyard - Units in the graveyard
Mana - Mana cost or available mana
Life - Remaining life for the avatar
Creature - A creature unit
Artifact - An artifact unit
Sorcery - A spell or sorcery
Item - A single use object
Equipment - A wearable object
The icons should have three states so that they can be used as buttons. States should be Normal, Highlighted and pressed. No need for disabled state.
If you want to help and get credits in the game just send me a mail. If you want to charge for this job send me a quote also.
Luck!
Guimo
#3
11/09/2008 (3:48 pm)
Saludos para Argentina!
#4
Looks good though man, i look forward to trying it out in the near future and sending some models your way here soon to support the fight! As for icons, ill see what i can do and send them to your email.
11/10/2008 (1:54 am)
Im still working on a model for ya Guimo =) sorry its taking so long were packing to come home right now.. 5 more weeks and ill be stateside again w00t! been here for 14 months.Looks good though man, i look forward to trying it out in the near future and sending some models your way here soon to support the fight! As for icons, ill see what i can do and send them to your email.
#5
Looking good BTW. For inspiration for player environments, take a look at Kingdom Elemental. His environments are mostly indoor stuff, but it's still nice to see how other people do things in similar types of gameplay.
11/10/2008 (9:17 am)
For your button states I'd recommend just requesting the raw icon and developing your own state system (be it transparent overlays, a photoshop/gimp plug-in, or a manual process that you perform in your favorite image editor) so that you can accepts art from multiple sources/artists and still have GUI element consistency between buttons.Looking good BTW. For inspiration for player environments, take a look at Kingdom Elemental. His environments are mostly indoor stuff, but it's still nice to see how other people do things in similar types of gameplay.
#6
I'm glad you are safe and sound. I guess you will have a lot of things to do and catch up on your return. Thanks for the help offer!
@Brian
Thats a good idea on the icons... so if anybody wants to create any of the previously mentioned icons only one version is required, I can implement grows and press states for them.
I have never seen Kingdom Elemental. Looks like a nice game. The map idea is good and I would like something like that for Warscale and I think the game is able to handle any map right now but current maps an be used for 2-4 player games. I'd love to have specialized 2 player and single player maps.
Maybe I can enhance the maps in the future. Remember I'm in Alpha right now.
Luck!
Guimo
11/10/2008 (3:58 pm)
@MikeyI'm glad you are safe and sound. I guess you will have a lot of things to do and catch up on your return. Thanks for the help offer!
@Brian
Thats a good idea on the icons... so if anybody wants to create any of the previously mentioned icons only one version is required, I can implement grows and press states for them.
I have never seen Kingdom Elemental. Looks like a nice game. The map idea is good and I would like something like that for Warscale and I think the game is able to handle any map right now but current maps an be used for 2-4 player games. I'd love to have specialized 2 player and single player maps.
Maybe I can enhance the maps in the future. Remember I'm in Alpha right now.
Luck!
Guimo

Torque 3D Owner Novack
CyberianSoftware
... have a good vacation week!