Technical support > Feature Requests
Destroyable Objects
adamssl:
Is it really so difficult to add the ability to punch a hole through a wall? I can't imagine it'd be that tough.
Off the top of my head I'd imagine what you'd need to do to add support for knocking a hole in a wall...
1) Add "min_damage_to_destroy" variable to all barriers
- eg, 10 on a fence, 100 on wooden wall, 250 on concrete wall (arbitrary numbers, not real game values)
- In that way, if a rifle has a damage range of 5-50, it *may* knock a hole in a fence, a grenade with a damage range of 50-300 will always knock a hole in a fence, typically in a wood wall, and occassionally in a concrete wall
2) When the barrier registers a hit (which is something I imagine already happens in the game... when aiming through a fence the target path line shows green to the fence, but red beyond it, and attempting to fire through the fence registers shots striking the wall), then perform a compare on each damage event to min_damage_to_destroy for the barrier
3) Whenever an object is destroyed, then swap out the tile with the destroyed version. eg, "wooden_fence_a" is swapped out with "wooden_fence_a_destroyed". As a stop gap all destroyed barriers can be swapped to a single generic "rubble" object, so that every barrier texture doesn't need to have a new sister texture generated.
The only question I have is I don't know if there is a problem coding the ability to allow characters to walk through a destroyed barrier? I don't know if the tile is flagged as "impassable", so that even if you can SEE through it, you can't walk through it. If true, then I don't see this as a stop-issue, just a limitation
If this feature is added, you could even expand it out to destroy large objects. For example, each tile which comprises a car has a min_damage_to_destroy set to 1000 (again, arbitrary value), and if it's surpassed then the entire car model / tiles are swapped out with a corresponding "blown up" car.
Anyhow, back on topic...
One thing to note, my comments are coming from about... hmm... I'd say maybe 20 minutes of actually playing the game, and 0 minutes of looking at any of the soruce code. I may be way off base.
But is this something scheduled for a future release? Is anyone already working on it? Is there a list of potential / planned future features? The sourceforge tasklist is pretty slim.
I don't really have much time now, but I may take an interest in adding the feature. It's been a few years since I've coded anything, and it could be a fun side-project.
Wanderer:
--- Quote from: "adamssl" ---Is it really so difficult to add the ability to punch a hole through a wall? I can't imagine it'd be that tough.
<SNIP>
I don't really have much time now, but I may take an interest in adding the feature. It's been a few years since I've coded anything, and it could be a fun side-project.
--- End quote ---
See the wiki, func_breakable.
Zenerka:
--- Quote from: "adamssl" ---Is it really so difficult to add the ability to punch a hole through a wall? I can't imagine it'd be that tough.
--- End quote ---
No. I can provide detail description what should be done and in what way. Care to do this for our maps?
--- Quote from: "adamssl" ---But is this something scheduled for a future release? Is anyone already working on it? Is there a list of potential / planned future features? The sourceforge tasklist is pretty slim.
--- End quote ---
Take a look at our wiki at http://ufoai.ninex.info/wiki/ at TODO section.
adamssl:
Fascinating info. Actually Zenerka, if you don't mind, could you provide a very high level overview of what would be required to add this feature? Or a list of limitations for why it's problematic?
I would like to start poking at a few different parts of the code. Although in all likelihood I'd start with a lot smaller and less daunting tasks. ;)
Zenerka:
It is not problematic at all. It just needs to be done.
Lets say we want to break a wooden fence. One must
1) create a particle for breaking wooden fence, so when one shoot at it, the user sees "exploding" wood
2) create and enable a sound for this event (cl_parse.c/CL_ParseStartBreakSoundPacket())
3) open a map, select desired brush beeing wooden fence, mark it as func_breakable
4) go to step 1. and repeat for every type of breakable thing you want to introduce
5) go to step 1. and repeat for every map.
HTH, HAND :->
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version