UFO:Alien Invasion

Technical support => Feature Requests => Topic started by: XCOM1 on October 05, 2006, 12:01:39 am

Title: Destructable Terrain?
Post by: XCOM1 on October 05, 2006, 12:01:39 am
Are you guys planning on adding code for destructable terrain?  I saw an alien behind a fence on one of my first missions and launched a rocket at it thinking "bye, bye little alien!" and lo and behold the fence didn't even shed a splinter much less get partly destroyed.  One of the things that I liked about the original Xcom was that you could blow away a wall to get somewhere fast or to kill an alien.  Is this going to be a future feature?  If not, I think that it is pretty week that a rocket can't even destroy a wooden fence.
Title: Re: Destructable Terrain?
Post by: HaJo on October 05, 2006, 03:14:06 am
Quote from: "XCOM1"
Are you guys planning on adding code for destructable terrain?

The engine does not support fully destructable terrain.

There are plans to add some destructable items (furniture, barrels...),
but even that will be a lot of work (models, particle-effects etc.)
Title: Destructable Terrain?
Post by: XCOM1 on October 05, 2006, 05:19:51 pm
OK.  I see.  Well I would try to help you guys out on that but I don't see it happening as I am an idiot when it comes to coding.  If you really think about it though, it could be a benefit to my team if they are able to hide behind a fence and not get shot.  :P
Title: Destructable Terrain?
Post by: jhcook1999 on October 05, 2006, 09:28:01 pm
This limitation does seem to block the ability to create random maps, after all if you create a random map, and your soldiers can't get out of the dropship area, then they're sitting ducks and all of the civilians if any are dead.

Are we supposed to be able to see aliens through the wooden fences? I'm pretty sure that they can't see me, so that kinda makes it unfair.

