Jump to content

rjs23

Community Members
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by rjs23

  1. It seems your resolution is bit too low (looks like 800x640 to me). Increasing resolution might resolve the overlaying buttons issue
  2. That explains it. I was using soldiers, not a female worker. I had it mixed up, my apology for the confusion. I reproduced this and it confirms what you're saying. So, it depends on unit's target attribute for formation to work? Shouldn't it be using have its own attribute instead of sharing with target attribute?
  3. As i was trying to track a unit's target ID, I found a weird behavior in how its target ID changes. Every time a unit was order to attack or gather, its target ID given is valid thus does not cause unknown entity ID error yet. However, when a unit was assigned a "move" command after it was assigned to gather/attack any object, its target ID changes to the new number to where entity doesn't exist in entity array given by gameState. It simply does not exist, and it returns undefined, yet the number keeps increasing... What concerns me is that there may be a memory leak or possible undetected bug in this system. Because each time order a unit to gather something then order that same unit to move, the target ID are new and does not seem to be found in entity array. Each time you repeat this command (gather, then move, then gather, then move) the target ID keeps increasing over and over but no entity for it exists which may cause some errors in AI bots that are trying to track entity's targets. I'm not sure but it seems illogical to assign target ID to a unit under moving command. The correct value would have been left undefined, in my opinion, each time you order a unit to move. It shouldn't return nonexist entity id. The scenario looks like this: (I used "Display selection state" to prove this) 1. Order a female to gather tree. Its target id is that tree id (458 in this scenario) 2. Before it gathers that tree, order the female to move near that tree (target id changes to 1250, which is undefined according to gameState.) 3. As it moves, order it to gather that same tree (target ID then changes back to 458) 4. Then order it to move to near that tree again (target ID changes to 1251, notice how the target ID keeps increasing each time you order a unit that was previously under ordered?) 5. Gather it, (changes back to 458) 6. Move it. (changes to 1252). Each time you order a move command that was different than its previous command, its target ID increases for some reason. I'm just advertising this weird finding. It might lead to memory leak or unexpected logic behavior. Is this normal or is this a unintended behavior? Edit: When I restart the game (by clicking X on window and restart it) , this bug disappears. I could not reproduce it anymore. It seems like this bug is triggered by something.and causes the UnitAI to act incorrectly.
  4. lol, oh noes! I'm denying creating this thread now! Anyway, I only heard that female worker can enhance the gathering rate but I don't know if it actually applies to construction rate. I'll have to look into that, since I'm not sure. Glad you brought that subject up because thats something I could add to my AI project if that is indeed the truth about female boosting male in construction.
  5. I've noticed that female workers seem to construct at the same rate as the citizen soldiers would construct. I find it odd, especially when female were not equally capable as soldiers when it comes to building in real life considering they had more trainings and workout than female workers. Soldiers should be able to build faster. Their construction rate could be based on their strength (weapon damage perhaps?) and their energy (used for running?) instead of static flat rate. As they build, their energy goes down slowly. When energy are depleted, they build perhaps at the same rate as the female. Lost energy recovers overtime.
  6. Steps to reproduce this glitch: 1. Change Match type to random (can be any random map) 2. Assign player 4 as You 3. Change Number of players from 4 to 3 4. Start game 5. Let it load, 6. GUI and gameplay glitches appear badly. The errors are filling up rapidly! I was unable to exit the match therefore had to close 0AD. Screenshot: http://img1.uploadsc...480051-orig.jpg Happened in SVN build. Was trying to step up a match for bot vs bot
  7. What about white fogs that greatly hinder visibility and make predators like lion or boar hard to detect? They mostly come from nearby lake or springs. http://www.outdoor-p...to/1815801.jpg.
  8. I would have to track it. Like, when I start researching something. I would append it to array called TechnologyBeingResearched. Not reliable because what if building that was researching it was destroyed and didn't finish researching it? AI would still think it sucessfully researched that. But for now, I think that would good enough.
  9. I noticed there is research command in helpers/command.js. Is it safe to use that to force AI to research? I already use rally-setpoint from it and it works but am not sure if it's ready for to use case "research": yet? I'll add it to play around with it but it seems this would let AI research any technology without restriction.
  10. It only happened to me once, it didn't reproduce itself yet. It was default map size with 2 bots and 1 player (me) I'll create a ticket as per your wish.
  11. @ wratii: I'm so glad u pointed out for those events! I've reworked part of my scripts to take advantage of that and it made my bot lag less. @ hirovard: There is a pop cap. It's at 300 at the moment. As for crashes, if it crashes then you've already lost to AI. The AI are clever enough to keep spamming them until to the point where game ends. You must defeat the AI before it crashes 0AD.
  12. Indeed. I tend to be vague sometimes.
  13. Ah, I see. Thats good enough! I have one more: 3. Let AI assign an "onChange" function callback to engine that calls this function every time its target ID is changed or its orders are updated. Each time its properties are updated, the engine would call that function callback letting AI know its orders or target ID are changed.
  14. As I'm working on my AI bot and trying to keep it efficient in term of performance, there are some improvements that would benefit 0ad AI system greatly, especially in performance: 1. Currently, the AI bots has to loop through all entity objects to keep updating itself about its changes every turns. Once you store entity object to the variable, its properties doesn't always remain up-to-date. To update its properties, you have to keep updating the entity variable each loop. What if I want to update only one entity without looping through the objects? It would be very unefficient to go through loops just to find one or two entity to update its properties. This hurts performance, especially when it has to update itself everytime for each turns. It is fast, but wastes performance unnecessarily. My proposed solution: add a native function that accepts entity's ID as the argument and returns it's entity object properties directly from game Engine. 2. Please, add a function or class that directly informs the AI bots that a new unit/object has just generated from game engine. Same thing when a unit or object becomes deleted from the map. This will also help with performance area and reduce the need of managing of each entity status through loop. I've seen some AI bots going through loops every turns just to find out if there is an new entity or not. By having game engine directly informing AI that new/removed objects has occured and return its entity can eliminate the need to loop through entity. See post #2 3. I don't see how to program AI bot to train technologies. Is it too early for that? Edit: might have some more later
  15. I'm interested in AI discussion too That is my goal that I'm currently trying to achieve while also keeping the performance cost low for human players to enjoy smooth gameplay. I feel that 0AD AI system are advanced enough but unstable (there are bugs, like some unit classes aren't informative enough for AI to understand the type of unit and its purpose. Example: shipwreck treasures on water currently does not have a class to tell AI thats its water object). There are many improvements to be made in its AI system and I'm sure it takes decent amount of developers' time to program them. As for automated commands, like patrol and escort, some of them are already capable in AI only at the moment but the drawback is you have to program them manually instead of using it natively which could lead to instability in future releases.
  16. Figured as much, so its this map that is doing it right? Not other map has this bug?
  17. http://img1.uploadscreenshot.com/images/orig/8/21507302655-orig.jpg There are two chickens inside the building. One of the chickens died because one worker managed to reach it and killed it but could not gather it after it got slaughtered. As seen in the picture, they're all gathering around it trying to approach it closer but they could not get any closer due to building obstruction. I don't know how chickens got inside the building (not literally, but somehow it managed to get inside building's obstructions area). It seems like a bug that rarely occur and sorta hard to reproduce. I was playing random map: Alpine Lakes.
  18. EntityCollection.prototype.addEnt EntityCollection.prototype.removeEnt They add/remove entity to/from the entityCollection right? When I try to use removeEnt function from the entityCollection, i will get an error that says ent.id() is undefined. I'm trying ot oragnize an entityCollection and filtering out the useless one and save it later for future reference but base.js() keeps messing up for some reason. addEnt works fine for me so far but it seems removeEnt may be broke? I don't know, it may be my error. Edit: I'm using common-api-v2 I'm trying to use removeEnt to keep the alive units only. When they die, removeEnt will be called to remove them. Edit2: It's not really big of a problem but I'm just curious if those thing usable and stable enough for AI people.
  19. Note: other/special_trasure_shipwreck_debris, and other shipwreck treasures does not have class to tell its water object. What is the most correct way for AI to determine that this is a water object and not land? I don't see a class object from it that says its a water object. I could do it by template name, but I'm afraid that could lead to instability in long run... Fish has a class called Sea Creature and thats what I'm using in my bot to tell its a water related food.
  20. I managed to gain understanding to AI system, so it wasn't too hard. Those doc gave me basic understandings about how gameState works and stuff, but yea it needs more stuff to it. It wouldn't be too bad to have an indepedent thread for each AI to use. Would make the game with qBot (yours) and juBot and demoBot more playable during late game. I'm still exploring around. I'm using common-api-v2, playing around with juBot which my bot is based off. (juBot lags bit too much for me. Modified how it works a bit and works smoother for now.) Right now, I'm trying to determine how to find out if a unit/object is dead/deleted from the game. entity.position() doesn't seem to do the trick since they aren't updated when they die. registerUpdates() might be something that I am looking for. Baby-step at a time!
  21. Ok, thats no problem. I'll just get used to it, and fix it later I suppose. in gameState.getOwnEntities function, what does ent.foundationProgress() do? Does it return boolean if a unit iss within town radius? Edit: Nvm I seew what it does. Thats good.
  22. I used player_defaults.json. That works. I changed AI setting to the name of my bot name. Is there an option to disable outputting warning such as: WARNING: JavaScript does not always return a value.
×
×
  • Create New...