Jump to content

s0600204

WFG Programming Team
  • Posts

    261
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by s0600204

  1. *chuckles* ^_^ Yeah, looks like the phase list is out of order.

    There's a bit of code that works out the order of phases. Needless to say, it had a bug. It should now be fixed. Third time's the charm?

    I wouldn't count this as an outlier - this bug would have popped up sooner or later.

    Edit: I don't know why the phase icons down the side are missing. Thoughts, leper? Solved.

  2. @stanislas: Ah, now that's relatively easy. The norse civ doesn't have any structures it can build in the city phase. The code is expecting some and is complaining when it can't find any.

    If you're running SVN/A18, then replace gui/structree/structree.js in your game's files with https://github.com/s0600204/0ad-structree-mod/raw/A18/gui/structree/structree.js and the error should clear.

    @wgoyc: Does https://github.com/s0600204/0ad-structree-mod/tree/A18-delenda solve your problems? (If you download and install it as a mod)

  3. If you can't find the time or effort to draft an entire civilisation proposal, at the very least present us with some references or links so that the community can explore this idea more fully. I, personally, would love to expand my world view and learn more about early african civilisation and culture. Tell us, show us, describe to us, provide the community with resources so we can get some idea of what Africa was really like, and no doubt someone will be inspired. As serveurix said above, "tell us more".

    Edit: The wikipedia link to an article describing the ancient city of Meroe is a good start.

    • Like 4
  4. And again a huge thank you to s0600204 for both creating it and letting us merge it!

    :thank_you2: No problem! Glad people like it.

    Is maybe because my mod has a pair for Town phase.

    Quite possibly.

    I've been playing around with the aristeia mod locally, getting the egyptian civilisation to conform to zophim's design specification, and part of what he spec'ed is that the user gets a choice when researching city phase - to go for either Rameses or Theban civ traits. And the structree really didn't like the phase-pairing required.

    I did manage to resolve it, at least for A17 - but I don't run A18/SVN, thus I don't know if my changes are compatible with the work leper did to make the structree work with A18. No doubt we'll make something work...

  5. It appears the recent server upset/transistion has left the design documents/civilisation profiles behind on the old server, and they will need re-uploading.

    I have a copy of the "New-Kingdom Egyptians Profile" *.pdf locally, but seem unable to upload it to the forum, or else I'd start the process.

    Zophim? Guys?

  6. The user-writeable mod folder is where mods should be installed (as that should be user-writeable on all systems). If someone wants to install a mod system-wide they can surely find the installation folder anyways.

    Good point.

    Nice work (haven't tested the mod yet, but looked at the code a bit)! Might it be easier to just create a simulation to query it? Or should we just expose the template loader to the GUI? It seems like quite some code is at least partially duplicated from functionality already implemented in the simulation.

    Thank you! :) Yes, some of the code does duplicate simulation functionality. Some of the logic probably differs, but it comes to a similar enough result.

    How would I go about running a simulation for the <1 second it takes to load the data? I mean I wouldn't need it running for any length of time, just long enough to populate the JS object that I use to cache the data I need to draw the structree. At one point I did try tracing the match setup scripts to try to work out how they start up the simulation, or call it into being or whatever, but I seem to recall I was discouraged as the scripts seemed to require an initialisation of players before hand.

    On a similar note, I notice that the {civ}.json files contain information about things like Heroes and Special Technologies that (a.) only seems to be used in the civinfo page, and (b.) might be better loaded straight out the files that describe said Heroes/Technologies in-game. In order to do this, the GUI scripts would require access to an XML/template loader/parser of some form as well as the JSON parser. (Stripping out the duplicated data in those files and replacing them with references to the relevant XML/JSON files is something I've recently been considering.)

    I might have to take a look at scrolling of gui objects now... (pesky contributors contributing :P) Thanks for a nice testcase :). Also using the nested repeats might help with making the GUI XML files a bit more readable.

    No problem. I do have a branch in my local git repo that uses the nested repeats (and they are indeed a lot more readable), but I don't have a SVN-based copy of 0AD installed so I haven't had a chance to test it (and I really don't like pushing untested code (or in this case markup) on the community). I'll push the branch to GitHub, and someone can test if for me if they desire (else, I'll wait until A18 drops and test it myself then).
  7. I was looking for a page that describes the default installation location on various systems, rather than the location where the game stores its save-games/screenshots/logs/cache/etc. That said, the page you linked does imply that you can place mods in a subfolder in much the same location, so maybe I doth protest too much. ;)

    (On a slightly unrelated note, http://trac.wildfiregames.com/wiki/Modding_Guide#Howaremodsused really needs to be updated. "At some point we plan to have a graphical menu for selecting mods.")

    utf-16 encoding isn't the case for sure, line 1 of every file you say reads this:

    <?xml version="1.0" encoding="utf-8"?>
    That doesn't mean the file is actually encoded in utf-8, only that the content within the file should be treated by the parser as if it is utf-8 encoded. The very first character in each of these files appears to be unprintable, which I'm going to make an educated guess and say might be a byte-order-mark, which from skimming the xml rfc I'm going to say isn't required if the file truly was utf-8, and may be partly why my hacked-together parser is throwing a wobbler.

    Checking the han_china repository, I notice that leper has been and converted the files to utf-8 properly. So problem solved. (And thank you, leper! :D)

  8. :newyear:
    Merry Christmas!1


    I have a gift for you all! Introducing (by popular demand) this:

    fEKop0d.png


    Yes, that is the structure/tech diagram. And yes, that is running inside 0AD. (Well, who didn't see this coming?)

    If you're running A17, you can grab this: https://github.com/s0600204/0ad-structree-mod/archive/master.zip
    If you're running SVN, (or have a time machine2 and are running A18), you will need this version: https://github.com/s0600204/0ad-structree-mod/archive/A18.zip

    To use: download the appropriate version, move it to one of your mods folder, see Game Data Paths for the appropriate path, and extract the contents. Rename the resultant folder "structree", start up 0AD, and enable the mod through the interface found through "Tools & Options" > "Mod Selection" on the Main menu.

    You'll find the structure tree on the main menu under "Learn"/"Learn to Play"3 > "Structure Tree". I would advise disabling all other mods (except the core 0ad one, duh) before trying the mod. Otherwise, make sure it is last in the list of loaded mods.

    Known problems:
    • On resolutions narrower than 1280px 1360px(?), the entire structree will not fit horizontally on the screen, and the current lack of a horizontal scrollbar means that you can't scroll.
    • Some building names are too long to fit in their boxes. I'm considering removing them and only having them in tooltips
    • The structree doesn't like the Rise of the East mod. I like it, it's a great looking mod, but the structree turns its nose up at it. This appears to be because the wallset templates (chin_wallset_stone & chin_wall_*) are encoded in utf-16 rather than utf-8. The fact that I can't use Engine.ReadXMLFile()4 and so coded a crude substitute may have something to do with it as well. Meh. Problem resolved. This now works with Rise of the East fine. :) Haven't tested any other mods yet. :(
    • prodigalson and wowgetoffyourcellphone have both got mods that have a fourth phase. I have an idea as to how to support this, but it might not work and I haven't had time to implement/test my theory. Therefore their mods may cause a lot of errors if you attempt to use my structree with either of their mods. Sorry! :sorry:
    Anyhow, enjoy, and I hope you have (had) a good day! :xmas:



    1 - Disclaimer: other mid-winter celebrations are available.
    2 - Wibbley-wobbley timey-wimey... TardisGif.gif
    3 - While coding, I was using windowed mode in 1024x768 to ease going back and forth, and found that simply adding a new button to the main menu caused an overlap with the box directly below the buttons. So I created a new submenu and moved the original "Learn to Play" and "History" options inside to join my structree.
    4 - Because it's not exposed to GUI scripts.

    Edit: Problem resolved with regards to Rise of the East, and adding in the "Game Data Paths" option in the "to use" paragraph.
    Edit2: To coincide with recent changes.
    • Like 8
  9. Or alternatively have the ability to place foundations upon trees, and have the game force units tasked to build to first clear all the trees blocking a foundation (and only those trees) before being permitted to build the structure for that foundation.

    Thus, you could build walls through forests without having to deforest the whole area.

    ...recommend is that trees are knocked down when you start gathering from them...

    I agree. Then there's also the fact that once a unit has finished with a tree/mine/bush, the depleted resource just disappears.

    Anyway, with trees it's either something for the art team (to create new art of fallen trees) or for the graphics programmers (use the same asset, but rotate it round a point near its base so it actually does seem to fall over) or both. With mines, maybe they could be very slowly lowered into the ground as they are exhausted much like structures being built rise out of it. But you're right, these are fairly low on the priorities list.

  10. Maybe there should be an option in the game's settings/options page to set a global default AI difficulty, whilst still keeping the current ability to set the difficulty for each AI individually from the Match Setup page. So, when a player starts a new Match, the AI difficulty is set from the global default (rather than always being 'medium') but the player can then alter a particular AI to a different difficulty should they wish.

    Also, on systems with more than one AI installed (via mods or whatever) an option to choose the default AI used could also be of worth. It would save (particularly on maps with more than one AI controlled civ) having to set each manually one-at-a-time.

    • Like 2
  11. @leper: Fair enough. I know you're busy, so I appreciate you taking the time to do what you've done thus far.

    @Pureon: Thank you. I took a few artistic liberties, but I'm glad you like it.

    @wowgetoffyourcellphone: No problem!

    The reason why structure icons weren't showing up for your mod is because your mod doesn't have 0AD as one of its dependencies, and so 0AD's assets are not included when determining image locations. I've pushed a more up-to-date version of your mod to the live interactable version, at a state after you added/copied structure icons into your mod, so they should appear now.

    • Like 1
  12. Earlier today I pushed some changes to GitHub and also to the live interactable version. The biggest changes are to how the data is parsed... but that happens in the background and is probably not very interesting so I won't go into detail.

    Of greater interest will be that I've added three more mods that you may activate from the drop-down in the top-right:

    The latter two change a lot of the same things and are therefore not compatible with each other. Also, you might encounter problems if you have either one of them and any of the smaller mods active at the same time. I won't prevent you from trying, but... I wouldn't advise it.
    • Like 6
  13. Short but sweet!

    Just one thing (possible spoiler)...

    it would seem that the Trigger FleeToTheEast is not disabled after use - and so one quickly ends up with a couple hundred reinforcements, rather than the five scripted. (which the pathfinder really doesn't like ;)).

    Also, I'm not sure if you're working with a newer version of the Trigger component, but on A17 I'm getting warnings popping up...

    One warning from line 196 of the map's JS script and another from line 8 of the Entity.js helper script are about using Objects (they're actually arrays, but JS's typeof never could tell the difference) instead of Integers. Changing [data["building"]] to data["building"] on line 196, followed by adding [0] to the end of line 199 (before the semicolon) below it cleared these up for me.

    Removing the <visibility/> tag and merging the contents of the two VisualActor tags in visibility_flag.xml resolved several warnings received from the XML Parser.

    Problems aside, it's a good indicator of the potential to come. Keep it up!

    • Like 1
  14. I do not know. I can maybe see giving each tech a row and # ID so that they are placed in the web correctly. It will take some imagination.

    Or you could make sure that each tech in the web has, within its JSON description, the tech codes of its immediate dependancies, and then draw the web procedurally.

    Anyhow, pursuing your web idea further, do you propose a single unified web for each civilisation, with military and economic techs in the same web; several webs for each civ, with one web for economic, one for military, etc; or that each building in the game capable of researching techs should have it own, specific, web?

  15. I've made an update: Tooltips now have the same descriptions used in-game; and for units and structures, attack and armour stats are shown where applicable.

    I'm not quite happy with how the stats are presented, and I'll probably tweak their appearance, but they are now present.


    @GunChleoc: Positioning isn't really the issue (although it would be something of a headache). And unless you're playing on a very high resolution screen there will always be more elements of the tech/structure tree than fit the screen.

    And as for i18n, I think you may have answered your own previous question ;). It's been added to my todo list.

    @feneur: Indeed :).

  16. Hmm, is there a way to define it, but only display it when the Javascript code calls for it to be displayed? (With the text/graphics replaced via Javascript which you say is certainly possible.)

    Yes, that is possible...

    At least as long as one "source" element can be used several times on the screen at the same time,

    ...but as far as I know this isn't, although I suspect someone will correct me if I'm wrong...

    otehrwise it might be a bit too cumbersome if all possible elements have to be hardcoded (i.e. the max number that could possibly appear).

    ...precisely.

    How much work would it be to add i18n to this?

    I'm not sure. I don't know much about how i18n works in-game ordinarily, so I'd have to look into it.

  17. @feneur: Either. As I understand it, UI elements and layout are specified in XML files which are parsed by the (c++) engine and used to create what you see. JavaScript can manipulate these elements (change textual content, change image used, set visibility, etc.) but can't call into being a new element that hasn't been specified in the XML file of the currently loaded UI. Or at least that's the impression I got from reading through the (possible slightly out-of-date) documentation on trac and the XML files currently used ingame.
  18. Wow. Thank you all for the feedback and positive comments.

    (GunChleoc) ...on the lowest row, the tooltips get cropped on small screens.

    (feneur) ...the lowest tooltips get cropped on larger screens as well, possibly the size of the area is hardcoded?

    Fixed. The tooltips should now better position themselves.

    And the height is not hardcoded. The height of the draw area is dependant on the number of rows - if a fourth phase was added to the game, the code (which starts off with no preconceptions of how many phases there are) automatically adapts and the draw area will get taller. It's a similar principle with the width of the draw area, which changes depending on the widths of the UI boxes for the chosen civ's buildings after the units & techs are added.

    (GunChleoc) As a feature idea, display what the technologies do on the tooltips.

    (feneur) I definitely agree with adding what the technologies do on the tooltips...

    (niektb) The addition of a tooltip description and/or stats of the building / unit / tech would be a good addition indeed as others already pointed out.

    They're already on my todo list ;)

    (feneur) Am i correct in assuming that this could at one point be added to the game directly?

    (niektb) Could this maybe be combined with the history screen?

    I agree it would be nice to have this inside 0ad itself, maybe in a way similar to how the civ history screen appears or incorporated with it or something. However there is one big obstacle in the way of doing that at the moment - in order to get the visual aspect of the tree, either the game's GUI engine needs a recode to permit the creation of UI elements from JavaScript, or an SVG/HTML-Canvas-like UI element would need to be added. (And I'm not proficient enough in C++ code to do either).

    ...the civ center should appear on phase 1...

    The civ centre currrently appears in phase 2 because that is when it can be built. I know, I don't want it there either. I figured someone would mention it. When I get a chance, I'll write in an exception that forces it into phase 1. (And then someone will doubtless complain about that :P)

    Ah, well, it doesn't seem to show custom technologies and custom icons.

    Which techs/icons are missing? The 0ad wheel is being used as a placeholder by the system - if you see it, it means the image linked by the underlying template doesn't exist or can't be found (by first looking in the art folder of the mod linking it, then each of its dependancies).

×
×
  • Create New...