Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 2016-12-28 in all areas

  1. Might have to warn you that continuous investigation of code behavior might lead to bugfixes. http://trac.wildfiregames.com/wiki/BuildInstructions http://trac.wildfiregames.com/wiki/GettingStartedProgrammers I suggest though to lookup the components and templates in binaries/data/mods/public/simulation/ as it's much faster than a blackbox analysis. The buildtime depends on the number of workers, on the units that work individually (at least the code supports that) and the buildings HP. Also auras and technologies can affect the build rate - for example the female inspiration aura (10% faster males in the range of females). Most importantly, the more units are assigned to a building, the slower they work individually (hence some pro players build each structure with only one unit, so that the construction finishes just when it's economically feasible to use it at capacity). http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/Repairable.js#L74 Repairable.prototype.GetRepairRate = function() { let cmpHealth = Engine.QueryInterface(this.entity, IID_Health); let cmpCost = Engine.QueryInterface(this.entity, IID_Cost); let repairTime = this.repairTimeRatio * cmpCost.GetBuildTime(); return repairTime ? cmpHealth.GetMaxHitpoints() / repairTime : 1; };
    3 points
  2. Sometimes with games I like to try and figure out how things were done by experimenting in game. I know this is completely pointless with 0AD because it is open source (not that I'd be able to make sense of the code), but I find it fun to try and pick apart the systems and make predictions and see if I was right; plus, it is good exercise for all this mathematics I'm supposed to be learning! I have been looking at construction in 0AD. I select a group of citizens, build a structure, then immediately destroy it and build it again, this time timing the construction -- this ensures that all builders are optimally positioned for the timed build. I do this with a single builder, then two, three, four, as many as I think I need for the data. I tried this with houses and after gathering the data I can make an educated guess that the formula for construction is something like this: t = k/sqrt(n) where t is the time taken (in seconds), n is the number of builders at the site, and k is a constant specific to the type of building being constructed. The k constant for houses is 12. (k will always equal the build time using a single builder.) Am I close? As I write this I remember that I think citizen soldiers and women build at different rates. I can't remember which I used but I think it was all women. Anyone else "play" games in weird ways like this? [update] I've experimenting with building temples. I think the data I got was a lot better this time and the formula I sort of guessed my way to is a very good match. It seems the power of n is not a constant but is specific to building types: t = k/(n^c) where t is the construction time (in seconds), n is the number of builders at the site, and k is a constant specific to the type of building being constructed, and c is a new constant, also specific to the type of building. For houses k=12 and c=1/2, for temples k=240 and c=sqrt(1/2). [update] After a bit more experimenting with temples I've found that sometimes c=2/3. It's very odd to me that there are groups of numbers of builders that can be predicted perfectly (within 1 second) with c=sqrt(1/2), then comes another group that fits c=2/3 much better, it seems to constantly flip between the two values for c over increasingly larger groups. That's a bit disappointing. Something else must be going on here, the switching is too regular to be down to random glitches or CPU spikes. It has to be something systematic, like rounding errors. Trying to work this stuff out is fun but I'm getting bored of testing. I will try to figure out what the connection is between these data and the building type stats and come up with a general formula, then I will try to predict the build time for a building I haven't tested. [update] I was way off. I timed a build of a civic center and it took 2.8 times as long to build as my prediction. I even repeated the house building experiments before making my prediction, because I noticed that my data was way off. A single person building a house in 12 seconds!? I must have had a load of construction buffs or something. Still, it didn't help in the end. Oh, well. Now I will have to find out what the real algorithm is and see if I was on the right track.
    2 points
  3. I can imagination see it in my head how it all work, and it is quite simple and intuitive, but it's hard to put it into words. Like a dock, the end of a bridge can only be place on a shoreline. As you stretch the length of it, like place a wall, it will preview what you are doing. Then the other end under your cursor will "snap" to the next shoreline, like how walls "snap" to existing wall tower, but you can wave it back and forth along the shore to place it where you want to. I think there would be a max "angle" of maybe something like 20 degrees across the water course. Maybe test that out if implemented for best max angle. I think bridge would have a max length and a min length. When the wall placed, the foundations show up in the watter and the units start building the bridge from foundation to foundation from the starting end of the bridge until completed. Maybe 2 bridge, 1 stone and 1 wooden, wooden is destructible if you right click or alt-click one of the pylons of the bridge; clicking on the span surface does nothing but move units to that spot.
    2 points
  4. The code looks performant enough. The Math.pow() operation is only done when SetBuildMultiplier is called (i.e. whenever a builder is added or removed). Repair and GetRepairRate are likely called more often on average (and these functions are trivial, just 4 divisions). Useful 0 A.D. math includes computing when economic upgrades are worth it in comparison to creating more workers, or comparing the profit/cost ratio of trade carts with gatherers, or computing how many units survive when outnumbering the enemy using Lanchester's laws.
    1 point
  5. I don't know how the code works but it is probably easier to make modular bridges look good than walls. Bridges can be made of many lengths by having a choice of different length end-pieces, the middle consisting always of multiples of the same piece. /MM\ /TMT\ /MMM\ /TMMT\ /MMMM\ /TMMMT\
    1 point
  6. This mod could have legal issues because it copies over a look of content directly (unit icons etc)
    1 point
  7. My point was simply to have something basic at the beginning, not some kind of steam machine with mesh blocks getting together to make a bridge to see if it works, and then see what we could improve from that.
    1 point
  8. Should be possible to implement your approach, with or without prior wall placement refactoring, mostly lacks manpower though (or womanpower for that matter).
    1 point
  9. I would say bridge can only start and end on a shore.
    1 point
  10. 1 point
  11. This has probably been mentioned, but there are 129 pages in this post and I cannot wade through them all. Why not key the food resource to the population size as a decreasing quantity. It doesnt make sense that it requires xx amount if food to produce a person, yet standing armies consume none of your food. In "Evony" each person "consumed" a bit of your resources every hour, which made sieges possible, since they mostly relied on starving out the enemy and forcing a breakout. After food depletes, people die off in a priority order, cavalry and elephants and horse teams first (high food requirements), then women (food diverted to the front line troops), then troops themselves.
    1 point
  12. I tried to apply reinforcement learning (Q-learning specifically) to Petra but failed miserably. It has been applied to many RTS bots Civilization IV: https://pdfs.semanticscholar.org/9f9c/0f114b0c4d9b13ec048507a178fe9b3da4ae.pdf Wargus: http://www.aaai.org/ocs/index.php/AIIDE/AIIDE12/paper/viewFile/5515/5734 BattleCity: https://arxiv.org/pdf/1602.04936 and seems to be successful. @jonbaer: Is it necessary to consider each manager as an agent? The headquarters module makes quite a lot of decisions, I think, and it recieves the gameState as parameter. Multi-agent RL might be more complicated and maybe the whole bot could be considered as the only agent. With those percepts of the environment in gameState, you only need a (long) list of all the possible actions and let the algorithm experiment. Then the bot would need apply the chosen action. Queueing the chosen action might be necessary, I don't know. A neural network could be necessary if you dont want the bot to start from scratch each time but with that OpenAI all the AI is taking care of, I guess. I hope you can give this a try. Reinforcement learning is the closest to human learning (it might be computationaly intensive though) and it can even be applied to other areas like pathfinding and game balancing.
    1 point
  13. Because of this thread I have come to love watching replays. But as an observer, I would love to know what a structure is currently producing/upgrading without clicking on it. Just to know what the strong players prefer to produce, what to upgrade, when to upgrade them, etc. I suggest that it should look like this (I can immediately see the player producing 10 women without clicking on the Civic Center):
    1 point
  14. Vulcan - The Roman god of fire and smithing. For our mesh smiths, and (since fire destroys) giving levels of destruction. Vista - I'm expecting a lot of eye-candy "to view" on this next Alpha... Even the menu has new backgrounds. I just hope that Microsoft didn't patent the name. Personally, it's very difficult to find non-Roman related things since not even Greek has a real "v" in its alphabet.
    1 point
  15. i want that Barrack, Shut up and take my money
    1 point
×
×
  • Create New...