Jump to content

0 A.D's Built-in Encyclopedia


Lion.Kanzen
 Share

Recommended Posts

17 hours ago, Stan` said:

@Vantha sadly if you add new json files the translators will have to translate everything twice... I think you should use the templatemanager like the structure tree instead.

When starting with everything, I actually tried retrieving the texts directly from the XML templates. But to be honest I didn't get that to work.
My current idea is to store all texts only in JSONs and only show them in the encyclopedia. And to entirely remove the texts from the small viewer popup (and from the template XMLs) because they don't fit well there. And maybe add a button in the viewer popup that opens the respective article in the encyclopedia instead.

 

20 hours ago, ShadowOfHassen said:

Another thought is it might be cool to throw that up on a GitHub repo in case there are others that want to pitch in, or just want to test.

Yes, that was also my plan. I will do that in the next few days.

 

20 hours ago, real_tabasco_sauce said:

I wonder if you could use the in game icons for these buttons instead of text? It might look good to instead use the top right area for each category's entries.

Making the Civ Selection similar to the dropdown in the top right of the structure tree actually seems like a good and intuitive solution, if that's what you mean.

Don't reasonably sized buttons take up more space than text? I'll see what I can do.

 

20 hours ago, ShadowOfHassen said:

Seeing how close you are, it might be better, though, to wait until this has inline images and formatting, then we can go over the articles to add the features, in one go.

That's probably best, it shouldn't take me long to implement them.

  • Like 1
Link to comment
Share on other sites

16 minutes ago, Vantha said:


My current idea is to store all texts only in JSONs and only show them in the encyclopedia. And to entirely remove the texts from the small viewer popup (and from the template XMLs) because they don't fit well there. And maybe add a button in the viewer popup that opens the respective article in the encyclopedia instead.

 

Is there a way for your UI to also talk to the XML files, not for formatting, but to pull the damage/ HP counts and the description as well as training requirements? I @wowgetoffyourcellphone's designs place them very nicely, in the area and that info goes nicely with the articles.

  • Like 1
Link to comment
Share on other sites

27 minutes ago, ShadowOfHassen said:

Is there a way for your UI to also talk to the XML files, not for formatting, but to pull the damage/ HP counts and the description as well as training requirements? I @wowgetoffyourcellphone's designs place them very nicely, in the area and that info goes nicely with the articles.

Yes. Basically the same way as retrieving information from the history tag.

  • Like 1
Link to comment
Share on other sites

6 hours ago, Vantha said:

But to be honest I didn't get that to work.

What didn't work ?

There has been some work to put more back in the templates from json files, I believe in A27 the civ history tags are now in the templates. And that would basically undo that which isn't great.

I believe @Freagarach wanted to get rid of the jsons eventually but I don't know more.

Link to comment
Share on other sites

On 08/02/2024 at 1:22 AM, Stan` said:

What didn't work ?

There has been some work to put more back in the templates from json files, I believe in A27 the civ history tags are now in the templates. And that would basically undo that which isn't great.

I believe @Freagarach wanted to get rid of the jsons eventually but I don't know more.

Sorry for the delayed response.

I couldn't figure out how to work with the current XML templates because I'm not a very experienced programmer to be honest and not very familiar with 0ad's code (yet).
I believe we should store the articles separate from the templates to keep them clear, easy to read, and everything in them related to gameplay.
Kind of like the text in the credits popup is stored in JSONs too.

But if you insist and think it's better the other way, I can of course change it to read the texts directly from the XMLs. I'm sure I'll figure everything out, it can't be that hard. And I was planning on pulling other information from the XML anyway, the portraits and some stats.

 

2 hours ago, ShadowOfHassen said:

@Vantha is there a way to add the tags to the XML history tag, something similar to HTML files?

Not entirely sure what you mean. But yes, it's possible to add tags inside the history tag. We could also rename the 'History' tag to 'Encyclopedia' and then put 'Title' 'RelevantArticles' and 'Content' and 'Quote' in it for example.

Link to comment
Share on other sites

1 hour ago, Vantha said:

 

Not entirely sure what you mean. But yes, it's possible to add tags inside the history tag. We could also rename the 'History' tag to 'Encyclopedia' and then put 'Title' 'RelevantArticles' and 'Content' and 'Quote' in it for example.

Yes, that sounds good. We could also have separate things for history and description. So every unit can have a description that's more gameplay related and then a history part that's focused on the history.

  • Like 1
