New Difficulty mode
New Difficulty mode
Hello everyone,
I am currently looking into developing a dynamic difficulty adjustment strategy in Warzone 2100. That is, a difficulty that adjusts to a players skill level while the player is playing the game and saving that state for future games. Rather than wading through the code aimlessly, could anyone give me a good starting point, such as where the Droids are initiallized or scripts that hold damage, health, etc. Any and all input is greatly appreciated and I apologize if I am in the wrong forum section.
jh0242
I am currently looking into developing a dynamic difficulty adjustment strategy in Warzone 2100. That is, a difficulty that adjusts to a players skill level while the player is playing the game and saving that state for future games. Rather than wading through the code aimlessly, could anyone give me a good starting point, such as where the Droids are initiallized or scripts that hold damage, health, etc. Any and all input is greatly appreciated and I apologize if I am in the wrong forum section.
jh0242
Re: New Difficulty mode
For campaign?
I'd guess the non-ini droid loading function used by campaign in src/game.cpp would be the right place for that...
I'd guess the non-ini droid loading function used by campaign in src/game.cpp would be the right place for that...
Re: New Difficulty mode
I would like the difficulty to apply to campaign and bots in skirmishes. Basically I will take data such as user overall damage and ai overall damage, number of units, health, etc. and use an algorithm to lower or raise the stats of the ai to meet the player's skill level. Basically I need to know where the enemy units are created at (which file) when the player creates them in game and how the unit's stats (damage, health, etc.) are assigned. Are constant variables used? Where are those variables? Where are those variables used? Any and all information is greatly appreciated.
Re: New Difficulty mode
Starting reading src/droid.cpp
I'm not sure this is a good idea, though... People like knowing what they are playing against. "I beat the AI on hard", sounds a lot better than, "I beat the AI again today, and it is probably a bit harder than last time but I have no idea what has changed."
I'm not sure this is a good idea, though... People like knowing what they are playing against. "I beat the AI on hard", sounds a lot better than, "I beat the AI again today, and it is probably a bit harder than last time but I have no idea what has changed."
Re: New Difficulty mode
I will add statistics demonstrating comparisons, maybe by percent or z-score, on how much more difficult or less difficult the AI, basically providing a way to gauge your own skill level.
Re: New Difficulty mode
Well, if only a computer had a way to figure out how well does a human play, i would have had much easier time writing AIs
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: New Difficulty mode
Allowing AIs to persist data across multiple games would be super-useful for adaptation. Maybe something for 3.2 branch?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: New Difficulty mode
Or even for manual teaching (like understanding a chat message of "hey, please try to remember to build defenses around this spot next time").
Not sure how exactly i really want it to be implemented.
Not sure how exactly i really want it to be implemented.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: New Difficulty mode
A simple key:value table stored persistently for each script-name? (Like we have a log file for each script-name now.)
Re: New Difficulty mode
Possibly, but IMHO a JSON formatted file might be nicer (particularly for easy viewing / debugging).
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: New Difficulty mode
Which files contain the code for creating new cyborgs or tanks when the user clicks to create them?
Re: New Difficulty mode
@jh0242 - the .txt or .ini files (depending on wz version), often under the stats folder. Eg. body.txt / body.ini defines the tank and vtol bodies. There's some info under the Development tab (top of this page) about the stats files.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: New Difficulty mode
I meant in the src folder, which .cpp or .h file/s. But that information is helpful as well, thank you aubergine.
Re: New Difficulty mode
If you are going to do this, you are going to have to wade through a lot of code. You start in droid.cpp and statsdef.h and trace everything from there. While I'd be happy to help with concrete questions, you will need to learn your way through the code base yourself. See it as a learning experience. Do not post multiple duplicate topics asking us to do all that work for you.jh0242 wrote:Rather than wading through the code aimlessly
Re: New Difficulty mode
I know that I am going to have to wade through the code and I am happy to do so. I have been reading through it and I feel as though I am starting to understand the structure. However, I am not sure where the units controlled by each player, including AI, are held. It seems to me that the loop.cpp file is where the game is being controlled, but where are the arrays (or other storage structure) of droids being held and acted on throughout the gameplay? If I can get that little bit of information, I feel I will have a great starting point. I am sorry for any confusion or misuse of posts and thank you for any help you can provide.