Which part of the code is the limitation in?
Title: Destructable Terrain?
Post by: Mephisto on October 08, 2006, 12:17:46 pm
well, there weren't any particle-effects in the original x-com either. The item which was e.g. hit by a rocket was just completely removed from the map. This shouldn't be that hard to code (as it should be already done in the mapping-tools). If you don't know how to dynamically remove these parts just write a temporary map file and reload from there until you figure it out (but pause the game while doing so).
Title: Destructable Terrain?
Post by: Sacrusha on October 10, 2006, 11:28:17 am
It is a limitation given by the algorithms used by the graphics engine. There is no workaround except for changing the algorithms ie replacing the engine and make everything fit the new engine (more work than it's worth). This is not because of only a few algorithms, which can be exchanged, but because of the major concept behind the engine.
Title: Destructable Terrain?
Post by: Sacrusha on October 10, 2006, 11:33:35 am
Quote from: "jhcook1999"
This limitation does seem to block the ability to create random maps, after all if you create a random map, and your soldiers can't get out of the dropship area, then they're sitting ducks and all of the civilians if any are dead.
The random maps are assembled by rather big premade parts. Also, the parts determine to what other parts they can fit on either side (or their creator does) so what you described will not happen.
Title: important aspect
Post by: kaeau on October 11, 2006, 07:27:21 pm
just as opinion, while reading to the forum, i think it is one of the MAJOR good aspects of UFO enemy unknown, that you can blast your way trough almost everything, and in addition, have impressive and also useful mass destruction effects.

isnt it possible (from a none coder point of view) to add structures in a way, e.g. exploding barrels are made in quake?

cheers
ka
www.ninc.at
Title: Destructable Terrain?
Post by: sirg on October 16, 2006, 08:16:45 pm
Undestructible terrain... :( It's a bummer to read that wooden fences will be hard as steel or those japonese houses or african huts won't burn to the ground aided by some incendiary ammo  :)

However, you might compensate, at least a bit, by having aliens and humans die in spectacular ways... I want to see an alien blow up when I give him a grenade!
Title: Destructable Terrain?
Post by: Reenen on October 20, 2006, 04:25:18 pm
I used to create maps for quake1 and quake2... And q2 supported breaking stuff.

However, it was mostly on windows etc.  And the main problem came in with the "lighting" of the maps that used windows that could break.  (A wall made from breakable material didn't make shadows)

The VIS algorithm or something didn't actually consider breakable parts as "walls".  And if you used a breakable part to try to mend a "leak" it wouldn't work because of that.


An easy solution... but it will have a serious impact on the eye-candy of the game, is to replace all the "solid" walls with "glass" in the maps.  These glass just need rediculously high resistance, so they don't just break for nothing.

Each breakable part has a "health" assigned to it, and this should just be high (20,000 for brick walls, 7,500 for wooden walls, and probably 150,000 for steel stuff).

(This is assuming a typical pistol does about 150 damage)

Penetration of walls should be done differently though.
Title: Destructable Terrain?
Post by: Reenen on October 20, 2006, 04:26:25 pm
Oh, and I forgot to mention that high poly counts on these absolutely kills the (then) 3d cards.
Title: Destructable Terrain?
Post by: Gomeril on October 28, 2006, 06:04:55 pm
As a non-coder I cannot provide a solution but I would strongly prefer destructable terrain to eye candy.
Title: Destructable Terrain?
Post by: Silencer on November 04, 2006, 12:20:36 pm
A better example of destructable terrain in 3D games can be found in the PC version of Red Faction, where almost anything can be blasted (heck more than a few of the maps make use of the feature to mess up your day (or if you're a smart alec like me at times use to avoid a few ambushes).
And the excuse of high polycount is actually something that needs to be addressed, if the polycount is really that high then you need to have a look at where it's not necessary to have such a high polycount.
ie Halflife ran into engine limitations with polycounts and thus the design teams needed to scrimp and save to get around the limitations at times, ie cutting down on polygons on enemy models that were going to be seen a lot, cutting down on the weapon model detail, etc.
And I personally don't care much about destructable terrain unless it's going to add an additional level of detail into the tactics you can use in game, ie hiding in a shell crater, but things like shooting through/destroying walls is something that definitely feels wrong not to have at times, especially to me at leas with at present splash damage not seeming to work at all beyond an obstacle I can understand the difficulty of coding so the damage doesn't obliterate it's full extent beyond the wall, but lesser damage based off the blast radius would be nice. Instead of wasting a rocket on a wall due to a near miss and being mooned by the still living alien.
Title: Destructable Terrain?
Post by: Reenen on November 06, 2006, 12:32:55 pm
Red Faction used a very different engine than quake 2 slightly modified.

Quake 2 engine is more than 7 years old (I think) so destructable terrain wasn't quite possible then.

UFO AI runs a "heavily modified quake 2 engine" (loosely quoted from somewhere...)
Title: Destructable Terrain?
Post by: Silencer on November 08, 2006, 12:53:00 pm
I'm not denying it, it was more the point it's not an impossibility as suggested by one of the posts without a total restart.
Part of the VIS issue with Q2 was the fact it wasn't designed to have the dynamics for the partial transparency to begin with as I recall, nor was the issue with breakable walls considered such a big issue since largely they were in places where the lighting issues weren't noticable. I can't remember if Valve used the Q or Q2 engine for HL in the end with their modifications to the engine, or if they fixed that problem either.
And as much as I might like to offer assistance, I've got real world worries that take precedence to picking up on 3D programming of any description again, the 15,000 KM is a vast understatement of the current distance between my GF and myself, and I really want to resolve that ASAP before considering doing anything that'd require 20-30 hours per week to make any headway, I've even had to put aside my writing to search harder for a job.
Title: Destructable Terrain?
Post by: Reenen on November 08, 2006, 01:20:20 pm
Good luck on your GF, all of the best.

I don't think blastable terrain is really supported in even the Q3 engine; so I think if we want to implement this, we'll have to think carefully and hard before just jumping in.  

Lets say maybe when the game has gone "final", and it'd be like UFO:AI 2.
Title: Destructable Terrain?
Post by: Reenen on November 10, 2006, 08:01:12 am
I don't know who does the maps... but doesn't matter how it gets implemented - the maps will have to be created with enough care and consideration for destructable "squares".

What I mean is... if you create a long wall it should not be created like this:

[**************************]

but rather like this
[**][**][**][**][**][**][**][**]


So that when you hit the wall you don't have to "delete" the whole
[**************************]

but just "delete" the specific
[**]

that was hit.


Problem is that I am not too familiar with the engine's workings, and C / C++ is not my main language.

I should probably download the code and have a look... But no matter how, you'll have to make "destructable" walls into an entity, and creating maps will be tricky.
Title: Destructable Terrain?
Post by: Mattn on November 10, 2006, 09:24:40 am
that doesn't depend on the map creator - but the compile tools.

to split everything into such small pieces is not very good, you would increase the polycount a lot - thus you would need a very good computer to handle maps with r_speeds higher than our current ones
Title: Destructable Terrain?
Post by: Reenen on November 10, 2006, 10:03:18 am
Yes, I know it sucks... but it's the only solution that's viable in my mind with q2 engine restrictions.
Title: Destructable Terrain?
Post by: pete.lindsey@hotmail.com on November 22, 2006, 05:08:44 pm
Hey guys I am very new to this scene <2 days... but I am a super freakish fan of the X-com series.  Destructible terrain's role should really be reconsidered-  It can add SOOOO much to the tactics of a map, I do understand that the implications of earlier decisions make it nearly impossible to solve but I really believe that it is one of the key elements missing...

if anyone could suggest the proper reading I might be able to come up with a decent solution... (where to find quake 2 engine documentation)
Title: Destructable Terrain?
Post by: papabob on November 22, 2006, 08:40:40 pm
I don't care much about destructable things atm, but as this thread gets longer I have some ideas too :)

Lets asume that the only destructable items will be human walls. It isn't a big concern, as if you shoot a rock, it hardly becomes destroyed (actual RPG and rocketlaunchers doesn't really breaks big natural rocks anyway). This allows the coders to only have to pay atention at walls (straight lines between point A and point B), forgeting rocks, trees and terrain that would be very difficult to code.

Now we put the "hardness" of the wall in the texture applied: it would be easier to asing an integer to the texture file (jpg or whatever, most of the formats used allow comments) than replace each map.

When the wall have to be destroyed (damage higher than "hardness" in the impact point), the wall splits in two, from A to impact point to B, and the height of that square can be lowered to the height of the floor in that level (eyecandy as rounding the borders can be applied later). Each destruction only adds few polygons as the human walls are basically boxes and rectangles.

To bring the processor time to compute the new map, we can add some easy visual effects (shake the camera, add some animation of smoke...).

Just my thoughts, and I really think that a consistent storyline is more important at this moment  :D
Title: Destructable Terrain?
Post by: Noone on November 28, 2006, 03:23:04 pm
Distructable Terrain would be very nice because it gives you the chance to use more complex tactics, moreover it was part of all three important Xcom parts (ufo defence, terror from the deep, apocalypse) . But this is indee a feature that will cost some Time to implement so it should come if the rest works.
Title: Destructable Terrain?
Post by: Nevyn on December 02, 2006, 06:58:54 am
Means you can blow away the building the alien sniper is hiding in rather than having to line a shot up and shoot him, which is well..... smart!
Title: Destructable Terrain?
Post by: Nikron on December 03, 2006, 08:38:39 am
and that will happen with the civs too, right?
Title: Destructable Terrain?
Post by: Reenen on December 06, 2006, 09:17:31 am
If destructable terrain is implemeted we need to remember that damages must be paid to the people whose stuff got damaged.

I remember in UFO enemy unknown... I'd flatten the whole city...  You can't just go about destroying trump towers without any concern for your actions.

It must at the very least have influence on how the countries feel about you, and your "performance".
Title: Destructable Terrain?
Post by: papabob on December 06, 2006, 11:25:16 am
In a terror attack, the main concern of the goverment is to get no casualties of civilians. Any country can afford the repairs of the buildings that can be damaged by our troops (the maps are pretty smalls, at best we can only "destroy" 3 or 4 houses). There is always budget for these situations, just think in floods, fires, small gas explosions, etc.

Anyway, destroying buildings is not the "standard way" of playing missions. Make things destructables allows the player to use some different strategies in certain situations, but the old "search & destroy" will be the norm.
Title: Destructable Terrain?
Post by: Spitfire on December 11, 2006, 10:35:13 pm
Could you change each piece of the terrain into an actual npc (like monsters or civilians) with hit points?  

With that method you could give each their own hp (more for walls, less for wooden fence) and resistances (immune against bullets, cement walls strong against fire, etc.).

The problems I see with doing this are:

1. The time to transfer the models over into npcs and to replace them in the game.

2. Having the terrain "faction" be completely ignored as far as turns go (as in the humans go first, aliens second, civilians third, and do not let the game take into account the terrain group)

3. Line of sight blocking.  Making it so that if a monster stood behind an npc fence, the fence still blocked him from line of sight.

4. The poly count everyone refers to.  I'm not sure how this would actually affect the game performance.

Any who, I'm just thinking out loud and thought I would throw that idea up in the air.  Can't hurt to dream a little.
Title: Destructable Terrain?
Post by: Silencer on December 18, 2006, 10:08:44 am
Heh I dunno why I didn't consider this before. Quake II has damage mods for the models, in theory it wouldn't be too hard to use these for walls and treat the now "empty" section as not being there for game mechanics. Frankly it might be a pain in the butt, but it is an option that should be acheivable without turning UFO: AI into a more serious resource hound.

I personally used blasting through walls in the original XCOM games in a way I've been taught to IRL, forcing an entry to minimize casualties, coming through a wall behind your target while he's watching the door saves catching bullets.
Title: Destructable Terrain?
Post by: Reenen on December 18, 2006, 10:52:24 am
Huh?  I dunno what you are saying, but cool.  If you have a plan, then AWESOME!!!
Title: Destructable Terrain?
Post by: Northen_Wolf on December 19, 2006, 05:43:59 am
so we will get NPC doors and walls? nice !
Title: Destructable Terrain?
Post by: Silencer on December 19, 2006, 11:31:04 am
Quake II when you injure/kill your targets are marred by damage. I can't remember if this is a option of the models or if it's something engine side, but it's not impossible to adapt this to render the model of the walls as having a hole where you just fired a rocket through it. Of course this is a concept rather than a fact, but it might be worth pursuing if UFO:AI is based off a modified Q2 engine and while it doesn't permit blowing big holes out of the terrain itself, it definitely could bring us closer to blowing holes through walls that can be used for tactical advantages.
Title: Destructable Terrain?
Post by: Reenen on December 19, 2006, 12:41:42 pm
Yes, we don't want to be able to flatten a hill... we just want to shoot through a measly wooden wall.
Title: Destructable Terrain?
Post by: Silencer on December 19, 2006, 01:32:38 pm
Well there is usually little point in doing that unless you're in a hurry to go down ie the mine mission in Wellington, NZ (last time I played I used the airshaft to get everyone down to the bottom bar two and worked upwards). Since digging out a foxhole doesn't benefit you that much. But I'm only offering up a concept, whether it's workable or even useful is upto someone else. I just try to think of means to solve problems when I don't have time to work on it myself.
Title: Re: Destructable Terrain?
Post by: mydmitry on August 22, 2008, 05:20:33 pm
Destructable terrain must be done or it will never be UFO. You just copy the body and make it better real better but how about soul?
Method of small wall's is good -> not [**********] but
Is where a real problem with faces and speed? This is time based strategy not real time.

Title: Re: Destructable Terrain?
Post by: BTAxis on August 22, 2008, 05:26:02 pm
Thread necromancy on a topic that has been discussed to death. Locked.