Page 1 of 1

Blowing stuff up.

PostPosted: 05 Aug 2011, 00:22
by cdxbow
In mek games you need to be able to blow things up or knock them over. We did OK for a start, with what I call 'knockover' models, we made an animated street light and a tree; linked them to a trigger with a very small proximity radius and they work, giving a pretty good feel as if you are in a big mek and you walk in to them they fall over. We have not had such luck with blowing stuff up. Initially I thought of doing it a similar way; triggering an animation in a mapmodel after a certain number of hits, but there seemed to be no way to intercept hits and then programmatically trigger stuff. So first question, am I missing something? Is there some way to intercept a hit and then using some combination of triggers/scripting run an animation?

My next attempt involved using an AI entity, because an AI entity provided a hit box, could run a dying/dead animations, could have it's health set etc. It seemed perfect and we had already added additional AI entities. First we made an orbital canon (for the end of an SP level) and a then a building using the turret code, you can see the unconvincing results here, the dancing skyscrapers! http://mekarcade.com/media/3.mp4 I tried simple modding of the AI parameters in various ways but they still swivelled. Is there any simple way to keep them still?

You may consider these are just 'eye candy' and I could leave them for later, however even the MP maps in the original mechassault did feature bridges, buildings, etc that you could shoot up and change the way the game played. SP maps would benefit from it even more, but that's not our focus.

Should entities provide a viable way to do these 'destructibles' then what sort of limits are there in terms of: how many types of AI entities can the engine live with and work OK. RE comes with 3, we have added 7 and nothing has noticeably has slowed or stopped working. What sort of limits are there on a map, in terms of total number or number of types?

Perhaps there a better approach that I am missing?

Re: Blowing stuff up.

PostPosted: 05 Aug 2011, 01:33
by Kitsune
255 ai is the maximum.

Re: Blowing stuff up.

PostPosted: 08 Aug 2011, 05:11
by cdxbow
255 different types or 255 total ais' on a map?
Also does performance degrade as the number go up? Map load times will, but will in game performance?

Re: Blowing stuff up.

PostPosted: 10 Aug 2011, 02:57
by Kitsune
255 maximum on the map. performance wise, i haven't noticed any issues, then again my computer is meant for running 3ds max at full power.

Re: Blowing stuff up.

PostPosted: 16 Aug 2011, 03:18
by cdxbow
We are still trying to blow things up! I tried again to mod the entity code of the 'cant move' actors so they did'nt swivel and sway with not luck. If there is any quick and dirty way to keep them still i would love to hear, cause we would like to have some stuff to blow up for the demostrator. Clearly a better solution is needed. In the various cube forums it's been requested for years ('you can't have an FPS without exploding barrels' said one post), and after playing though one of the Halo SP and Mechassault 2 again it reenforced the need to be able to blow stuff up.

A general solution would be best, not something like Sauers barrel, one that could intercept hits and trigger anything. Something like a 'hitbox entity', which would have health and size as it's main parameters. Health would be set the same as with actors and the size of the hitbox would be set similar to triggers. The only thing it needs to do is to be able to be linked to one of the current triggers and in it's simplest form would just trigger when the set amount of health is shot away. You could make it more complex, but even in it's simplest form it would add a lot.

HITBOX ----link-----> TRIGGER ----link-----> whatever! eg mapmodel animations
(health 300)

The whatever could be anything, our interst is blowing up buildings, bridges and a few bits of terrain. I recognise that there are limitations to the number of entities and the performance sucking effects of having them all do stuff at once, but with good level design those problems can be avoided and some of the perfomance impact of entities is being addressed.

A slightly different way would be to add a hitbox the current triggers, this would add the same funtionality, I am not sure if this is more or less feasible. The first at least has the benefit of being seperate and discrete.

I would be very happy to have a go at this myself, but i would need significant help from the devs.

btw I tried making the damage done by the sword negative, ie giving health, however it did nothing. Like no damage and no adding health. I think a negative value must be made zero. One for a rainy day.