Results 1 to 3 of 3

Thread: Unit testing tool through modding

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Unit testing tool through modding

    Hi, everyone.

    I want to throw in suggestion which I posted on official forums to see if anyone knows if it can be achieved though modding.

    Here the thread: http://forums.totalwar.com/showthrea...esting-routine

    Here the suggestion:


    Today I want to raise a topic of unit testing (in both programming and game world sense). I am not sure what tools used by CA team to test units behavior internally, but I believe if this process isn't automated - it should be, and if it is - we should get access (at least limited) to similar tools.


    I am talking about tools that will allow to run typical engagement scenarios automatically. It should allow to pick a map, place certain units on specified positions and engage them. There are should be hooks for some events (enemy in range, unit engaged, etc). All those things are already in the game, since they are necessary for AI work. We at the moment have to do it manually, which is absolutely unnecessary waste of time and attention. When idea of test is finalized constant human control shouldn't be necessary.


    What will happen if such tool exists:

    • we will develop set of test cases for known bugs and showcases of working mechanics;
    • we will run those test after every patch;
    • looking at result we will be able to tell if something got broken;
    • we will be able to easily share this scripts and send them to CA if necessary.





    Here mock-up of unit testing script:


    Code:
    pick_map(X, Y)
    # test 1
    a = add_unit("Oathsworn", team = 1, position = (xa, ya))
    a.set_formation_depth(8)
    b = add_unit("Praetorian Guard", team = 2, position = (xb, yb))
    b.set_formation_width(20)
    
    
    a.attack(b)
    wait(100)
    b.attack(a)
    
    
    a.on_event("engaged", a.activate_ability(frenzy))
    
    
    end_report("test1.txt", a.state(), b.state())
    end_save_replay("test1.replay")
    
    
    refresh()
    
    
    # test 2
    a = ...
    Possible negative effects:

    • some smarties might end up writing bots for MP, so it should be strictly limited to custom battles;
    • it will speed up game universe research (which isn't that negative, to be honest, since most will still be discovered quite soon in much less convenient ways)



    Thank you for your attention and sorry for taking your time^^

  2. #2
    Hetairos's Avatar Roma Surrectum II
    Join Date
    Jan 2014
    Location
    Serdika
    Posts
    1,511

    Default Re: Unit testing tool through modding

    +1 testing is a pain.

    Even a small "arena" map would be enough for me though to test unit strength and balance aka not having to walk 5 minutes till I reach the AI who than s up the test because of strange behavior

  3. #3
    crzyrndm's Avatar Artifex
    Join Date
    Feb 2011
    Location
    New Zealand
    Posts
    2,576

    Default Re: Unit testing tool through modding

    http://wiki.totalwar.com/w/Historica...ng_Information

    All the documentation you could ever need. Use Teutoburg scripts for examples.
    It’s better to excite some and offend others than be bland and acceptable to all
    Creating a mod.pack with PFM - Database Table Fragments

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •