Jump to content

SirPope

Community Members
  • Content Count

    104
  • Joined

  • Last visited

  • Days Won

    1

SirPope last won the day on September 27

SirPope had the most liked content!

Community Reputation

29 Excellent

About SirPope

  • Rank
    Sesquiplicarius

Recent Profile Visitors

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

  1. 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*
  2. SirPope

    Unit abilities

    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.
  3. 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.
  4. 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.
  5. SirPope

    The Flood Myth

    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
  6. 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.
  7. 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.
  8. SirPope

    Hyrule Conquest

    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 :)
  9. 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
  10. 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.
  11. 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.
  12. SirPope

    Hyrule Conquest

    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.
  13. SirPope

    Hyrule Conquest

    I gave the "0 AD Civ's in Hyrule" a shot: I'm using maur for the test. Enabled it in the menu by finding it's xml file in Hyrules folder and scrolling to the bottom. The maur tech tree loads fine (slow af but fine), everything basically costs material now (I'm fine with that). The civ center and house would give an error (posted below) and the selection panels wouldn't show. The barracks was still usable though. I didn't play for long but my test said yes, this is kinda possible. I could also build and gather the stuff the buildings say they need (except for rubees). --- So I tinkered and found this: Hyrule's version of template_unit_support_female_citizens.xml (which it doesn't seem to use anywhere): The gather rates aren't updated. change "stone.rock" -> "stone.ore" , "metal.ore" -> "metal.rubees" , and add "tree.rock". Just look at the _citizen.xml file of hylians in there unit folder. The SoundGroups section of female_citizens also needs the gather_rupees sound effect. Again see hylians. The citizen soldiers need the same thing as above. That seems to be Hyrule's template_unit_infantry.xml (they were just missing the sound file, i think). They don't play a mining animation which is weird. They will gather and return it though. --- So success! You seem to be able to do it after the above few changes. I don't know how to get the soldiers to play a mining animation though. :/ This was the first error & the only one I got in the test. Now all I get is: WARNING: JavaScript warning: simulation/ai/petra/config.js line 254 reference to undefined property this.Military.popForBarracks2 The above only shows up if popcap is less that 200. I'm not sure who's doing what with Hyrule's AI. As for getting the 0 A.D's Civ's to work with Hyrule AI... Yeah, after the templates stated above are fixed. It seems to work fine. Well this shows up once and goes away but the AI still... AI's. Just figured I'd give my input. The above error is obviously "no hero found for civ" related... I didn't test all this for long. It could very well break in the end. So someone else can tinker with it if they want too.
  14. SirPope

    Hyrule Conquest

    The error in the AI that prevented the Gerudo from training swine was fixed in 0.3. However... the code that fixed it was shortened and removed from basemanager.js in this release. needCorral is never updated so they are never built or maintained. If this section get fixed or reverted... plus possible way to keep the same effect
  15. SirPope

    Hyrule Conquest

    Might be do to the changes to phase naming: Doubt it will fix everything but it should fix the repeat. I'm using town as an example but it applies to city as well. phase_town_{civ} phase_town_generic is the new default. phase_town.json and phase_city.json is just for easy access / short hand. phase_town_generic replaces phase_town.json I don't think village gets this special treatment. Basically ensure the technology in the civ centers have _{civ} at the end of it and update the filenames of the phases accordingly. If athens has non-generic features: phase_town_athen. You might have to have it supersede phase_town_generic but I think that is optional. You do not need to have a file for every civ.The _generic will be assumed and used.
×