IPB Style© Fisana

Jump to content


New Civs


  • Please log in to reply
15 replies to this topic

#1 mattusili

mattusili

  • Community Newbie

  • Tiro
    (4 posts)

Posted 05 December 2011 - 03:22 PM

I would like create couple of new civs, is it possible to do it in 0 A.D.? What files I have to create or edit to make the civ properly? Pleasre about help?

#2 Geek377

Geek377

  • Web Development Team

  • Primus Pilus
    (1,720 posts)

Posted 05 December 2011 - 10:05 PM

The design document and the artist design document are good places to start. Good luck? And consider applying for an artist or modeler position.
The Geek [ aka Geek377]
Wildfire Games Webmaster
Contact me: Posted Image Posted Image

#3 fcxSanya

fcxSanya

  • WFG Programming Team

  • Centurio
    (646 posts)

Posted 06 December 2011 - 06:20 AM

I propose to look at the Rise of the East mod, you can download it and look how it works. Currently it is impossible to add more civs to extend 0 A.D. properly, so you need to replace existing ones (this is what 'Rise of the East' do) or make your own mod from scratch (not extending 0 A.D.).
Alexander Olkhovskiy [ aka fcxSanya ]
Wildfire Games Programmer
E-mail: fcxsanya at wildfiregames dot com

#4 Spahbod

Spahbod

  • WFG Programming Team

  • Triplicarius
    (534 posts)

Posted 06 December 2011 - 12:49 PM

View PostfcxSanya, on 06 December 2011 - 06:20 AM, said:

I propose to look at the Rise of the East mod, you can download it and look how it works. Currently it is impossible to add more civs to extend 0 A.D. properly, so you need to replace existing ones (this is what 'Rise of the East' do) or make your own mod from scratch (not extending 0 A.D.).

Are you sure it is impossible to add more Civs? You can add a new civ file I think.
Omid Davoodi [ aka Spahbod ]

Wildfire Games Random Map Designer, Low-level Programmer
Contact me: myops37@yahoo.com


Support Wildfire Games!

#5 fcxSanya

fcxSanya

  • WFG Programming Team

  • Centurio
    (646 posts)

Posted 06 December 2011 - 03:00 PM

View PostSpahbod, on 06 December 2011 - 12:49 PM, said:

Are you sure it is impossible to add more Civs? You can add a new civ file I think.
Identity component have the fixed six civilizations (+gaia) in it's schema. This schema used by the templates validator, so if it will encounter some other civ code in templates, the validator will report a error.
Alexander Olkhovskiy [ aka fcxSanya ]
Wildfire Games Programmer
E-mail: fcxsanya at wildfiregames dot com

#6 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,896 posts)

Posted 06 December 2011 - 03:01 PM

Right, but can't that JS file be edited to include a new civ? :)
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#7 fcxSanya

fcxSanya

  • WFG Programming Team

  • Centurio
    (646 posts)

Posted 06 December 2011 - 03:43 PM

View PostMythos_Ruler, on 06 December 2011 - 03:01 PM, said:

