Jump to content


Photo

AI stats Wiki page


  • Please log in to reply
53 replies to this topic

#1 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 11 January 2016 - 06:25 AM

*
POPULAR

Hi guys,

 

I am considering making a Wiki page with AI stats, so mappers can decide more easily, which AI (apart from the setting) would fit for specific game situations. These properties can all be looked up in the def-files, of course, but these are (from my personal experience) not that pleasant to read and I think it would be better to have the relevant stats in one place. I think this could save some time playtesting, when you know the most relevant properties beforehand and are not surprised, that the AI you chose behaves differently than expected. I would want this page to include properties like health, field of vision, KOable, fighting difficulty, spotting chances, damage reductions etc.

Now, I have two questions:

 

1. Is there an actual interest in this or is it something that would most likely see no use at all?

2. Who do I have to ask, to get writing access to the Wiki?

 

If there actually is an interest, I would later on make a list of properties I would include. Then, if anyone thinks anything is missing, I can expand the list, of course.


  • Springheel, Bikerdude, Melan and 2 others like this

#2 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1421 posts

Posted 11 January 2016 - 11:09 PM

People are shy these days...

 

I say this would be quite nice. Args and what not, what they mean, how many are there, etc, is one of those things you have to learn on the go by mostly guessing, while you are mapping, and it would be nice to have more of this stuff documented. Wiki work is a noble endevour, but often thankless, Im afraid. People just study it, and get on with what theyre doing. I know Ive never thanked people for a wiki article, though Ive always felt happy somebody took the time to put the information that saved me in writting. The knowledge of doing something useful that will help someone, someday, is the reward you get. ;)


  • Moonbo likes this

#3 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 12 January 2016 - 05:13 AM

Ok, then I will first collect the data in an Excel Sheet. After that it will only be some writing effort.

 

But I have already encountered the first problem: I have created an account at MediaWiki, but when I try to log in at the DarkMod Wiki, it says that my user name does not exist :( Do I need an own account for the DarkMod Wiki? If so, where can I create it? I only see the log in button...



#4 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5213 posts

Posted 12 January 2016 - 05:37 AM

I think you should PM an Admin.
Posted Image

#5 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 13 January 2016 - 03:26 PM

I can probably extract you a table of AI with their spawnargs in a few minutes to get you started. 



#6 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 13 January 2016 - 05:50 PM

That would be great. But if I may ask: How? I would have just imported the def-files in Excel and copy/pasted the stats from there to get an overview, but if you know a quicker method, I would appreciate to know it ;)



#7 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 13 January 2016 - 06:11 PM

There are quite a few. This csv file has just the spawnargs that are defined in each entity def. It doesn't include inherited spawnargs but I can tweak the script to include them if you want.
Attached File  ai_spawnargs.csv.txt   194.69KB   4 downloads
 
How: I use python scripts to search TDM asset files and published FMs for compatibility problems when we do changes to the game. They parse text using regular expressions. I'll paste the code in case you want to mess with it. This was a quick fix because I just had to adapt a procedure I already had.
 
The first file mapparse_general.py searches a TDM installation including inside pk4s and FMs, and generates the filenames and their contents. The second one parses .def files and constructs an inheritance tree of entity defs, then uses that to print out the spawnargs of all entities that inherit from tdm_ai_base.
 
mapparse_general.py

Spoiler

 
 
ai_spawnarg.py
Spoiler


#8 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 14 January 2016 - 04:25 AM