Link to comment
Share on other sites

So, progress has sadly been going a bit slow lately. I haven't done the UI design of the page itself. But I have restructured the entire page. Now it has every text we've ever written that I'm aware of. This includes all templates, mixins, animals, trees, and more.

Here is a short showcase, clicking through what I have done so far:

 

 

 

There are seven categories chosen by the buttons on the right, every category has its own overview text, displayed where later the article will be shown. We never wrote such texts which is why  I use placeholders right now ("Here is..." at the top). The categories also have subcategories that are chosen by the buttons appearing on the right. My idea was to have the overview text and then something like "Learn more about ..." below it. After selecting a subcategory, there is the list of articles in the specific subcategory, and here one can open the individual articles. In addition to all that, the civilisations tab also has a dropdown for choosing civ. The civs' overview texts are of course the ones in the game.

The categories 'historical background' 'maps' and 'gameplay' are currently empty.

If you're curious, here is the file with the folder structure in it that I use for my external setup script:

folders.json

I also added a related articles section on the right. The related articles need to be manually added to the files (which is why in the showcase only one article actually has related articles showing up). And there are back buttons to more easily navigate all the menus.

 

I am aware that that some name choices aren't very good or fitting, I am definelty open for any sugggestions, especially regarding adding, removing, or renaming categories. What do you think of the 'category-subcategory-selection' system in general? Does anyone have ideas on how to arrange all the buttons in the middle panel?

 

P.S.: I will upload a mod with the current version soon for people to try out. I have to clean up my messy code first.

 

 

  • Like 7
Link to comment
Share on other sites

35 minutes ago, Vantha said:

So, progress has sadly been going a bit slow lately. I haven't done the UI design of the page itself. But I have restructured the entire page. Now it has every text we've ever written that I'm aware of. This includes all templates, mixins, animals, trees, and more.

Here is a short showcase, clicking through what I have done so far:

 

 

 

There are seven categories chosen by the buttons on the right, every category has its own overview text, displayed where later the article will be shown. We never wrote such texts which is why  I use placeholders right now ("Here is..." at the top). The categories also have subcategories that are chosen by the buttons appearing on the right. My idea was to have the overview text and then something like "Learn more about ..." below it. After selecting a subcategory, there is the list of articles in the specific subcategory, and here one can open the individual articles. In addition to all that, the civilisations tab also has a dropdown for choosing civ. The civs' overview texts are of course the ones in the game.

The categories 'historical background' 'maps' and 'gameplay' are currently empty.

If you're curious, here is the file with the folder structure in it that I use for my external setup script:

folders.json 6.12 kB · 1 download

I also added a related articles section on the right. The related articles need to be manually added to the files (which is why in the showcase only one article actually has related articles showing up). And there are back buttons to more easily navigate all the menus.

 

I am aware that that some name choices aren't very good or fitting, I am definelty open for any sugggestions, especially regarding adding, removing, or renaming categories. What do you think of the 'category-subcategory-selection' system in general? Does anyone have ideas on how to arrange all the buttons in the middle panel?

 

P.S.: I will upload a mod with the current version soon for people to try out. I have to clean up my messy code first.

 

 

The UI needs some tidying up in the future, but it looks amazing!

  • Like 2
Link to comment
Share on other sites

I just finished two more Han texts that I had started some time ago. With that we've now entirely finished the Han, our third civ. @ShadowOfHassen and I decided to get back to the Greek civs, we will do the Macedonians next and then maybe the Ptolemies and Seleucids in parallel.

Here is the PR: https://github.com/TheShadowOfHassen/0-ad-history-encyclopedia-mod/pull/121

 

The Battle of Mobei:

Quote

The Battle of Mobei took place in 119 BC in the Northern Gobi Desert. It was fought between the Han and Xiognu, who at this point had been in a century-long conflict and fought a decade-long war. The Han army commanded by Wei Qing was much smaller and consisted of comparably inexperienced soldiers because another much more powerful Han army had been sent to invade Xiognu territory as well. And the plan was for only this other army to engage with the main Xiognu forces.

After over 500 miles of exhausting marching, however, Wei Qing's weaker army suddenly stumped into a Xiognu army. It was 80,000 elite cavalry, commanded by the Shanyu, the Xiognu supreme ruler, the entire empire's military pride, well-rested and battle-ready. Upon sighting the Han, they immediately sent cavalry to charge at the disorganized and totally unprepared Han. The surprised and shocked Wei Qing acted fast, ordering his men to form a ring formation with their chariots, wagons, and carts. These functioned as fortifications to stop the Xiognu cavalry charge. Behind stood the dangerous Han ranged units, archers, and crossbowmen, continuously firing at the enemy.

