Jump to content


Community Members
  • Posts

  • Joined

  • Last visited

  • Days Won


SirPope last won the day on September 27 2018

SirPope had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

SirPope's Achievements


Sesquiplicarius (3/14)



  1. I'll give you my kidney if you build me one of those circle houses.
  2. With the filter i mention before in place to prevent trees from growing when entities are around and a long regrow session(10-15 minutes) I doubt you'll have a problem.
  3. That would be pretty cool and be a lot easier than the deforestation prevention method. It'd just be a possibly unlock-able tech at the farmstead. That would then allow citizens to build trees. You could just lock the sapling "building" to phase 2 or 3 instead. I'm not for sure if trickle rates for resources are possible ATM but if it is, I'm sure the average modder can see how to get it done (not me, I'll make every unit turn into a tree when they die). If someone gets it working, please upload it to mod.io.
  4. I've got an idea on how this regrowing trees could work. Resource trickle rates / healing as said earlier (a very small rate). If the tree gets down to 0 (or a set amount), change it's obstruction mask to allow for foundations and update the model to a stump (or to invisible). This would allow buildings to be placed upon it. A check would be needed in foundations to remove the Stump file / class / model from the world in some way. Hard parts: Animations: They could be added later (if the idea / mod even works). Perhaps percentage based filenames or the animation speed is controlled by the resource value somehow. Growing: I'd say "stumps" are only allowed to trickle it's resources back if it's near fully grown trees and no other entities within a range (similar to the game of life). That part might be hard to implement efficiently. You don't want villagers, buildings, or deer to be trapped by Ents. The check would kind of be needed. A bit of randomness could be added to make them grow at different rates or whether they grow at all. -- If this is turned into a mod of some sort it'd be rather neat to play. It'd add a layer of management. I don't really see how it could be done without modifying the engine itself though. *shrugs*
  5. I could finely create my 'tree people' civ. It makes no sense. I wanted a hero ability to turn the enemy units into trees. That way I can harvest them to death. I did get harvest-able villagers working (through upgrades). They turn to trees and then you chop chop chop. A temporary ability would work better though.
  6. I was a bit worried about that SM45 diff as I have an xp. It won't break the game for me. Greater than I think 52 will... Finding the 'best way to JavaScript' is kinda pointless. One browser (or version) might handle something better but the other not so much. I guess find places that would benefit having what is known to be faster and make a note of it. Attack types, maybe resources, and some other stuff comes to mind. About the byte code: Related to the typedarrays I think what's happening in the byte code is a bit of optimization. for(var i = 0; yata yate; i++) // i is an integer. I don't need to guess.
  7. Off topic but on topic(?) I thinking: Initializing variables with values (that they are going to hold) could speed up the code. var x = 0.0; Only using x to store decimals. The JS Code is converted from untyped to typed values right? var x to float x and then to assembly. I was looking at that link and poking around on google. I found a comment about SpiderMonkeies inner workings. (misspelled but i like the way it's pronounced: Spider Monk-Easy) https://wiki.mozilla.org/IonMonkey/Overview Not sure what it means but interpreters are usually slow. I'm not tech savvy. I'm just good at misspelligns.
  8. Flooding happens pretty much everywhere. It's kind of hard to explain how or why exactly. A storm can pass, the next day, it will be fine... or you'll be canoeing to the local store for some ice-cream. The length of it depends on a lot for factors early civilizations probably didn't know. It makes sense for cultures to tell stories of them. Scare the kids so they know what to watch out for them. Parents have been telling stories for a long time. Some stick around. The flood isn't the only story that's crossed continents. The concepts of gods and different 'focuses' of them. Death for example, the underworld, whatever. Kid's need to know it's a part of life in some way. If you just think about how myths start you'll see where most of them come from: preservation, preparation, and to answer questions we don't know. Control is also another reason why they exist. Which makes sense. You need to need to believe some things have a consequence. Instead of getting scared of the parent, let them look to the sky instead. It's always on their shoulders so they shouldn't forget its there. That's my logic at least. Idk
  9. Understood. His coding challenges (or the nature of code series) is the better ones to watch then. I mainly wanted to share the editor, you don't need anything to get started. It is always nice to brush up on the basics though. If you can figure out p5's function reference you can figure out pretty much any other one. He also teaches Java or 'processing' (a Java library). He's got tutorials to manage a lot of units at once and covers path-finding. I like that he leaves things up to you to do and figure out (sometimes even fix). In his live-streams, he programs 'on the fly' style. You get to see the thought process kinda unfold. He's also trying to make a video out of it so the retakes can get annoying. Games (and pretty much everything) starts with chaos and end up structured. I don't know a better example of that then watching his streams and seeing the result.
  10. I'm not going to answer all the question. The line about no programming experience. Enjoy programming. Programming is necessary for making a game. Start small and work your way up to harder projects, and you'll be fine. Your game is going to need code, graphics and sound (which also requires code to show / play them). To make it easier to learn (and so you can jump right in): Start high work low. JavaScript is a good example of a high level programming language. Basically, most of the stuff is done for you. It is well documented and everything. Some of what you can do in JavaScript carries over to C++ and other languages as well. Functions, classes, variables, the basics basically. Videos to start learning programming... The Coding Train on YouTube. He uses a JavaScript library called p5.js. It basically simplifies the browsers features. It was designed for this no experience. They have a web editor now so you don't need to set anything up to learn programming. He's kinda weird but, it'll get you the basics. https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA He does coding challenges for some games and covers basic physics engines in quite a few of his other videos. He won't teach you everything but, with the coding challenges, you should have a game made and understand it. They are "simple" games but some are actually quite hard to do. Once you've got a grip on the basics, maybe someone else can give you advice. I'm pretty much a JavaScript only type of person. I hope I helped in some way.
  11. This should let you play as 0 AD civ, the AI on the other hand requires some tinkering. I removed BasicSoldier from the class list of template_unit_infantry. The AI will not use the barracks anyways without editing config.js. It won't use it properly without a bit more edits in the other AI files. template_unit_support_female_citizen.xml template_unit_infantry.xml -- Let me know if it works now :)
  12. Some JavaScript interpreters 'lift' variables before the code is ran. Found a link. Seems like it doesn't apply here really. let and const are ignored so uh... 'hoist waiting' isn't an issue really. https://www.w3schools.com/js/js_hoisting.asp -- wasn't the old site I was talking about but apparently it is faster to do the .length outside the loop. I found that out at least. https://www.w3schools.com/js/js_performance.asp
  13. Yes the JS Code is what I was wondering about. I'm pretty sure doing the below is faster as well. The array doesn't need to ask for/look up the value, it already has a reference to the data in memory. function some2dArrayFunc(arr2d) { const numberOfRows = arr2d.length; //avoid look up each condition check const numberOfColumns = arr2d[0].length; //same let row, j, i = 0; //avoid recreation each loop(?). for(; i < numberOfRows; i++) { row = arr2d[i]; //only look up and retrieve index i once. for(j = 0; j < numberOfColumns; j++) { //doStuff with row[j]; } } }; Something about not having to travel the prototype chain each time (or do error/sanity checking - if there is any internally). It somehow makes it a bit faster (but that was from some site a time ago). The speed up is probably small anyways but 0.0001 can equal a quadrillion if you add it together enough times. Poor point... So this really only applies to large amounts of operations that don't need to be 'felt' by the viewer. I don't really know if 0 ad does this, so this post could be pointless. Only thing that might be noticeably improved is map generation. I can almost say that the arrow function creation in a loop is slow. Sure, they've been sped up but you are still forcing a lot of stuff to happen each time. -- I thought minifying just lessened the load time, not necessarily the execution. If it just does that then, yeah it would technically be faster. I never looked it up or tried it.
  14. I'm mainly making this post to see if I have the right ideal. I've seen some of the stuff while browsing the source / diff. Here's an example of something I made up but I'm sure the developers have already seen something similar... its overly crappy fake code btw function idkRectangle(arrayOfRects) { for(let rect of arrayOfRects) { const x0 = someMath on rect; //All of these are recreated each loop const y0 = someMath on rect; const x1 = someMath on rect; const y1 = someMath on rect; const v = new Vector(centerPoint...).rotate(someDegree/Rad); const newArrowFunction = (...) => {}; //extra bit I've seen elsewhere yata yata } }; //Isn't this faster and less data heavy? function idkRectangle(arrayOfRects) { let x0; //just created once let y0; let x1; let y1; //These could be moved to one line to save space. let v = new Vector(0,0); const newArrowFunction = (...) => {}; for(let rect of arrayOfRects) { x0 = someMath on rect; y0 = someMath on rect; x1 = someMath on rect; y1 = someMath on rect; v.set(centerPoint...).rotate(someDegree/Rad); newArrowFunction(...); yata yata } }; My guess is yes but: linting... and readability. The last one is kinda confusing. But it is faster and less data heavy right? I've seen this in area's where "speed is key". I got confused.
  15. You don't need to change the templates of 0 AD inheritance does that all ready. You've made all the changes necessary to the base templates that the units of 0 ad inherit. template_unit, template_unit_calvary, template_unit_infantry, so on and so forth. The only one you seemed to have missed was the female citizen file. Units still have the armour types and attack types HC has thanks to those files. Problems could arise with the AI being adjusted, yes, but 0 AD civ's are Hyrule & Gerudo. I've looked over the AI files and you've just added stuff for the civ's that need it (koroki, gohma). The hero functionality can check and should check if the civ in question has a hero unit that can be chosen anyways (not just for compatibility but also testing new hc civs). I've destroyed the gerudo's with war elephants and that made me happy. I still wouldn't implement them into the game anyways. But if someone wants to mess around I told you how. -- You'll have to add the barracks back for each civ in config js along with their other structures special structures. The barracks code has been changed apparently. Adding BasicSoldier to the classes of unit_infantry allows them to train troops early on but might effect the rest of the AI hence the shouldn't implement them anyways. CitizenSoldiers are basic soldiers anyways.. I don't understand that class name change but you know what your doing I can tell you that much.
  • Create New...