Thanks for the scripts and the explanation. I just remembered, I already have a python script, that you made, for searching various file types for specific terms. I used it for the transparent AIs (that I also have not completely finished,yet :wacko: I should probably not get any more projects to work on here... Well, we'll see). If the output files look similar to the one you posted before, it should be no problem to import them into excel, which will save a lot of time :smile: So, thanks again!



#9 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 19 April 2016 - 11:08 PM

Since I am currently stuck with my WIP, I decided to continue this project. However, the scripts SteveL posted do not seem to work. When I run them with IDLE I get the following error message:

 

For the mapparse script:

Traceback (most recent call last):
  File "C:\Users\Destined\Desktop\mapparse_general.py", line 131, in <module>
    defs = getDefs(GAMEPATH, exclude_fms=True)
  File "C:\Users\Destined\Desktop\mapparse_general.py", line 118, in getDefs
    for fname, text in mapparse_general.findTDMFiles( [path] , exts=['.def']):
AttributeError: 'module' object has no attribute 'findTDMFiles'

 

And for the ai_spawnarg:

raceback (most recent call last):
  File "C:\Users\Destined\Desktop\ai_spawnarg.py", line 131, in <module>
    defs = getDefs(GAMEPATH, exclude_fms=True)
  File "C:\Users\Destined\Desktop\ai_spawnarg.py", line 118, in getDefs
    for fname, text in mapparse_general.findTDMFiles( [path] , exts=['.def']):
AttributeError: 'module' object has no attribute 'findTDMFiles'

 

How can I fix that? Thanks in advance for the help!


Edited by Destined, 19 April 2016 - 11:09 PM.


#10 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 20 April 2016 - 12:50 PM

I don't know why it can't reach the mapparse function. Maybe I screwed up the syntax somehow, although I usually make it clear if I post code without testing it.
 
You could avoid the problem by merging the two scripts. 
 
Start with ai_spawnarg,py
Add zipfile to the list of imports
Paste the 2 functions from mapparse_general above the functions in the ai script. 
 
I mean like this (not tested but hopefully ok):

Spoiler

Edited by SteveL, 21 April 2016 - 09:04 AM.


#11 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 21 April 2016 - 01:59 AM

I just tried the new script, but I still get an error message:

 

Traceback (most recent call last):
  File "C:\Users\Destined\Desktop\ai_spawnarg_v2.py", line 157, in <module>
    defs = getDefs(GAMEPATH, exclude_fms=True)
  File "C:\Users\Destined\Desktop\ai_spawnarg_v2.py", line 144, in getDefs
    for fname, text in mapparse_general.findTDMFiles( [path] , exts=['.def']):
NameError: global name 'mapparse_general' is not defined

 

By the way: The path for TDM is "E:\Spiele\Stealth\TDM" for my PC, so I have changed line 4 to GAMEPATH = r"E:\Spiele\Stealth\TDM". I don't know, if this might cause problems.

 

If it won't work, I will just export the def files into excel, as I originally planned.



#12 Agent Jones

Agent Jones

    Member

  • Member
  • PipPip
  • 46 posts

Posted 21 April 2016 - 05:42 AM

It works for me after deleting "mapparse_general." from line 144



#13 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 21 April 2016 - 09:04 AM

It works for me after deleting "mapparse_general." from line 144

 

Oops I missed that one. Thanks, I corrected it above.



#14 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 21 April 2016 - 12:01 PM

Yep, now it works :) Thanks, Agent Jones for helping, and SteveL for the script. Now I can start sorting and writing...



#15 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 21 April 2016 - 01:29 PM

I finally tried this code myself, and I've added a couple of new settings at the top of the script:
  • DEBUGMODE = False
  • INCLUDE_INHERITED_SPAWNARGS = True
  • INCLUDE_DR_HELP_TEXT = False
  • Setting DEBUGMODE to False suppresses screen output. You just get a single-line confirmation at the end, plus the .csv file that you can load in your spreadsheet. That makes the script run much faster.
  • Setting INCLUDE_INHERITED_SPAWNARGS to True will show all inherited spawnargs, so you can see the full list that each AI def uses. There's a fourth column in the output that tells you whether the spawnarg is inherited or not so you can filter them in your s/sheet.
  • Setting INCLUDE_DR_HELP_TEXT to False will hide any "editor_*" spawnargs.
Warning: including inherited s/args and help text means you'll get 500k records! Without the help text but including inherited spawnargs, it's about 250k.
 
Spoiler


#16 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 21 April 2016 - 01:49 PM

Thanks for the modifications! I have already started sorting, but I think the modifications make sense, so I will start over again (was only half an hour so far). That way, I maybe get the consistent lists for most of the characters.

 

So far my idea was to make the Wiki article two parts: The first is intended for players and only includes stats that are relevant for them (e.g. health, damage, etc). The second part is intended for map authors and includes other spawnargs (e.g. attach positions, niticing chances etc.). But first I will have to sort a lot of data...

And if I am motivated enough I will also update the Spawnargs list in the Wiki, including explanations. Maybe categorise them, so they are easier to find. But first things first.



#17 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 21 April 2016 - 02:20 PM

Cool. I haven't a clue how to put all this information into a readable article tbh, and it might be better to leave the inherited spawnargs out. They mean 100s of 1000s of duplicated spawnargs. Maybe you could structure your article around the inheritance tree, so you need only quote each distinct spawnarg once.  

 

