|
Post by had0shinsu on Jun 17, 2020 7:41:49 GMT
Hello!
I'm having a bit of difficulty with trying to change the level of Units. The source code with the range of levels is great but it doesn't provide me much control when designing levels and trying to adjust difficulty. Basically I want to be able to manually set starting levels for units in the scenes. I was able to mess with rank to get the #s low but not exactly what I wanted.
Secondly instead of saving up exp to be distributed to the party back at the end of the scene how bout the ability of gaining exp after attacking/defeating an enemy? If I recall correctly FFTactics was similar in this way.
I appreciate any feedback on how to implement it!
|
|
|
Post by Admin on Jun 17, 2020 14:13:28 GMT
To fine tune your levels, consider creating "recipe" objects like I do for heroes in the "Unit Factory" lesson. You can specify the amount of experience or rank you'd like units to begin with and then create a system that knows how to load and work with those recipes. I think this is easier than trying to set the levels on units in the scene directly, because I like for those objects to be prefabs that can be used dynamically and repeatedly.
For distributing experience based on actions, take another look at the "stats" lesson. You can see how to award experience by looking at the example code in that lesson. You will just need to modify it so that instead of awarding exp to the entire party, that you award exp to the current unit. Then you just have to determine the rules around what to award. Is the amount of experience based entirely on the chosen action as a fixed-rate, or is it dynamic based on the relative levels between the unit and its target, etc.
This probably isn't a trivial change, in part because it requires a great deal of game-design. For example, say a user defeats all enemies but one, and is able to keep it alive and do actions over and over again to farm experience. Is that a good thing, or do you want to clamp the max amount of experience that could be obtained from a single enemy and/or battle? Depending on the answer to questions like this, you may have a good deal of "state" to track.
|
|
|
Post by had0shinsu on Jun 18, 2020 6:27:50 GMT
That was helpful I was able to get the level input done. The EXP change I'll take a deeper look into it to modify it since I would have to do a couple of things differently based on different actions.
If possible I would like to pinpoint the start position of the unit's instead of it being random. I found the code in InitBattleState but I'm not to sure on how to go about it.
And also is dialogue what causes it to start at the beginning/end.
|
|
|
Post by Admin on Jun 18, 2020 13:27:49 GMT
I used random selections so that my code would work on any board that a reader may have put together, but at least you can see code that actually places each starting unit on a specified tile, and orients it with a specified facing direction. The part that is left for you is to determine how your game selects those tiles and directions, and in many cases you want to manually specify it per level. So, just like you did for setting a units experience, you could create another recipe (or add to an existing recipe), the coordinates and facing direction you would like a unit to begin with. The "Board" script has the ability to "GetTile" given a "Point" and that would be the only other thing you may have needed.
I'm not sure I understand the question about dialogue?
|
|
|
Post by had0shinsu on Jun 21, 2020 6:21:39 GMT
Great I'll take a look into that! Oh I was asking where was the dialogue being called in the code, I found it so all good.
Thanks for the help!
|
|