Call to H-IV mapmakers - AI enchancing scripts

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.

Moderator: Moderators

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Jul 31 2016, 21:45

I already have the scripting done to reduce a stack by a given percent, so I would think that wouldn't be too different from giving a percentage of creatures to the attacking AI. I could script it, but I feel I've been spending more time creating these scripts than I have on the tool to inject them.

As far as the events to reduce all neutrals during an AI turn, there are probably things I could do to make it faster, but I would have to ditch some other things, like calculating the experience the AI would receive for the full stack on victory.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Taro » Aug 1 2016, 14:26

I don't have it, but I can create new one within several days (there is a LOT of scripting to make it work). And how did you make a percentage reduction of neutrals??? I believe there is no type of script like that.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Aug 1 2016, 14:53

I would appreciate if you could do that scripting for me. All you need to do it for is a single creature, and then I can copy / paste the scripts within the event, using the H4MG, and then just change the creature name where necessary.

Are these scripts only on the Encountered / Defeated events? Encountered -> check for space and give appropriate units, and Defeated -> Remove what was given?

As far as how I did the percentage reduction, I have a single variable containing a number between 0 and 99 which represents the percent reduction. So, a value of 80 means reduce by 80 percent (stack of 100 creatures will be reduced to a stack of 20 creatures).

Each neutral stack has an event #H4MG Reduce _Neutrals, which checks for each possible creature, and if there is at least one, does some calculations. For example, if number of air elementals in this army is greater than 0, calculate 80% of that number by first multiplying it by 80, and then dividing by 100 (to get a percent of something, you multiply it by the decimal equivalent of a percent, which is .8 in this case).

Then I call an event #H4MG Reduce Air Elementals, which uses the number I just calculated and takes away that many air elementals from this stack.

If the stack wins against the AI, I give back to the stack what I took away.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Taro » Aug 2 2016, 15:59

Well, I created a part where AI gets creatures on encounter. Soon I will make a second part, where it loses bonus creatures.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Karmakeld » Aug 2 2016, 22:40

I will have to test one of my maps again/look for old saves, coz I recall I had the results of the AI doing more progress on novice than on advanced.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Aug 3 2016, 0:00

Michael, please let me know which map so I can use it as a test case :)

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Karmakeld » Aug 8 2016, 9:04

The 5th map.
I might have to send you some older version of it, as I've added some Changes to deal with the issue in the latest version.
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Aug 22 2016, 20:02

Just a minor update on progress. I went through this thread to try to pick out all suggestions and compile them into a single post. If I missed anything, or there are other ideas, please let us know :)

List of things to do for AI enhancement (in no particular order):

AI Enhancement
- Show entire map for AI
- Make every player "vital" under AI properties
- Events to give gold / resources to AI (including recurring increases)
- Increase starting level of AI heroes
- Reduce neutrals on encounter for AI (fewer AI losses while still gaining normal experience)
- Increased AI movement
- Increased AI experience
- Increase dwelling populations for AI towns
- Starting skills for new AI heroes. (Need suggestions for skill combinations)
- AI artifact sorting (PatFX working on this)
- AI hero stat buffs

Other
- Balancing mechanism for neutral armies for each difficulty level
- Make the AI options tunable for difficulty. The easiest way to do this would be to have a selectable percentage reduction applied for each difficulty level under champion.
- Control neutrals vs. an opponent.
Last edited by iLiVeInAbOx05 on Sep 27 2016, 3:08, edited 6 times in total.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Sep 7 2016, 19:08

I have been sneakily editing my last post with updates from my progress. I'm currently at the increased experience for AI heroes. I can easily just add a single experience bonus daily, but there was some discussion about the amount increasing over time.

What would be a good "amount of time" to increase the amount of experience being given to AI heroes? Increase each week? Each month? What would the high end be for time (at some point I have to just say if time > some time, use this amount)? For the amount of increase, I'll probably have the user set a percentage to increase for each time amount.

Also, giving new AI heroes decent starting skills. Could someone provide some combinations that I could choose from to give to a newly hired AI hero?
Last edited by Anonymous on Sep 7 2016, 19:09, edited 1 time in total.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Karmakeld » Sep 9 2016, 21:29

I think weekly would be fine.
Assuming most maps take an average of 3-4 months (depending on size of course), I don't think once a month is of much use. Also I think you could end the time after 4-5 months. XL maps seems to be the only type benefiting from a longer time span. I take scripts are put on new heroes, not universal time? You could also consider the amount of XP given, at first 1000's soon add up to levels, but after x levels/months they matter less, unless the xp is somewhat increased. perhaps 3-4 month time span is enough?
Will the starting XP be preset or adjustable like the percentage increase?
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Sep 9 2016, 21:44

I was thinking weekly as well, just wanted to get some others to chime in with their thoughts :) It wouldn't be that difficult to make the amount of time between increases user selectable as well (just use current day modulus number of days between increase == 0 and then switch to the next amount), but I think for now we can just say a week is a good amount of time. So, just checking the week number and selecting the appropriate amount of experience to give based on that is probably the easiest way to go.

The scripts will be put on any hero that is placed on the map, as well as on placed events around the entrance to towns for hired heroes (starting heroes can still trip the placed events, so they can get extra bonuses, but I don't currently see a way around that).

The starting experience increase and percent increase of that experience per week will both be adjustable so users can find a good starting point and percent increase that works reasonably well :)

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Karmakeld » Sep 10 2016, 8:37

So you can't really add it to hired heroes right?
It would just be a one time bonus?
In which case, only giving to lvl. 1 heroes would mean newly hired or only allowing it to trigger once a day, could rule out some unwanted increases (not gonna call it abuse, as it's AI only) ;)
Last edited by Anonymous on Sep 10 2016, 8:40, edited 1 time in total.
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Sep 10 2016, 16:49

Can't add it to hired heroesnas things currently stand. It might be possible by injecting a dll into the game while it's running which would attach to whatever method creates the hero object and adds it into the game, but I don't know anything about that right now :)

The placed events in front of towns are currently set to only be usable twice per turn, so the AI won't be able to accidentally abuse it :)

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Taro » Sep 15 2016, 18:19

Well, I had to disappear for some time. iLiVeInAbOx05 - do you still need that script with neutrals? I can create it this weekend.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Sep 15 2016, 19:49

If it doesn't cost you too much time to do, then you might as well so that we can bundle it in with the other events.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Taro » Sep 17 2016, 6:33

Here you go: https://drive.google.com/open?id=0B-htY ... 2NBX0k0aGc

It is made for level 1 units but you can copy it anywhere you like. And if you decide to implement it then please stay with original name of "neutral slayer".

I have idea for one simple script. Starting AI hero could get healing potion when encounter human player. With it killing this hero wouldn't be that easy.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Sep 17 2016, 21:48

Got it, thanks! I'll call the AI event group "#H4MG AI Neutral Slayer". Is that alright?

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Taro » Sep 18 2016, 6:34

Yeap, that' alright. Are you plannning script with reveal map for AI (or at least some part of it?).

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 565
Joined: 21 Jul 2014

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby iLiVeInAbOx05 » Sep 18 2016, 7:16

I've actually already got showing the map for the AI working. I used the hero from the map you posted on the first page and put them all around the map so that the entire map is visible to the AI on the first turn.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Re: Call to H-IV mapmakers - AI enchancing scripts

Postby Taro » Sep 18 2016, 8:43

I understand but is it even possible to implement it in your program? Because as far as I know you can give scripts to already existing objects. With this you have to place these heroes first. And this could be a problem.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 9 guests