Light Style© by Fisana

Jump to content


Photo

A challenger appears : Marilyn (Yet-yet another AI)


  • Please log in to reply
159 replies to this topic

#81 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 26 February 2012 - 12:03 PM

That is weirder. This should work:
if (!unit || (unit && !unit.position()) ){

  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#82 Pureon

Pureon

    Primus Pilus

  • 0 A.D. Art Team
  • 3,508 posts

Posted 26 February 2012 - 03:47 PM

That is weirder. This should work:

if (!unit || (unit && !unit.position()) ){


Sorry wraitii, that still didn't fix it. But this time ignoring the errors I continued the game and had 2 Marilyn bots attacking and raiding my base from all sides until the lag (probably partly to do with the errors) caused me to stop the game. Very ferocious bot :)
  • 0

Pureon
0 A.D. Part time Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com


#83 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 26 February 2012 - 04:52 PM

This error is confusing me... I'll look into it. I'm not sure what's causing the lag... The economic manager has been sped up quite a lot, but there is something in my attack plans that lags terribly...

Btw, what map were you playing?
Anybody noticed that Hellenes cavalry raid specifically target your villagers?

Edited by wraitii, 26 February 2012 - 05:06 PM.

  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#84 Pureon

Pureon

    Primus Pilus

  • 0 A.D. Art Team
  • 3,508 posts

Posted 26 February 2012 - 05:35 PM

Btw, what map were you playing?
Anybody noticed that Hellenes cavalry raid specifically target your villagers?


I've been testing Marilyn on Spahbod's new random maps (on the svn now). The last 2 maps I used were 'Lake' and 'Phoenician Levant' - and I didn't use Romans or any island maps.

I noticed the raids were focusing on villagers - that worked well. The raids could be less predictable - smaller groups of attackers, maybe even 2-3 cavalry units minimum - enough to disrupt normal economic build-up. The few raids I saw involved around 10 cavalry units. I often disrupt the AI's early economy with 1 cavalry unit.
  • 0

Pureon
0 A.D. Part time Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com


#85 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 26 February 2012 - 05:47 PM

Yeah, that comes from me sucking at this game so I don't really know what's efficient enough. I guess 2/3 units would indeed be better, but it might require a bit cleverer movements from the AI to not get his units killed in a few seconds, which I do not have right now.

I'm trying to improve the performance of my plan managers but it's proving harder to do than I expected... I'll look into the "defense error" thereafter.

edit: can't seem to reproduce the error you're having... Any details on how to do so?

Edited by wraitii, 26 February 2012 - 06:20 PM.

  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#86 Pureon

Pureon

    Primus Pilus

  • 0 A.D. Art Team
  • 3,508 posts

Posted 26 February 2012 - 06:35 PM

edit: can't seem to reproduce the error you're having... Any details on how to do so?


I'm using a clean version of the svn, so it can't be any other changes causing it. Try Marilyn as Persians... and then maybe 10 minutes in to the game, when Marilyn is attacking, the errors begin. Is Marilyn on github?
  • 0

Pureon
0 A.D. Part time Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com


#87 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 26 February 2012 - 06:42 PM

Not as of now... I'll try to reproduce the error anyway, since it's fairly bothersome and I have reasonably sped up the attack plans.
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#88 UV_Completion

UV_Completion

    Discens

  • Community Members
  • Pip
  • 16 posts

Posted 26 February 2012 - 07:38 PM

That is weirder. This should work:

if (!unit || (unit && !unit.position()) ){


I have no knowledge at all about Java script but is the evaluation of such expressions fixed by the standard? I.e. is unit && !unit.position() evaluated from left to right and is the evaluation stopped if unit==false (without checking the second condition)?
  • 0

#89 Pedro Falc„o

Pedro Falc„o

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 651 posts

Posted 26 February 2012 - 08:00 PM

I have no knowledge at all about Java script but is the evaluation of such expressions fixed by the standard? I.e. is unit && !unit.position() evaluated from left to right and is the evaluation stopped if unit==false (without checking the second condition)?


If javascript is like java (and very likely is), then all operations are read from left to right. So (suposing the operations are all java-like) the computer reads as following:
if unit is not true or (unit is true and unit.position() returns false), then...

  • 0
Pedro Falc„o
Latin: Petrus Falco; Literally means 'Stone Hawk'.
English equivalent: ' Peter ';


Undergraduate Computer Scientist by UFCG
Shotokan Karate Adept, 3rd Kyu (Green Belt) & Muay Thai initiate

#90 quantumstate

quantumstate

    Primus Pilus

  • WFG Programming Team
  • 1,150 posts

Posted 26 February 2012 - 08:12 PM

I have no knowledge at all about Java script but is the evaluation of such expressions fixed by the standard? I.e. is unit && !unit.position() evaluated from left to right and is the evaluation stopped if unit==false (without checking the second condition)?


Yes, javascript does work in this way, with an || if the LHS is true then the RHS will not be executed and similarly with && if the LHS is false the RHS won't be evaluated. The first code
if (!unit || !unit.position() ){

that wraitii posted should work in an identical way though.

  • 0
Jonathan Waller [ aka quantumstate ]

Wildfire Games Programmer
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!

#91 Sonarpulse

Sonarpulse

    Sesquiplicarius

  • Community Members
  • PipPip
  • 166 posts

Posted 27 February 2012 - 01:25 AM

Yeah, making an AI work properly for absolutely trivial tasks such as where to build a mill is what makes you realize the human brain is amazingimpulsive.

Fixed. :D

Is Marilyn on github?

Not as of now...

Working with an interpreted language, I can see how you wouldn't haven't bothered to release your code separately. But as this AI grows, you will probably run into regressions, and then version control will be invaluable. (If you are using a local git repository or something similar, my apologies.)
  • 0
Posted ImagePosted ImagePosted Image

#92 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 27 February 2012 - 09:51 AM

I am using a local git, but I'll likely go online at some point.

@Pureon: I still find myself unable to reproduce this error... I guess I'll leave it alone for now, if it happens to you again and you have more information about what happens, I'd be very glad.
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#93 Pureon

Pureon

    Primus Pilus

  • 0 A.D. Art Team
  • 3,508 posts

Posted 27 February 2012 - 12:45 PM

@Pureon: I still find myself unable to reproduce this error... I guess I'll leave it alone for now, if it happens to you again and you have more information about what happens, I'd be very glad.


Sure thing. If it happens to me again I'll try to provide you with more info. I still think it has something to do with garrisoning - I use it a lot during raids/attacks.
  • 0

Pureon
0 A.D. Part time Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com


#94 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 29 February 2012 - 10:58 AM

Okay, a new version. Changes:
-Attack plans overhauled, started less frequently, more reliable, more efficient. Allowed raiding for any civ. Also added an option to "stay close" when attacking.
-tons of little optimizations here and there, and bugfixing. Optimization was needed since I now call Marilyn every two turn and not every 8 turns (like qBot)
-Defense manager also more reliable, able to detect when to stop pursuing (no more "a whole army chasing one unit on the whole map"), better at a few stuffs, generally more efficient.
-further overhaul of the worker assigner functions. It's factored by the gather rates, though this may be hard to notice
-Changed a few stuffs in the building orders and the priorities of the AI for better play.

Technicalities:
-added a function for bartering, though I haven't used it yet.
-implemented a few stuff from svn qBot.

The AI is now called every two turn, instead of every 8 turn for qBot. This is balanced by the fact not every function is called every turn, and tons of little (or fairly big) optimizations everywhere. testing against Svn qBot, it is more "frame efficient".

You should notice a much better ability at defending from the AI, though it may have a bit of troubles actually attacking.
Download Link

I'll soon be working again, so I will have much less time... Hopefully I'll be able to carry development on a bit. I'll need roman support, better attacks (this is really the one area where much work is needed), and ship support.
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#95 gameboy

gameboy

    Duplicarius

  • Community Members
  • PipPipPip
  • 263 posts

Posted 29 February 2012 - 11:34 AM

Congratulations, my friend, this is a great step forward!:banana:
BTW: Next, you will do?
Solve the problem of game lag? Is QBot caused by lag.

Edited by gameboy, 29 February 2012 - 01:28 PM.

  • 0

#96 Mythos_Ruler

Mythos_Ruler

    Megas Philhellene

  • 0 A.D. Project Leader
  • 14,877 posts

Posted 29 February 2012 - 06:09 PM

Get an AI error when I garrison a target unit.
  • 0

Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader

Contact me: michaeldhafergmailcom

 

Support Wildfire Games!

 

10298.png


#97 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 29 February 2012 - 06:27 PM

Might be related to Pureon's error... That is, you garrison a unit under attack?
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#98 Mythos_Ruler

Mythos_Ruler

    Megas Philhellene

  • 0 A.D. Project Leader
  • 14,877 posts

Posted 29 February 2012 - 07:19 PM

Might be related to Pureon's error... That is, you garrison a unit under attack?

Yep! Keep getting a bunch of errors until I ungarrison them.
  • 0

Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader

Contact me: michaeldhafergmailcom

 

Support Wildfire Games!

 

10298.png


#99 wraitii

wraitii

    Primus Pilus

  • WFG Programming Team
  • 1,495 posts

Posted 29 February 2012 - 09:26 PM

That seems to indicate I have forgotten some code somewhere, which is likely. Hopefully I'll be able to find out, thanks.
  • 0
Lancelot de Ferrière le Vayer [ aka Wraitii ]
Wildfire Games Programmer, AI developer, auxiliary map designer, dealing with anything water.
Contact me: wraitii@wildfiregames.com

Also the world's only three-dimensional poodle.

#100 Pureon

Pureon

    Primus Pilus

  • 0 A.D. Art Team
  • 3,508 posts

Posted 01 March 2012 - 12:21 AM

New error to report: http://pastebin.com/1wv5dDh6 This one appeared after I began attacking. I wasn't attacked or raided, so didn't garrison my units at any point.

Marilyn may have got stuck - it didn't defend its territory or itself when I finally invaded. I had 3 fortresses and it had only just started to build a barracks:

Posted Image

Hope this is somehow useful :)
  • 0

Pureon
0 A.D. Part time Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com