project-navigation
Personal tools

Author Topic: Destruction  (Read 9269 times)

Offline Anarch Cassius

  • Squad Leader
  • ****
  • Posts: 176
    • View Profile
Destruction
« on: December 15, 2012, 10:16:05 pm »
I know this is a rather done to death topic and I understand that completely destructable terrain won't happen. However a lot is possible with what the engine does and I want to talk about how best to utilize it.

Breakable windows are everywhere but not tactically that interesting. I've seen destroyable fences on one level and I'm experimenting with how to bring this feature up to something approximating old mechanics.

Off the bat, Leveling most buildings is totally not feasible. I could design a building for total destructability but I can't see a way to prevent for example, all the lower floor being blown out and the top still hanging like this was Worms.

So if not everything can be destroyed it seems good to set some ideas for what should and should not be attempted. If two people make apartment complexes and one can be reduced to a burned out shell and the other has no damage points we have a suspension of disbelief issue. If the suburban fence is destroyable the rest should be.

Making blast holes in the walls is the most straight-forward option. Quake2 did this a lot for secrets with small cracks showing it was weak. This way you could break walls down along pre-determined sections. Support beams and heavily reinforced sections would be undamagable. How many and where is the issue.

Some levels are obvious. Africa has many building with wall segments already about the right size and they are made of wood and mud. There are a lot of levels though and some use single brushes for big areas to keep their large poly count down. The more ambitious a goal the more difficult it would be to implement universally.

I've recently started a map assembly, a school, and want to give it good destructibility without setting a precedent no one will follow. Please give me your thoughts.

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: Destruction
« Reply #1 on: December 15, 2012, 11:50:53 pm »
Topic already discussed to death and beyond. Forget about this, it's hopeless.

Offline Anarch Cassius

  • Squad Leader
  • ****
  • Posts: 176
    • View Profile
Re: Destruction
« Reply #2 on: December 16, 2012, 12:23:37 am »
Let me try that again...

I read this thread: http://ufoai.org/forum/index.php/topic,6426.0.html I know what the issues are.

I know some of them seem to be partially resolved. Geezer mentions that pathfinding is one issue but I just saw a Shevaar walk along the ledge of a window after shattering it opened that path.

Lighting is a major issue but there is some talk of a dynamic engine for it and ways it can be minimized if that can't be done.

Finally the performance issue. How bad is this really? The destructible fence in the suburbs must have had a couple dozen planks and it didn't seem to cause me trouble.

I can code, I don't have the time do a light engine but I understand enough to know this situation isn't as totally an impasse as some have said. Fact of the matter is we do have destructable stuff on many maps and I'm simply looking for a guide as to what's a low but interesting bar to set when doing my maps. I'm also willing to go back and add such to existing maps that cry out for it.

If glass and fence is the consensus for now I won't bother with blast points in the wall unless a map calls out for it ( like weakened ruins ) but I'm not asking to raise a fuss or beg for features, I want an idea of what standard to go with out of the several I've seen.

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Destruction
« Reply #3 on: December 16, 2012, 06:53:02 am »
AFAIK, the only standard we have is avoiding FPS killer maps (and out-of-theme maps ofc). So if you think you can make a map with a lot of breakables and still make it perform in decent way -- you are free to try.

Offline ShipIt

  • Project Artist
  • Captain
  • ***
  • Posts: 906
    • View Profile
Re: Destruction
« Reply #4 on: December 16, 2012, 09:03:46 am »
Finally the performance issue. How bad is this really? The destructible fence in the suburbs must have had a couple dozen planks and it didn't seem to cause me trouble.

Afaik the problem is the pathfinding. Everytime a breakable object gets destroyed, the game needs to check the pathfinding. If there are a lot of breakable objects, this causes serious lags, especially on large maps. This might not be trouble on modern machines, but we still want to support users that don´t have high-end hardware.

Offline krilain

  • Squad Leader
  • ****
  • Posts: 171
    • View Profile
Re: Destruction
« Reply #5 on: December 16, 2012, 03:14:35 pm »
Afaik the problem is the pathfinding. Everytime a breakable object gets destroyed, the game needs to check the pathfinding. If there are a lot of breakable objects, this causes serious lags, especially on large maps. This might not be trouble on modern machines, but we still want to support users that don´t have high-end hardware.
What if we introduced only exploding barrels, and decided they leave wrecks when destroyed. With the wrecks left in place, the pathfinding remains exactly the same.

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: Destruction
« Reply #6 on: December 16, 2012, 07:30:04 pm »
What if we introduced only exploding barrels, and decided they leave wrecks when destroyed. With the wrecks left in place, the pathfinding remains exactly the same.

What about shadows?

-geever

Offline Anarch Cassius

  • Squad Leader
  • ****
  • Posts: 176
    • View Profile
Re: Destruction
« Reply #7 on: December 17, 2012, 05:24:17 am »
Destructables don't seem to cast shadows. This puts a damper on my wall chunks idea but that would have been a pain anyway.

I hate to have a feature so clearly lacking compared to original X-com, especially such a tactically interesting one. I really do appreciate this frank talk of the issues instead of saying it just can't be done.

Fallout Tactics just had certain destructible objects. Barricades, surprisingly few doors, and a couple others. Windows, fences, and other light architecture that doesn't affect shading much is a good thing to have breakable. I'm also thinking certain object types could be done as destructable prefabs. Like a destroyable barricade with a few sections to insert in to maps.

