Sunday, April 29, 2007

Soldier “Spots” in Buildings

Today i worked on the places or “spots” soldiers can be in buildings. When the mouse is moved over a building these places are displayed as small squares. Right clicking on one sends the soldier there. Now putting a soldier in a building is really easy and only requires one right click. I’ve also added code to make the levels above the soldier transparent, so your soldier doesn’t disappear into the building never to be seen again. Check out the new features in the video.



Next i have to test what happens when i send a lot of soldiers into a building. I’ll probably have to put a limit on the number of soldiers that can enter a particular building…

Friday, April 27, 2007

Multi-Story Buildings Part 3!

Yesterday i wrote code to make a certain floor of a building show a yellow bounding box when the player moves the cursor over it. This will make it easy to to send soldiers to a specific floor.

Today i adjusted my old single-story building code to work with multi-story buildings. I had to make a lot of new waypoints for my test building and the “reload object” feature i added earlier came in very handy. Anyways, you can see the result of my work in the video :)

 

Next i have to come up with a good idea how to position the soldiers inside the buildings. I could add a few “spots” , so the player clicks the spot where his soldier should go to. I could also allow the player to move soldiers freely in buildings, but then the soldiers would be in danger of getting stuck. I’ll have to think about this a bit more…

Wednesday, April 25, 2007

Multi-Story Buildings Part 2!

Well I started yesterday by coding the context menu. You can see the result below.



















I was happy with the menu. Then Onryou told me about this really great way to put units into buildings he had seen in Ground Control 2. In GC 2 if you move your cursor over a part of a building, that part highlights and you can see exactly where your soldiers will move to. By holding down the right mouse button and dragging you can also tell your soldiers in which direction to look. I scrapped the context menu idea. Now I’ll do it the GC 2 way.

Moving soldiers up a high building will require a lot of waypoints in the building’s XML file. Editing the XML file and reloading the level to check if the waypoints are at the correct positions is a very tedious task. That’s why i added a new feature to the map editor. It allows you to reload the selected object from its XML file. If the XML file is corrupt an error message is displayed, but the editor doesn’t crash. It simply continues to show the old working object. This functionality isn’t just useful for editing waypoints, it’s also useful for editing and testing stuff like models, textures, relative positions etc.

Below are a few screens of this new feature

This first one shows my building with a working XML file












This one shows what happens if i change a texture name and hit reload












The last one shows what happens if i corrupt the xml file by removing a “

Tuesday, April 24, 2007

Multi-Story Buildings!

Imagine being able to position your sniper at a specific window in an 8 story building. That’s what I’m aiming for. My plan is to make a menu pop up if the player right clicks a building with more than one floor. On the menu the player can quickly select the floor his soldier should go to. The soldier then enters the building at the bottom and actually moves up the stairs of each lever until he reaches his target position. Every building is divided into different floors. If a soldier is on a specific floor then all of the floors above him will be made transparent . To test this I’ve made the house model shown below. Next up is the difficult part, the actual coding…