Jump to content

Badmadblacksad

WFG Retired
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Badmadblacksad

  1. I thought I should link this thread to this trac ticket http://trac.wildfire...com/ticket/865 My main concern is about the code in UnitAI.js which will grow steadily throughout the development process. If its not clean now, It will become a real mess over time. So, I've got a few questions concerning simulation: 1/ Is there any requirement of maintaining C++ source as small as possible ? should I create new C++ functions when I need them or try to uses a javascript wrapper instead ? e.g. if a C++ function take entity's position as parameter but that it's easier for me to call it with entity's id, can I overdefine it and expose it ? 2/ If I need to compute the distance between two entities, should I do it in CCmpPosition.cpp (+++), UnitAI.js (-) or in any helper.js (+?) file ? 3/ Is it possible to see how much time takes UnitAI to run ? (benchmarking purpose) Theses questions will probably seems stupid, but.. need answers (I will take them as a guideline) in order to code remorseless and enjoying it
  2. here is an answer to your first question : for the second, you will have to add a new function to entity.js and entitycollection.js, like the move() one but with "attack" instead of "walk". If you don't want to attack a specific entity, the move() function should be fine (Jubot uses it).
×
×
  • Create New...