And this tactic worked well: the Xiognu were unable to breach the defensive Han line. A stalemate ensued, and fighting continued until night. In the midst of the night, a sandstorm approached. Wei Qing sent his own cavalry to flank the enemy on both sides. Because of the low visibility due to the night and sandstorm, Han cavalry was able to sneak around the two clashing armies and attack from behind. The Xiognu, unable to coordinate a reaction, panicked. Many of their soldiers were slaughtered, and even though the Shanyu himself managed to get away, the Xiognu army was decisively defeated and, with that, had lost the war.

 

 And the entire Han Xiognu war: (it's the longest text I've ever written, maybe I should split it up into multiple texts)

Quote

The Han dynasty was founded in 206 BC, after centuries of close to continuous fighting. However, only three years prior, the nomadic horse tribes of the Northern Steppes had united in the Xiognu confederacy under the title of Shanyu, the supreme ruler. These tribes had, over the centuries, frequently invaded border regions. At the time, a Xiognu army led by the Shanyu himself had captured several Han bases.  

Wanting to clear away this threat to the Han people, Liu Bang, the founder of the Han dynasty, led an army to attack the Xiognu.  The Xiognu at first gave the impression of retreating, which, however, turned out to be a feint: the Xiognu suddenly turned around and ambushed the Han—at the Battle of Baideng. The Han, having fallen for the trap, suffered a devastating defeat. Han Emperor Liu Bang barely managed to escape to a nearby fortress, which was in turn besieged by the Xiognu. The newly founded empire was on the brink of collapse.

But the Han were able to bribe the Shanyu's own wife into convincing the latter to break off the siege and sign a peace treaty instead. This peace treaty obligated the Han to send yearly tribute payments to the Xiognu in order to keep the peace alive.  Although these payments were very high, the Han, traumatized by the overwhelming defeat, resorted to doing them for the next several decades. And that in spite of the Xiognu still frequently plundering Han territory. 

  It was only Emperor Wu who dared to officially break the peace. He raised a giant army and planned an ambush at the city of Mayi. A trader was sent to lure the Xiognu into the trap by claiming he had killed the city's ruler and the Shanyu could take it. However, meeting hardly any resistance, the Xiognu got suspicious and eventually caught wind of the plan by questioning a captured Han soldier. The Xiognu turned around and, even though the Han tried to pursue, were able to withdraw without losing a single man.   

The two were now officially at war. At first, the Han seemed to stand no chance, as their infantry and chariots proved to be too slow compared to the Xiognu cavalry. And the Chinese had no experience in fighting a nomadic enemy. Over the next few years, the Xiognu would conduct large-scale raids, and the Han were trying to defend themselves as well as possible: They extended and upgraded the Great Wall to counter the Xiognu's hit-and-run tactics. The Han military also shifted focus towards cavalry, raising a cavalry force of hundreds of thousands. For that, general Li Guangli even conducted a whole separate war against a distant kingdom—the War of the Heavenly Horses.

And slowly the tides began turning: Xiognu raids were defended well, and Han commanders like Wei Qing and Huo Qubing were celebrated as heroes (among the Han, of course) for conducting successful counter-raids. They managed to take over the Hexi Corridor, a long, narrow passage leading through an otherwise ungracious and hostile terrain. Controlling it meant being able to trade or tax trade with the Western parts of the world. The Xiognu had lost a crucial support pillar for their economy. Eventually, they retreated northwards behind the Gobi desert. And the Han, they got back to doing what they did best: building more walls. Extending the existing wall structure along the Hexi Corridor enabled them to open direct trade with the West.

They, however, had not had enough and sought to end this conflict once and for all. Commander Huo Qubing prepared an army and marched as deep into enemy territory as never before, seeking to engage with the Shanyu's army one last time. He marched an arc of over a staggering 1,000 miles, defeating one Xiognu army and capturing many Xiognu nobles on the way. His army reached as far as Lake Baikal. The Shanyu and his army, however, was somewhere else. And not anywhere else. Wei Qing was sent with a smaller army of leftover troops for a smaller expedition further to the west. Against plan, his army encountered the Shanyu's superior elite cavalry, who had been waiting for them, at the Battle of Mobei. Surprisingly, the Han emerged as winners, even annihilating large parts of the Xiognu army. Although the Shanyu escaped this battle, the Xiognu confederacy was ultimately defeated and broke apart.