At this point until there's a change in the lighting engine setting the bar low seems good. Still there are plenty of ways to use objects where their lack of shadow won't be immediately obvious. I'll see what I can get away with in my map.

Offline Anarch Cassius

  • Squad Leader
  • ****
  • Posts: 176
    • View Profile
Re: Destruction
« Reply #8 on: December 18, 2012, 12:43:39 am »
Doors are all inherently destructible objects (this actually is an advantage compared to Fallout Tactics). This is logical as they must move, so they have to have dynamic path finding and no shadows. Given that I can't see how making sure all doors have a health value (except perhaps military blast doors and such) would be a bad thing.

I'm willing to do this for existing maps if I get the okay but I want to mention two things.

The first time I tried to destroy a door in my map the game crashed and the log said that "guest" had killed "soldier who shot the door" which sounds like it got something backwards. I fixed some slight possibly unrelated errors in the doors on my maps and haven't gotten it since but keep an eye out for this.

Breakables take a value for type. I'm assuming this basically sets an armor template for them and glass, the default, has no armor. Would doors respond to having this value set? If not how hard would fixing the game so they could be? If it's not that bad I might take it on myself. I'm thinking right now they default to glass since they fall pretty easily to bullets and make a glass break noise.

Offline ShipIt

  • Project Artist
  • Captain
  • ***
  • Posts: 906
    • View Profile
Re: Destruction
« Reply #9 on: December 18, 2012, 08:42:05 am »
You can set the material property for func_doors manually or by editing the entities.ufo file. This should result in the game playing a "proper" sound when the door gets destroyed.

You can prevent the light from shining through a closed door/breakable object by adding a lightclip. Of course in this case the shadow will stay there, even if the door gets opened or destroyed. But as long as we don´t have dynamic lighting, there will always be problems like that. So you could go one way or another. I wouldn´t care about that shadow problem too much, because in general I prefer gameplay over visual effects. I also like the idea you mentioned earlier, about the weakened points in walls, where the attentive player can open 'secret' passages.

There is one more note - it is possible for func_doors to break lighting on a map. And some people suspect the AI can´t handle them properly.



Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Destruction
« Reply #10 on: December 18, 2012, 01:27:02 pm »
Breakables take a value for type. I'm assuming this basically sets an armor template for them and glass, the default, has no armor. Would doors respond to having this value set?

As of now, type affects only the breaking sound, nothing more. Also, breakables do not have armor and always take full damage.

I'm thinking right now they default to glass since they fall pretty easily to bullets and make a glass break noise.

Yes, glass is the default.

Offline krilain

  • Squad Leader
  • ****
  • Posts: 171
    • View Profile
Re: Destruction
« Reply #11 on: December 18, 2012, 02:02:26 pm »
What about shadows?

-geever
I know I will appear not professional at all, but isn't it possible to put the shadows in the initial map? Yes I mean that the shadows could be painted directly in the map. Then a shot barrel could be destroyed and it would leave for example a puddle object. The puddle would avoid pathfinding questions, and may fit or cover the painted (fake) shadow.

Of course that's not "pro", that's a minimalistic solution.

For me, we are in need of 3 breakable objects:
-1- barrels
-2- windows
-3- doors or walls

Only the 3rd case is a real difficulty. Unless we script by advance the action. I mean, imagine a barrier on a bridge. The pathfinding question is quite limited because you have only one way to move : destroying the barrier, and then going forward.
 
« Last Edit: December 18, 2012, 02:31:46 pm by krilain »

Offline Anarch Cassius

  • Squad Leader
  • ****
  • Posts: 176
    • View Profile
Re: Destruction
« Reply #12 on: December 19, 2012, 01:12:39 am »
Better idea. If handled as prefabs... just add a shadow plane with no clipping below the barrel and put it in the breakable. So the shadow disappears when the object does.

Yes, I know don't put more than one thing in a breakable, but that's a rule for stuff that's disconnected, here it's likely in the same bounder and hardly matters.

Basically we're mirroring the way player shadows work for destructables. This only works for certain kind of objects but for barrels, barricades, maybe even trees it could be nice.

Offline krilain

  • Squad Leader
  • ****
  • Posts: 171
    • View Profile
Re: Destruction
« Reply #13 on: December 19, 2012, 02:39:59 pm »
To say truth, I would like to add my really personal feeling from a player point of view. I've been often playing games where manipulable objects where not shaded or enlightened a realistice maneer. Their different nature was shown by this slight difference on appearance.

And that was not so bad. If we give a standard appearance to destroyable objects in a game where those objects wouldn't be systematically used, the player will try to hit at every objects to test if they are or not destroyable. It will result on an un-useful waste of amno, and it will bring some disappointment when an object stands invincible during one action where it would have been wonderful to destroy it.

Shadows are not so necessary.

« Last Edit: December 19, 2012, 02:42:31 pm by krilain »

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: Destruction
« Reply #14 on: December 30, 2012, 01:02:07 am »
Anarch, if you are so good at coding why you do not try to help ShipIt with the shadows/door bug? The "indestructible scenario" is a common problem in many games, many people just do not notice that anymore. Do you remember the dingy office doors and the flimsy footlockers in Fallout 3 withstanding the impact of a Fat Man nuke launcher?  :P