|
|
Topic:
Can we can the ability of a hero dynamically, in game?
Background
I've seen this request pop up often in varying forms:
- OMG mode - heroes receive a random four abilities from the total available pool of abilities
- Custom RPGs - where the number of abilities may be more than 8 and/or the abilities change like a talent tree
- Tower defense - Towers may need new abilities as they advance to stronger towers
Current Progress
Several people have put forward ideas on how to solve this issue, but as the research conducted by Oloko and others have shown, the only known way of changing the abilities dynamically is via ability modifiers.
However the catch is that there seems to be an upper limit of the number of modifiers available to each hero. Additionally, the task of creating what amounts to the same set of modifiers for each hero is a time consuming task.
Possible Solutions
Having looked at this problem in my own spare time, I'd like to propose a series of possible solutions - some possible by us modders and others not.
- Ask S2 to add what we need - Possibly the most direct approach, but we have no guarantees that they want to help us with this task or if its easy to do. Without knowledge of the engine's interior and how the ability logic is designed, it could be difficult to make the modifications required. As much as S2 listens to the community, they certainly have more pressing game issues to attend to.
- Accept the 20 modifier limit - There is no real need to have ALL the abilities and ALL the heroes for a OMG style map. A reduced set could be just as entertaining, provided the right group is picked. Many skills overlap - how many stuns are there, for instance. Properly categorized, a few spells from each group may just do the job. The truth is, for this game, the heroes are not really important. What matters is which person has which spells.
- Do an end run around the system - S2 can't help us, we don't want the modifier limit, so whats left? Thinking outside the box. What other part of the game can change dynamically? Items. After reading the following post, I got an idea. Would it be possible to have an ability check the items in a hero's inventory? If so we could craft abilities that do very generic actions, like "Nuke" or "Summon" but are then modified by the items you bought. "Nuke" could be altered to have higher damage, a stun, or other effects. And as items can be combined by recipes, the items could be considered a talent tree. Or be made unsellable and assigned randomly at the beginning of the game for a OMG style map. The trick is getting the abilities to examine the inventory or by some other method determine what changes should be made to their effects. The old Engineer turret (that took the items the player currently possessed) comes to mind. Obviously that ability could copy the inventory, but could it make sense of it enough to trigger a conditional?
Discussion
I think the one thing that we have all realized since the release of the map editor, and many have realized this well before, is that the current scripting framework is set up very well for HoN, but perhaps very poorly for other styles of games.
While it is certainly possible to create maps that don't follow the DotA game idea (See the Hon soccer map, and the few tower defense maps), it isn't easy either. There are many hard coded restrictions that we are faced with and need to work around. In many ways it feels similar to what the modders for WC3 had to deal with when they made their maps. Perhaps the restrictions are different, but one of the rallying cries early on was the idea that with HoN modders would finally have an engine that they could play with freely ( or at least more freely than WC3 ).
I understand that the SDK holds many promises, but the release for that particular vaporware is nowhere to be seen and I for one do not expect it soon if ever. Additionally, even if it is released, I don't expect S2 will allow games created by it to be listed in the server browser. If they are hesitant to list custom maps, I don't know what they are going to do with custom games.
Therefore I believe the best solution is to work with what we have now, and push S2 to add the features we want to the scripting engine. For the most part what we have will do 90% of the job. We've got the RTS engine stuff, the shop/inv stuff, the hero/leveling stuff - we just need more flexibility to play with the fine details of these things. Much of that I expect we can do ourselves with a better understanding of the scripting commands and some things S2 will need to step up and do for us.
Hopefully we, as a modder community, can demonstrate the famous ingenuity we are known for and find some solutions for this and other problems.
As I mentioned in that thread, you can use a tiered or cascading system to allow for more than 20 abilities.
Your hero will have the standard 20 <modifier> attributes. modifier1-20.
Each modifier then directs the relevant inventory slot to an ability. base_ability1-20.
Each of these base abilities then contains 20 conditions or modifiers of their own, effectively becoming 20 abilities in 1.
So you end up with
Code:modifierX --> base_abilityX--> abilityX-Y x20 x400
S2 Games: Dedicated employees serving dedicated gamers. Continuous development. Never-ending improvement.
-----------------------------
Ben Pettit | Lead UIX Developer
You don't need to do this for every hero, you only need to do it once.
S2 Games: Dedicated employees serving dedicated gamers. Continuous development. Never-ending improvement.
-----------------------------
Ben Pettit | Lead UIX Developer
I dont know if it needs in every hero file but I would assume so and after you have it all done for 1 hero you could simply copy and paste that to all other heroes as there is no specific code for the hero itself. I dont know if you would have to copy the states over to each hero since you can set a heros spell to another heros spell without copying the spells info to that character but I would need to test to make sure.
So you are saying make a mod that points to another mod that points to another with what you actually want done? More less a less practical way if it wasn't the only way as its extra coding but I guess only way to get around it currently.
I will mess around and see what I can work out. I figure probably have to make custom shop UI as well since there are so many spells say we have 70 heros im not sure the current count that is 280 spells there alone so that part will be challenging in itself.
then will there be some major laggs because system will need to load all spells and then distribute them to heroes or it will do it pregame?
The item route you will buy an item that gives you a spell and then learn the spell. So it will only load up what you buy, but there will be a lot of items.
Heh, I did read that, but I don't think it fully sank in the first time I read your post.
Assuming it works, and I have no reason to doubt your expert opinion, it does illustrate the first point in my discussion section. A working solution it may be, but optimal it is not. I refer both to the concerns raised by
FlameStick:
and Okolo
While I fear you may be correct that this is the only way to get what is traditionally called OMG implemented in the current system, I do think we should seriously consider alternatives. Does anyone know if we can get the old map when engineer's turret did the item copy trick? It would be interesting to see how that was done - unless someone already knows?
What happens if you put more than 20 modifiers in a file does the file simplynot work or the mods after 20 do not work?
I recently noticed an interesting fact - Wildsoul's bear gains abilities over time.
It turns out that the gain is still static, but the method is interesting. In the Inventory setup for BooBoo, the abilities are staggered between commas - very similar to other scaling values. Here however, the abilities are added as BooBoo scales.
I'm not sure if we can get a similar effect for heroes, I tried a quick experiment with adding Electrician's shield to Behemoth after level 2 but the map failed to be listed. I may have made a mistake, but its worth pursuing.
I am unsure if the comma scaling trick is hardcoded to only work with 4 levels or if would work with arbitrary levels. If it does work with many, many levels, an OMG mode could be made by sheer permutation and assigning random levels to people. This method may also be very useful in creating tower defenses with upgradeable towers.
Interested in peoples thoughts.
It's an interesting idea, but I don't think it would work out that good.
What you want to do is to create all possible spell combination possible and set them at different level on the hero? The first 25 level would be spell_pack1, then the next 25 level would be spell_pack2 and so on?
If that's the case, you would need to either change the experience table so that level 26 needs 0 exp (since it would be level1), I don't know if you can have a lower exp value for a higher level. You could also script it so that if your hero is level 26, then he would gain more exp as if he was level1.
There is also the fact that the max exp is set to 32767 and the exp level 25 is 32400. So I guess going over 25 is pretty much useless unless you scale the exp of the whole game or you can start back at 0exp level 26.
You would also need to stop the hero from gaining exp at a set level, so he wouldn't get level 26 when he's level 25.
At this point, it would probably be easier to create one hero entity for each spell combination possible and then spawn the right hero from the spell selection.
Maps:
Enfo's Team Survival Beta [Dream] - v1.019 (18/07/2011)
BeHoNeled Alpha (Bejeweled clone) [Dream]
Well, I agree the experience/level thing is a bit troubling, but the method may work well for tower defense where auto-leveling is not usually preferred.
As for changing the experience table, I'm not sure how BooBoo is coded, but I'm fairly sure that as Wildsoul levels his bear ability, BooBoo is spawned with a matching level. I''d need to check and see if that is a real level or some modifier applied as a result of the skill to artificially raise his stats.
In the end, its not a perfect solution by any means, but my main purpose of this thread is to discover ALL possible methods and determine their pros and cons. Even the wrong way needs to be examined, if only to say that it is wrong.
Yea I agree with you that its good to share idea, even if they are not perfect, at some point they might be useful. That is why I said it was an interesting idea, even if it doesn't work, it's still nice to know we can do this.
As for "BooBoo" level, it is strange indeed. Keeper wards are pet too, but there is specific codes in the ability to level all of his pet at the same time he level the ability. For "BooBoo" though, there is no such scripts.
It might have to do with unittype="persistent", but I'm not too sure.
Maps:
Enfo's Team Survival Beta [Dream] - v1.019 (18/07/2011)
BeHoNeled Alpha (Bejeweled clone) [Dream]
Oloko, your comment on levelpets interested me. I had not thought to look at Keepers's eyes.
Then I thought - what other odd commands are available for this XML language? Seeing no good way to search all the xml, I sidestepped the whole problem and started dumping strings from the game executables and associated libraries. Something had to read the XML after all, and all the tag names would be in that code.
So after dumping libgame-shared, I got this interesting list of XML syntax. Many we have seen before and are quite common, but others look more interesting.
See listing here
There may be other juicy nuggets to find with more sifting as this is only a 5 minute exam.
I have no idea how you did this, but this is definitely awesome. I mean, there is a lot of stuff there that most of us thought it wasn't doable. <givegold ... /> for exemple.
The only issue is that we don't know if they actually work or how to use them. Still, it's way better than not knowing they actually exist!
Maps:
Enfo's Team Survival Beta [Dream] - v1.019 (18/07/2011)
BeHoNeled Alpha (Bejeweled clone) [Dream]
Oh, it was easy. On linux there is a standard command, 'strings', which dumps all readable strings in a file, executable or not. One of the benefits to using an operating system that caters to programmers and hackers![]()
And for the using them, I imagine just trying to duplicate the existing syntax will work. Most of the tags seem similar to each other in use. Basic hacking philosophy - take a good guess and run with it or try everything till something works!