This war, however, had also proven very costly for the Han. Many horses and men had died, the state treasury was drained, and the economy at an long-time low. But all in all, it paid off; the Han profited massively from the new trade routes and were able to maintain peace. And were left alone by the Xiognu (at least for the next century).  

As for the nomadic horse tribes, they would go on to migrate westward and remain historically impactful. Those were the ancestors of the Huns, who invaded Europe and, centuries later, caused the downfall of the once-mighty Roman Empire.

 

 

I'm also still working on the new encyclopedia page UI, adding some more features. I think I'm close to finishing a good-looking prototype.

Edited by Vantha
  • Like 3
Link to comment
Share on other sites

We're back! While @Vantha is working on the encyclopedia UI we've decided to continue on with the encyclopedia. This time we're focusing on the rest of the Hellenistic Civilizations, that is not only Macedonia but the Seculids and Ptolemies as well! The reason is that although Alexander the Great's empire was broken up into the three different parts, the empires existed at about the same time and all had a common culture taken from Greece.

This PR is the women for all the Hellenistic civilizations, it has some repeated parts because, as I said, the cultures of the three empires were very similar.

https://github.com/TheShadowOfHassen/0-ad-history-encyclopedia-mod/pull/122

 

This is as good a time as any newcomers to join. You don't have to be an amazing historian (I'm most certainly not.) And writing articles is really simple, just check out what we have already written and try to write like that, everything else can be fixed in edits.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

I'm in parallel also writing some texts to keep the progress going. Here's the Ptolemaic, Seleucid, and Macedonian civic centers:

https://github.com/TheShadowOfHassen/0-ad-history-encyclopedia-mod/pull/123/

Quote

The Ptolemaic Kingdom was, just as Macedon, ruled by a monarchy. The royal bloodline descended from Ptolemy I Soter, the founder. Monarchs held both the Egyptian title of pharaoh as well as the Greek of “Basileus” (king). 

Below the king, there was pyramidic administration and bureaucracy system in place adopted from Greece: from a central government at the top to regional ministers to local village chiefs at the bottom. Most political offices were carried out by Greeks. 

This is because, from a legal perspective society was split into two classes, with the upper class being the Greeks and the lower the native Egyptians. There were also, for example, different courts for the two classes.

Quote

The Seleucid Empire was a monarchy and ruled a king with the Greek title of “Basileus”. 

He was not only an absolute ruler but also a self-proclaimed god. Besides, many kings were also military commanders, leading campaigns against external or internal enemies.

The Seleucids largely adopted the administrative structure of the predecessing Achaemenid (Persian) kingdom. Many officials and nobles were allowed to keep their positions. The geographical division was left unchanged too: the huge territory continued to be divided into around 20 satrapies, each governed by a satrap personally appointed by the king. The satraps, mostly Greeks, ran their satrapies fully themselves, but were subordinate to the laws and regulations of the centralized royal government. Each satrapy was subdivided further into smaller eparchies run by an eparch, those into even smaller political units, and so on. Maintaining strong royal authority across the vast territory still turned out to be almost impossible. Many cities and regions became self-governed and gained high levels of autonomy.

Quote

In contrast to many Greek city-states, Macedon was governed by a monarchy. The king, holding the title of “Basileus”, was the head of executive, legislation, and jurisdiction. He also represented the kingdom in foreign affairs and, of course, held supreme command over the military; it was common for him to personally lead troops into battle.

The king was supported by a companionate of personally appointed companions. In its essence, it functioned as what we today would call a court. Most kings gathered various other advisors and bodyguards around themselves as well, often comprised of members of noble families. There was also an assembly of citizen soldiers who could elect or depose a king. It is uncertain, though, how much power these groups actually held.

 

 

  • Like 2
Link to comment
Share on other sites

I have some more texts in the works, but in the meantime here's an update on the UI work:

A quick showcase:

I have done some layouting, moving everything to a place where it fits. It already looks a lot better than before, but I will probably still change some sprites, fonts or colors. How do you like the new arrangement? The right is still pretty empty, this is where the related articles section would be, they have to be added manually to each file and I havent done that (the Athenian civic center is the only article where I added some for testing).

Here are the new features (mainly improving navigation between different pages and menus):

