Wesnoth Bestiary
Moderator: Forum Moderators
Re: Wesnoth Bestiary
Well, I'm still working at it. Haven't devoted quite as much time as I'd like to.
(Un)fortunately my projects seem to be more and more related. Ascension has units up to level 5 and would be best displayed nicely in the Bestiary. Editing it has been a little of a pain so I've had need for a web-based unit editor.
So a Wesnoth unit editor has been my latest project. It's far from functional yet, but should be neat once I've put extra work into it. Meanwhile, I've set a deadline for Ascension on June 8. Then I'll be revisiting the Bestiary, working on a unit tree tab to place in the page.
(Un)fortunately my projects seem to be more and more related. Ascension has units up to level 5 and would be best displayed nicely in the Bestiary. Editing it has been a little of a pain so I've had need for a web-based unit editor.
So a Wesnoth unit editor has been my latest project. It's far from functional yet, but should be neat once I've put extra work into it. Meanwhile, I've set a deadline for Ascension on June 8. Then I'll be revisiting the Bestiary, working on a unit tree tab to place in the page.
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary
Bestiary is so close to finishing that I've had the urge to get it done.
However, I've hit a roadblock.
The problem I am faced with is the output from
Thus, I'm faced with a couple of possibilities here.
However, I've hit a roadblock.
The problem I am faced with is the output from
wmlparser.py
isn't quite fully JSON-compatible, namely that multiple objects or keys aren't allowed to exist in JSON (you're supposed to use an array instead). For example, the Marksman has two attacks, but two attack objects with the same parent isn't allowed by .$getJSON()
(a jQuery function for reading a JSON-formatted file). The other issue is I really need to break up the file into smaller files (like one per unit). It's possible to run wmlparser one file at a time (though macros wouldn't carry over, among other things).Thus, I'm faced with a couple of possibilities here.
- Edit the Python wmlparser JSON output to make arrays instead, and also cut it into individual unit files
- Write a Perl/Python script to edit the large JSON file into individual unit files and hack the multiple objects/keys → arrays issue
- Create a custom JavaScript parser to read the Wesnoth JSON file (and somehow still break it into smaller pieces)
- Abandon the notion of it being dynamic and just hardcode things
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
- King_Elendil
- Posts: 250
- Joined: February 26th, 2010, 4:54 am
Re: Wesnoth Bestiary
Wow, I didn't think I'd hear any more about this project! It's good to see it is still going .
I'm finally admitting that this will be a very long (if not permanent) Wesbreak. Thank y'all for the great times, and may Wesnoth rise to become one of the most popular games on the planet.
Re: Wesnoth Bestiary
Try dropping a forum PM to esr, or poking him on IRC — he's the author and maintainer of most of our Python stuff, so he most likely knows how wmlparser.py works. Since he's a Python fr- fan, he might also be able to help you with other problems.ancestral on IRC wrote:[plea] Seriously, if anyone has intimate knowledge of wmlparser.py, or at the very least knows a bit of Python to which I can lean on, please let me know. This is directly related to my Bestiary project. Thank you. [/plea]
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: Wesnoth Bestiary
Quick Update:
The following loads dynamically:
I'm working on displaying the advancements, which has proven to be a bit more difficult than anticipated; then I'll clean up images and get resistances and movement going. The last two rely on statistics which aren't found in the given unit's file, so this may prove interesting.
At this rate, I could realistically be done by the end of the month. (If not, certainly by the end of the year.) Of course, then I need to tackle the unit tree.
The following loads dynamically:
- Descriptions
- All basic stats
- All attacks now populate from JSON files!
- Images (sort of)
I'm working on displaying the advancements, which has proven to be a bit more difficult than anticipated; then I'll clean up images and get resistances and movement going. The last two rely on statistics which aren't found in the given unit's file, so this may prove interesting.
At this rate, I could realistically be done by the end of the month. (If not, certainly by the end of the year.) Of course, then I need to tackle the unit tree.
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary Development Thread
Quick Update:
Huge progress has been made in the past 48 hours!
See the work in progress: http://mproud.com/wesnoth/bestiary/index.php
Update: I haven't uploaded my local files to the server yet, so you might not see all changes.
Huge progress has been made in the past 48 hours!
- Nearly all web page code has been ported to PHP for better handling.
- Images now populate automatically.
- A map of keys has been made to store a unit's resistances. Resistances now populate and check for any of a unit's [resistance] tags.
- Page and <div> widths automatically enlarge to fit larger portraits (such as Gryphon).
- Links to unit pages now accept case-insensitive URIs… mostly.
- Switched from post/get page loading to dynamic hash location. (For example, index.php#Vampire_Bats .)
- Major code cleaning, and it continues!
See the work in progress: http://mproud.com/wesnoth/bestiary/index.php
Update: I haven't uploaded my local files to the server yet, so you might not see all changes.
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary Development Thread
One thing - I don't know if you fixed it yet.
When I click to choose one of the portraits (female/male variants), after the old portrait fades out and before a new one fades in, I can see all the contents of the column under the portrait jump up to fill the space where the portrait was. It's only for a fraction of a second, but still noticeable.
When I click to choose one of the portraits (female/male variants), after the old portrait fades out and before a new one fades in, I can see all the contents of the column under the portrait jump up to fill the space where the portrait was. It's only for a fraction of a second, but still noticeable.
ride on shooting star
Re: Wesnoth Bestiary Development Thread
Update!
It's really coming along now!
Unfortunately, it's not playing nice with non-webkit browsers. I will have to fix that glaring mistake.
It's really coming along now!
Unfortunately, it's not playing nice with non-webkit browsers. I will have to fix that glaring mistake.
- All JSON files now flow through one mystical, magical text file
- Dynamic loading is almost there. In order to pass off the hash location (e.g. #Vampire_Bat) from JavaScript to PHP, a cookie is required. (The workaround, if cookies are not enabled, is to reload the page with the hash location present.)
- Portrait height, as well as width, now dynamically resizes correctly
- Portrait male/female switching now correctly doesn't let content jump around the page
- Attack icons, if the icon key isn't present, now checks with the attack name for its picture (thanks shadowmaster!)
- Some regex rules in code for the description fixed
- General incompatibility with Firefox
- Cookies/hashes requires multiple reloads
- Text selection broken where even with portrait
- Advancement (though should be easier)
- Defenses and movement costs
- Spacing with attacks
- Though never working, support for additional portraits
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary Development Thread
Well, I've pushed the boundaries of what I can do without doing one of two things.
- Forcing the user to download 3 MB of data in order to use Bestiary (horrible idea)
- Require multiple page reloads (blecch)
- Write a web app
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary Development Thread
Quick Update:
PHP code has been converted into JavaScript. At this point, I have it back to working again as it was before. (With this implementation I think I can avoid the pitfalls of the three scenarios I listed in the last post.)
Feel free to check it out, understanding there are some flaws.
http://www.mproud.com/wesnoth/bestiary/#unitname
Update: I have a file splitter which has put out .js files for all units! Will work on refreshing.
PHP code has been converted into JavaScript. At this point, I have it back to working again as it was before. (With this implementation I think I can avoid the pitfalls of the three scenarios I listed in the last post.)
Feel free to check it out, understanding there are some flaws.
http://www.mproud.com/wesnoth/bestiary/#unitname
- To-do:
- Split JavaScript file into multiple files (it's a 3.4 MB file right now)
- Advancement tree
- AJAX page reloading/refresh
- Display portraits correctly
- Custom, per-unit resistance and defense stat overrides
Update: I have a file splitter which has put out .js files for all units! Will work on refreshing.
Last edited by ancestral on January 14th, 2011, 10:32 pm, edited 2 times in total.
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary Development Thread
Link doesn't lead anywhere for me. If the address should be the same as in your sig, you missed a /wesnoth.
Greetz
HomerJ
Greetz
HomerJ
Six years without a signature!
Re: Wesnoth Bestiary Development Thread
The correct one I believe is
: http://mproud.com/wesnoth/bestiary/#unit_name
no need to thank me ancestral
: http://mproud.com/wesnoth/bestiary/#unit_name
no need to thank me ancestral
Bye says the cookie.
Re: Wesnoth Bestiary Development Thread
Update: Portraits are working, and adjust width correctly!
Along with the JSON files split up, much progress has been had.
For example:
http://mproud.com/wesnoth/bestiary/#lich
(When changing the page you may need to reload your browser… for now.) Oh yeah, fixed that too! I placed a pop-up box where you can choose other units. This is just a placeholder for now.
Minor things to the UI have been done and will continue to be done. Re-adding support for multiple portraits. Advancement still needs to be done. And creating some kind of unit browser… still not sure how best to do this…
Compatibility
So far, Bestiary has been checked and known to work well with:
Along with the JSON files split up, much progress has been had.
For example:
http://mproud.com/wesnoth/bestiary/#lich
(When changing the page you may need to reload your browser… for now.) Oh yeah, fixed that too! I placed a pop-up box where you can choose other units. This is just a placeholder for now.
Minor things to the UI have been done and will continue to be done. Re-adding support for multiple portraits. Advancement still needs to be done. And creating some kind of unit browser… still not sure how best to do this…
Compatibility
So far, Bestiary has been checked and known to work well with:
- Chrome 2+
- Firefox 2+
- Internet Explorer 7+
- Opera 9+
- Safari 3+
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary Development Thread
The attack effects… were on my todo list but I completely forgot about them! I'll add those in, maybe tonight.galeanthrope wrote:The attacks effects are missing, like poison, slow, drain ... I think the unit sprites should be here too. In place of a empty Advancement part you could write "No advancements" or "Level max". Things like cure, heal ... are missing too. And finally, there should be an image for unit that don't have portraits yet like the Yeti, the Wolf or the Tentacle of the deep.
I'm interested in putting the unit sprites in, but not sure where.
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Wesnoth Bestiary Development Thread
You could replace the numbers used to choose a portrait variant with appropriate sprite variants.ancestral wrote:I'm interested in putting the unit sprites in, but not sure where.
ride on shooting star