Jump to content

rjs23

Community Members
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by rjs23

  1. Glad to see a new version of api and its improvements! I'll build a new ai from scratch using common-api-v3 during christmas break!

    Edit: when you say ' apply the patch' after you update AI bots in AI folder, what do you mean? Apply with what? I'm a newbie with C programming so bear with me. I'd like to try out this api and play with it.

  2. Heres the new update for the new AI bot.

    It shouldn't crash anymore after finishing a dock, and economic management is improved (less stupid decisions).

    It should be a stable at this point.

    It still does not train any units yet. It does not perform any military action yet.

    It will be the last update for a while.

    I won't be as active as I am in 0AD community or the AI bot I'm working on anymore (I no longer have much free time anymore :( ). But I'll work on it every once a while when I can. I still enjoy working on the AI to have fun with it sometimes.

    I won't be on IRC much but I'll check the forum once a while. Hopefully I'll be active again next summer!

    Edit: this ai bot is not a fully functional AI bot. I'm only share this for the interested AI developers.

    Good luck!

    simulation.zip

  3. I think there shouldn't be a maximum distance for tunneling. You're already paying for it (since its based on length like you said.)

    This could be used as a tactic to counter against people that are rushing civic centre near your civic centre. You can't train seige until phase 3, and you have poor defense against rushers that slowly invade your base overtime while you're also losing your soldiers trying to defend your base.

    Whether you can see the tunnel creeping across the ground or not is a matter open for discussion. Perhaps the digging player can see it so they can see the progress, while the enemy players cannot. The enemy players just see the shed and think "Oh no, a sap point... need to destroy it asap!"

    I think there could be a small chance (like 2-4% chance times the units weight standing above the tunnel ) that terrain would deform into tiny ravine shape and damage any affected units by some percentage.

  4. I find it funny being able to move sheep without a worker controlling it nearby. Naturally, sheep doesn't do what we command them to do so we force them to do (pushing, scaring them off to make them move, etc)

  5. There is a strange behavior how fishing boats behave after the fish resource is used up. I have my AI to reassign the fishing boat when it becomes IDLE but some fishing boat never seem to enter INDIVIDUAL.GATHER.IDLE at all. Instead it does the never-ending loop of INDIVIDUAL.GATHER.APPROACHING and INDIVIDUAL.GATHER.GATHERING (gathering what? there is no fish resource there anymore). Some won't enter IDLE status when fishing boat is sitting doing nothing. I have to assign it manually to reset the never-ending loop status bug.

    I've attached the saved file (it has my AI bot, but I think this behavior still occur without my bot). Remove .txt extension (board won't let me its orginal format otherwise.

    http://img1.uploadsc...050818-orig.jpg

    There used to be more but I had to manually assigned all but one (that in screenshot).

    This behavior could cause unexpected bug in AI with water units

    quicksave-0005.0adsave.txt

  6. Dont't get me wrong, but why don't you try it yourself? This is open-source...I myself made some experiments, but I never came to the point where I would show my code here in the forums because people would probably lough about it... but you seem to be more advanced, so why not doing it?

    My advise: don't be afraid of being laughed at. We're all newbies at some points. Being laughed at happens to almost everyone. If you want feedback about your experiment, you should feel free to do it. Don't let other people scare you of showing your work. To be honest, I don't think the community of 0 A.D would even laugh at anyone work. It's a good community here.

    Currently, 0 AD needs a better AI. It wouldn't hurt 0AD to have more AI.

    Moloas, you should try if you want to. ;)

    I would love to have more competition in AI section since I'm competitive-driven. It's like programming game to me.

  7. Random google grab for behavior tree or BT, I checked to make sure its decent:

    http://www.altdevblo...behavior-trees/

    Rule based AI is the probably the most intuitive. The original Glest uses a rule based system. Basically it has general directives like gather resources and produce units and then it has other things like when you have this, this is the finite state machine part, then do this. That might mean, when the game is 5 minutes in, and you have 10 units, send them to scout the enemy base. This system tends to rely on the game knowing where your base is as well as likely expansions. So the scout part is basically hard coded to go to your starter base while checking any expansions in between. The AI is given specific rules, hence the name. Rule based is sort of like planner iirc.

    I believe that 0 A.D. is set up for a rule based or hierarchical system. It may also be a planner, this is my impression from posts here and playing the game, I don't look at the actual code cause its time consuming.

    Here is a more complete list of AI frameworks:

    • Ad-hoc rules
    • Finite State Machine (FSM)
    • Hierarchical FSM
    • Behavior Tree (BT)
    • Planner
    • Utility-based system
    • Artificial Neural Network

    If i understand correctly, I would say that its mixtures of:

    1. Hierarchical FSM or Behavior tree, (example: if there is a building foundation and this worker is capable of building it, then assign this worker. If not, then make this worker to gather something. This also can be events-driven type of action )

    2 .Planner (example: picking which buildings to be used that are best for this civilization then customize the AI behavior later on ) This would usually happens initially.

    3. Rule based (example: worker can't build too far, worker can't gather resource far away, can't build dock if there is no fish)

    So far it would be Planner at the start of the game, then it would become combination of FSM/Behavior Tree/Rule Based ai format. That's how I would see in my AI once it evolves.

    I hope that answered to your question. :boredom:

    One file of your code is formatted badly but the rest looks pretty typical I guess. I don't know specifically what various functions do but based on the name you can sort of guess.

    I expect it to be vague lol. its formatting reveal what kind of habit I have: laziness :lol2:

    I don't expect people to use my code at this point because, well, its very immature at this point.

  8. Not at all, but atm it doesn't have the ability to train any worker/boat yet. I'll add that later on as the AI stabilize first. It's work in progress and also, I haven't fully planned how it should train effectively yet (I need to play 0AD more to learn its gameplay better before I do add it to AI)

    However, if you train the worker/boats for the AI, then AI will do the rest.

    Other than that, lots of debugs warning and sometime other strange warnings.

    How do you want me to upload AI's files?

  9. If anyone wants to try something, download the attached file and copy it to the game's binaries/system directory, replacing the old one. This only applies to Windows users of course, I'm curious if it will solve any of the problems or create new ones.

    This created more problems for me.

    Whenever I start a new game, it crashed first few seconds.

    Now when I applied that OpenAL32.dll to my binaries/system and run the program again,

    Instantly, I get this:

    http://img1.uploadsc...481327-orig.jpg

    Using Windows 7 premium 64 bits with AMD a8-3850 processor.

  10. I wonder, can we make the bridge to raise up (to let boat go through), or to release it back down so land units can go over the water by using a toggle button (similar to Wall Gate building in SVN (Soon to be alpha11?)?

    That way, when its raised up, the terrain that bridge was covering is now a water type. When bridge release it back down, the terrain is no longer a water (therefore boat can't pass it) but now land unit can walk over it.

    • Like 1
  11. If you have updating entity collections then dead units will be auto removed. When using removeEnt you must pass it an Entity object. Common-api-v2 is used by all of the current developed bots so should be stable.

    I found out why it wasn't working. It turns out that events (when an unit gets created, destroyed or attacked) are little bit confusing. In Created events, it uses different attribute than what Destroyed events use.

    In created events, I was using this script to gets its entity

    event.msg.entity

    but in destroyed events, its

    event.msg.entityObj._entity

    but I was using

    event.msg.entity instead of event.msg.entityObj._entity for destroyed events. event.msg.entity is not defined in destroyed events type but is defined in created events type. That's what threw me off.

    It confused me because I figured

    event.msg.entity would work fine with any events but in Destroyed event, it would returns undefined. That is why I was having problem with using removeEnt function because it was actually receiving undefined object. It's working fine now.

    Like you said, it must be an Entity object but it was passing as undefined.

  12. Sorry for the late reply. I'm slightly confused by this. You can already grab an entity by id easily, with qBot's I just call GameState.getEntityById(id). The system was deliberately designed to be able to desync the AI from the rest of the simulation, this will allow AI's oyu run in their own threads without needing to lock the rest of the game. For this it is essential to create a copy of the required state. Keeping the copy up to date doesn't take much cpu time you can easily see in the profiler (F11).

    Np about late reply, as least you replied. It brings clarity ;).

    I did not know about it. Clearly, I didn't study your AI script enough. Shame on me. I studied mostly on juBot's (to study its performance issues, and learn its flaws to try prevent my bot suffer same fate as juBot have.)

    I already created an function called getEntityByID in my bot script that achieves the purpose of returning updated entity object from ID, will try to remake it to use GameState.getEntityById() instead. Thanks for mentioning it. Should make it better in performance.

    Does SVN already let AI run in its own thread or does it still share with the UI's thread? it still seem to lock up the game little bit if I call something too many times like computing distance between entities which suggests that each AI does not lie in its own thread yet. Having Infinity loop like while(true) in AI script locks up the UI.

    I just prefer having updated copies of specific entities every turn, instead of entire entities of the match. I dislike having to update every single entity like trees or fishes for every single turn because it seems ineffective to me to re-update entity when they haven't change any properties. In my bot, I try to skip some entities that isn't needed for next few turns by containing an array of important entities ID and use getEntityByID (or will be GameState.getEntityById()) to get its updated entity properties. That way, it would try to free up MHZ as much as possible for smoother gameplay.

  13. I've experienced this odd behavior quite of bit while testing my AI bot, I can't seem to make out what actually triggers it yet. I'm pretty sure its coming from Engine's pathfinding and not from my script that is causing this behavior. I'm still investigating.

    So far it only happens during the GATHER.APPROACHING status. It sometimes pass its destination goal and touch a house then come back to its destination point and begin gathering.

    I'll report more findings as I observe more.

  14. New idea:

    Let AI be able to use team/ally chat and be able to retrieve chat inputs from player.

    For example, AI with teams (players) could interact and come up with a plan together.

    AI may output a team chat to its ally:

    "What plan you want me to do: (chat number option)"

    "1. Rush"

    "2. Boom"

    "3. [Let ai decide, uses ai's prefered methods]"

    The player would input a number (Enter, type #, then enter again to send chat) to choose the plans and AI would act according to the player's decision.

    By having this feature, AI could interact with human players and form a smarter gameplay environment.

    Edit: maybe combine it with UI?

  15. Wraitii kept working on Qbot XP - a new bot that will provide a greater challenge than its predecessor. How do we know for sure it is a greater challenge? Easy: Put Qbot and Qbot XP in a 1vs1 battle a couple of times and compare the results. Let's say Qbot XP came, saw and conquered.

    go qBot XP! Awesome to hear it!

  16. I find that not being able to reach on the top of the impassible cliff to be unrealistic. Same feeling that we're not able to build bridge over the water and we must use transportation ship instead.

    I propose a solution below:

    Without building flying transporation, we should be able to carve cliff's stone slowly into a stair that would grant an access to the top of the impassible cliff. It would take a while to accomplish based on cliff height. The stair placement has similar effects as dock placement but must be placed on cliff instead of shore.

    Example:

    http://guineveregets...irs-189x300.jpg

    http://apostrophethe...f-koko-head.jpg

    http://www.nationalg...512/1358013.jpg

    This would allow towers to be at higher ground and give more LOS based its ground height.

  17. Hmm I'm not sure we should disadvantage females too much. If all they can do is gather a few resources faster, but build slower, aren't able to place military or defensive building foundations, and on top of that have no attack, it seems too much disadvantage to even train them. It may be good for historical accuracy and realism but is it good for gameplay and balance?

    Actually as with gathering I would expect soldiers to become less proficient at building over time, despite strength, as they will be focusing on combat skills instead of carpentry :P

    What if there were some restriction, like at least one fifth of the population must be made of female workers?

    Hm, perhaps... combining with Pedro's statement:

    More female worker leads to faster training rates (because female enable population growth) but can't boost construction. No female worker could lead to penalized training rate.

    More cizitensolider lead to faster building construction but lacks boosting training rate.

×
×
  • Create New...