If you find yourself faced with a massive manual task at any point that could be automated, feel free to ask for a script change :)



#18 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 22 April 2016 - 03:14 AM

I know what you mean. With the last script I got 1800 spawnargs for each AI. Still, for now I will leave the inherited stats and maybe we can somehow provide the whole list for the interested reader. For the Wiki article it might be a good idea to have a section with "general stats" that are identical for each AI of a subset (e.g. "Team" should be identical for each faction, as this is basically its definition...). But this will also come later.

 

This evening I will sort the AI by faction. Then I will alphabetise the spawnargs and see that I can get the same order for all AIs. When I have done that I only need one column with spawnarg names, so it should be a lot clearer. After that I can have a look, which spawnargs I deem of higher interest (e.g. the footstep sound is not that important for players or mappers). With that I will see how many are left and from there I can start thinking about how to best structure them. I am not really positive that I can get that all done this evening, but it sounds doable. Also, this weekend I will visit my mother in law, so there will not be too much progress then. Anyway, I will keep you posted on how it goes and ask for your opinion on the spawnargs I want to include.

 

Thanks for your offer, but I believe scripts won't help for the work that comes now. But they already helped a lot! Having to manually extract the spawnargs from the def files would have been horrible (especially after I saw how many there actually are).



#19 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 22 April 2016 - 12:35 PM

So, I am done sorting the AIs by faction. It is interesting to see how many different AI there are. Very impressive guys! I have divided them into the following factions:

Builders (9 AIs)

Townsfolk (24 AIs)

Undead (14 AIs)

Thieves (10 AIs)

Monsters/Animals (15 AIs)

Guards (17 AIs)

Steambots (3 AIs)

Trainer (22 AIs)

Pagans (3 AIs)

Mages (4 AIs)

Moors (3 AIs)

 

These are each seperately defined AIs and do not inclide different skins. As I said: very impressive :)


  • SteveL likes this

#20 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 22 April 2016 - 02:24 PM

Trainer (22 AIs)

 

I wonder what those are? Do we have a separate AI class for the training mission?



#21 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 22 April 2016 - 02:40 PM

I think we have. These are the names and they sound like melee training:

 

Spoiler

Edited by Destined, 22 April 2016 - 02:42 PM.


#22 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 30 January 2017 - 05:55 AM

Being reminded through another thread that I started this project quite some time ago (OMG, it is already a year) and having forgotten about it :unsure: , I went through the documents I already made for this and found an excel table, that contains all the spawargs and one example of spawnargs I would include. I have to admit that for a lot of spawnargs I have no idea what they actually mean, but came to the conclusion that most players will most likely also not know, which is why I simply ignored them. My current plan would be to make a table with an explanation of the individual spawnargs and after that transfer the structure to the AI sorted by faction. I already know, that the page will be very long, but still I will try my best to make it as clearly as possible. For the explanations, I most likely will need help from someone who knows the mechanics (like grayman) so I can explain the exact influence of some spawnargs (like acuity). For now I have picked the following 70 spawnargs to be included in the table. If anyone thinks something is missing or superfluous, just tell me.

Spoiler

Edited by Destined, 30 January 2017 - 05:58 AM.


#23 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36405 posts

Posted 30 January 2017 - 09:10 AM

You should find most of these on the wiki if you search around.



#24 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 31 January 2017 - 12:25 PM

Thanks, Springheel, I found a couple of formulas, but I am not 100% sure if I include them, as I in part don't really understand what's going on (maybe I am also missing some part). I will use the "editor_bool" descriptions as they usually give a good insight into what the respective spawnarg does.

 

While working on this list, I noticed a small mistake in one description: for "is_mantleable", the editor_bool states: "If set to 1, this entity is not mantleable by the player. Defaults to 0.", but I think it should read "If set to 1, this entity is not mantleable by the player. Defaults to 0." I know this is just nitpicking, but I thought if I find mistakes I might as well point them out (especially if this is just such small stuff that needs deleting a word in one def-file).



#25 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1253 posts

Posted 01 February 2017 - 04:14 AM

I have just saved the first part of the AI stats page http://wiki.thedarkm...?title=AI_stats with the explanations of the spawnargs I want to cover and the following structure I would appreciate any criticism regarding the classification of the spawnargs (if I have classified all correctly or if someone finds a better classification)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users