Right, but can't that JS file be edited to include a new civ? :)
You can edit it in your local copy, but the question is how you will distribute your mod. I think you can copy this file into your mod and it should override standard (0 A.D.'s) one, but in this case it will be compatible with 0 A.D. only until it is unchanged in 0 A.D. and it will be incompatible with other mods which distribute their own version of this file. It is why I said 'Currently it is impossible to add more civs to extend 0 A.D. properly'. You definitely can find some workaround now, but for true support of moddable civilizations list we need to not hardcode it.
Alexander Olkhovskiy [ aka fcxSanya ]
Wildfire Games Programmer
E-mail: fcxsanya at wildfiregames dot com

#8 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,896 posts)

Posted 06 December 2011 - 05:27 PM

View PostfcxSanya, on 06 December 2011 - 03:43 PM, said:

You can edit it in your local copy, but the question is how you will distribute your mod. I think you can copy this file into your mod and it should override standard (0 A.D.'s) one, but in this case it will be compatible with 0 A.D. only until it is unchanged in 0 A.D. and it will be incompatible with other mods which distribute their own version of this file. It is why I said 'Currently it is impossible to add more civs to extend 0 A.D. properly'. You definitely can find some workaround now, but for true support of moddable civilizations list we need to not hardcode it.
Gotcha. (y)
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#9 SMST

SMST

  • Community Members
    PipPipPipPip

  • Triplicarius
    (534 posts)

Posted 31 December 2011 - 12:36 AM

HOOOLD on a second, everypony. Why were civs hardcoded in the first place?


Posted Image
Platon - it's like Communism without the noble goal.


#10 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,896 posts)

Posted 31 December 2011 - 12:38 AM

View PostSMST, on 31 December 2011 - 12:36 AM, said:

HOOOLD on a second, everypony. Why were civs hardcoded in the first place?
I don't think they're "hard coded," they're just difficult to add at this point by editing a bunch of javascript files.
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#11 SMST

SMST

  • Community Members
    PipPipPipPip

  • Triplicarius
    (534 posts)

Posted 31 December 2011 - 12:42 AM

View PostMythos_Ruler, on 31 December 2011 - 12:38 AM, said:

I don't think they're "hard coded," they're just difficult to add at this point by editing a bunch of javascript files.

fcxSanya said:

[...]but for true support of moddable civilizations list we need to not hardcode it.

What he said.

Edited by SMST, 31 December 2011 - 12:42 AM.


Posted Image
Platon - it's like Communism without the noble goal.


#12 Mythos_Ruler

Mythos_Ruler

  • 0 A.D. Project Leader

  • Megas Philhellene
    (13,896 posts)

Posted 31 December 2011 - 01:01 AM

View PostSMST, on 31 December 2011 - 12:42 AM, said:

What he said.
He doesn't mean that it's hard coded in the game's EXE, only that proper mod support for civs is not implemented yet. I could be wrong.
Michael D. Hafer [aka Mythos_Ruler]

Wildfire Games Project Leader
Contact me: michaeldhafer[at]gmail.com
Support Wildfire Games!


0 A.D.

#13 Kimball

Kimball

  • 0 A.D. Art Team

  • Rise of the East
    (1,615 posts)

Posted 31 December 2011 - 04:23 AM

Just to set the record straight here, Rise of the East does not replace any current faction (even with the current implementation of mod support), and no mod needs to. It will be simpler in the future, but currently there is one aspect that is "hard-coded."

There are two ways of installing the Chinese civilization. Because there are two folders that are automatically recognized by the game (public and internal, hence "hard-coded"), you can download the mod and rename the folder to internal and the game will load the data.

Alternatively, if you've got the binaries and not a compiled version, you can run the following script to load any mod folder:

./pyrogenesis -mod=FOLDERNAME

This is only necessary for team members who already have an internal folder anyway.

In the future, we plan to have the game recognize any and all folders in the mods folder and allow you through a simple GUI prompt to load or disable certain folders to your liking. I'd like this to happen sooner rather than later, but alas, I'm somewhat biased on the matter.

Hope that clears things up. :)

Rob Kimball
Scion Development Producer (Rise of the East)

Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image


#14 fcxSanya

fcxSanya

  • WFG Programming Team

  • Centurio
    (646 posts)

Posted 31 December 2011 - 08:37 AM

View PostSMST, on 31 December 2011 - 12:36 AM, said:

HOOOLD on a second, everypony. Why were civs hardcoded in the first place?

View PostMythos_Ruler, on 31 December 2011 - 12:38 AM, said:

I don't think they're "hard coded," they're just difficult to add at this point by editing a bunch of javascript files.

View PostMythos_Ruler, on 31 December 2011 - 01:01 AM, said:

He doesn't mean that it's hard coded in the game's EXE, only that proper mod support for civs is not implemented yet. I could be wrong.
Here is part of the Indentity.js file:
11 	    "<element name='Civ' a:help='Civilisation that this unit is primarily associated with'>" +
12 	        "<choice>" +
13 	            "<value a:help='Gaia (world objects)'>gaia</value>" +
14 	            "<value a:help='Carthaginians'>cart</value>" +
15 	            "<value a:help='Celts'>celt</value>" +
16 	            "<value a:help='Hellenes'>hele</value>" +
17 	            "<value a:help='Iberians'>iber</value>" +
18 	            "<value a:help='Persians'>pers</value>" +
19 	            "<value a:help='Romans'>rome</value>" +
20 	        "</choice>" +
This is the definite list in the code file, this is why I said 'hardcoded'. But this is a javascript file, i.e. script, so Michael is right, you don't need to have developer tools and recompile the engine (an executable file) to implement changes, you can just edit this file with a regular text editor and your changes will be in the game. This is not much different from a config file editing. And if we will just move this list into separate config file (to not have it hardcoded in this sense), this still will not solve the discussed issue.
More details about engine and mods support: 0 A.D. (as a product) consist from the engine 'pyrogenesis' and the mod ('public'). Engine compiled from C++/C/asm source code into a platform specific executable file. Mods are folders with resources, config files and scripts; they are platform independent and don't require to recompile the engine to implement changes.
You can create your own mod with any civs you want. You can fork the public mod and add civs to it.
The problem only arise when you want to add civ into existing public mod (i.e. extend public mod with your own mod). Even in this case you can copy the Indentity.js into your mod, add a civ into it and it should work correctly with the public mod. It is just not a perfect solution, because you will need to update your mod when the Identity.js is changed and you will not be able to enable multiple such mods simultaneously. We need a mechanism like what Ben implemented for setup screen: there is a separate json file for each civ (in the civs folder, and the loadCivData function in the functions_civinfo.js, so you can just add corresponding civ files into your mod and this will not conflict with civ files added by another mod.

View PostKimball, on 31 December 2011 - 04:23 AM, said:

Rise of the East does not replace any current faction (even with the current implementation of mod support)
Hm, maybe I misunderstood something, but how do you add new civs in this case and what is this:
<Identity>
    <Civ>celt</Civ>
    <SelectionGroupName>units/chin_infantry_spearman_b</SelectionGroupName>
    <SpecificName>Chang Mao Bing</SpecificName>
    <History></History>
    <Icon>units/chin_infantry_spearman.png</Icon>
</Identity>

Alexander Olkhovskiy [ aka fcxSanya ]
Wildfire Games Programmer
E-mail: fcxsanya at wildfiregames dot com

#15 Kimball

Kimball

  • 0 A.D. Art Team

  • Rise of the East
    (1,615 posts)

Posted 31 December 2011 - 09:01 AM

View PostfcxSanya, on 31 December 2011 - 08:37 AM, said:

Hm, maybe I misunderstood something, but how do you add new civs in this case and what is this:
<Identity>
    <Civ>celt</Civ>
    <SelectionGroupName>units/chin_infantry_spearman_b</SelectionGroupName>
    <SpecificName>Chang Mao Bing</SpecificName>
    <History></History>
    <Icon>units/chin_infantry_spearman.png</Icon>
</Identity>

That appears to be a typo. :P The project has thankfully advanced a little since our initial debut almost a year ago. We may have used 'celt' as our civ code for our demo release for simplicity's sake then, but all of our sim files now use 'chin' as the civ code.

Adding a new json file was all we needed to add China as a faction, giving them a civ profile (http://media.moddb.c...ivprofile.1.jpg), validating 'chin' as a civ code and defining a faction emblem for when the player is using them. I'm not sure about selecting them for random maps, as at the time, that wasn't really possible with the present state of the game. Perhaps now we would have had to include them in the Identity.js file (which, as you said, would prevent you from using multiple faction mods simultaneously), which would mean we would need to invent a more intuitive way of adding new factions to that list (perhaps automatically populating that list using available json files?).

Rob Kimball
Scion Development Producer (Rise of the East)

Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image


#16 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 31 December 2011 - 02:54 PM

We could just change the schema to allow arbitrary <text/> instead of using a <choice> list. Then it wouldn't automatically detect typos (like someone writing "<Civ>kart</Civ>") but that seems a rare problem and easily detected by other means.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users