- Because everything is structured like (and in) folders I added the current "path" at the top, by clicking on different parts of the path you can switch to the respective page. There also is an "UpButton" (with the arrow pointing up) to the left of the path that will alway open the current page's "parent" (like the "up" button found in most file managers)

- Every action you take/ every menu or text you open will (temporarily) be saved. With the back and forward button you can move back and forth through your history (like the back and forward button in browsers)

- the button "suprise me!" opens a random article (I am aware that it currently chooses "general" and "environment" more often than "civilisations". That happens because folders inside "civilisations" are only partially filled with files/articles (yet!))

 

I've also put together a quick mod:

encyclopedia.zip

 

Try it out! Let me know any errrors or unwanted behaviour you encounter or any suggestion you have! Keep in mind that it is still in progress, I have cleaned up the code, but it's not very well commented yet. I'm quite new to programming, so don't be suprised if something's done in a confusing way. Tell me if you think I should change something to bring it into line with 0ad's code.

 

And regarding the sprites, @wowgetoffyourcellphone You've done a great job with the mockups. What textures did you use? Are they in the game files? I couldn't find them. I'm specifically talking about the beige/white background and the golden frame around the image. Was the background texture just a brigther and hueshifted version of 0ad's black background?

 

 

Edited by Vantha
  • Like 4
Link to comment
Share on other sites

1 hour ago, Vantha said:

I have some more texts in the works, but in the meantime here's an update on the UI work:

A quick showcase:

 

I have done some layouting, moving everything to a place where it fits. It already looks a lot better than before, but I will probably still change some sprites, fonts or colors. How do you like the new arrangement? The right is still pretty empty, this is where the related articles section would be, they have to be added manually to each file and I havent done that (the Athenian civic center is the only article where I added some for testing).

Here are the new features (mainly improving navigation between different pages and menus):

- Because everything is structured like (and in) folders I added the current "path" at the top, by clicking on different parts of the path you can switch to the respective page. There also is an "UpButton" (with the arrow pointing up) to the left of the path that will alway open the current page's "parent" (like the "up" button found in most file managers)

- Every action you take/ every menu or text you open will (temporarily) be saved. With the back and forward button you can move back and forth through your history (like the back and forward button in browsers)

- the button "suprise me!" opens a random article (I am aware that it currently chooses "general" and "environment" more often than "civilisations". That happens because folders inside "civilisations" are only partially filled with files/articles (yet!))

 

I've also put together a quick mod:

encyclopedia.zip 221.72 kB · 0 downloads

 

Try it out! Let me know any errrors or unwanted behaviour you encounter or any suggestion you have! Keep in mind that it is still in progress, I have cleaned up the code, but it's not very well commented yet. I'm quite new to programming, so don't be suprised if something's done in a confusing way. Tell me if you think I should change something to bring it into line with 0ad's code.

 

And regarding the sprites, @wowgetoffyourcellphone You've done a great job with the mockups. What textures did you use? Are they in the game files? I couldn't find them. I'm specifically talking about the beige/white background and the golden frame around the image. Was the background texture just a brigther and hueshifted version of 0ad's black background?

 

 

It's looking good @Vantha! In regard to @wowgetoffyourcellphone I think he built the UI concepts with images and photoshop. If you can't find the icons you could probably load the images in something like GIMP and cut them out.

Link to comment
Share on other sites

Library of Alexandria

https://github.com/TheShadowOfHassen/0-ad-history-encyclopedia-mod/pull/124

Quote

The Library of Alexandria is without a doubt the most famous library of classical antiquity, and not without reason. It was meant as a universal library to collect and conserve all books in the world. The library was constructed in the early decades of the Ptolemaic kingdom as part of the Alexandrian Mouseion, an institution for research and scholarship.

 

Under Ptolemaic rule, the entire city of Alexandria grew into a famed metropole renown for knowledge and learning. Many of the most significant scholars at the time worked at or visited its library. According to modern estimations, the library, at its peak, stored several hundreds of thousands of works on papyrus scrolls—a gigantic amount. The building complex surrounding the library functioned as an academic university. There were living quarters, classrooms where lectures were held, meeting and dining rooms, laboratories, and gardens.

The library's prestige and significance slowly declined from the second half of the 2nd century onwards due to a lack of maintenance and funding. It, unfortunately, fell victim to military conflicts and was likely destroyed at the latest in the 3rd century BC.

 

 

Edited by Vantha
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...