Jump to content

How to mod 0AD from Zero?


archaeopteryx
 Share

Recommended Posts

I know there's a topic about how to modify 0ad created several years ago and also a subforum called tutorials and guides. So why do I create this one in this place would you tell me?

Well I'm planning to create a mod, but being sincere I don't really understand the wiki's page. So I have a pair of questions for you:

1. Can I use text editors like Gedit to change the files I'm going to modify? Or is it going to corrupt something? What's the safest and cleanest tool to use?

2. If there's a game's new version, will I have to rewrite/remake my mod? In the wiki's page there's nothing about it.

3. How do I add triggers to just one map. Is the JS Console useful for something?

4. Is zero 0ad in its actual stage better for modding the general gameplay?... Or is it also enough capable modifying only a map with triggers plus personalized actors and entities(as far as basic statistics is concerned like the unit's health, the type of defense, range, in brief, all the basic stats including those of the buildings)???

5. This is more for the developers. Currently (A25), what things cause more lag to the game? To illustrate: let's say I'm planning to change heavily the IA with lots of APM and stuff like that so I'm going to face problems, so it's good to know what not to modify heavily. In addition, what exactly causes the lag in maps like the Egypt 3v3?

6. In one of your last development report there was presented an auto-building feature, how difficult is to implement stuff like that in the actual gameplay?

7. And lastly, what's the most powerful--in terms of funcionability--programming language to modify 0ad?

Thanks for your attention.

If there's a team of modders looking for members I'm willing to offer my hand to help you. I think that's the most useful way to learn about modding this game.

PD: Please sirs, someone of you knows how to upgrade to A25 in Ubutu 16?

 

Link to comment
Share on other sites

incomplete answer:

2. yes. unfortunately, 0AD is still in its alpha phase and it's changing a lot from release to release. there is effort to stabilise it, but not warrant whatsoever yet.

7. mods can be made using xml templates and javascript scripts.

I'll let more experienced users give their answer to the other questions.

Link to comment
Share on other sites

3 hours ago, archaeopteryx said:

1. Can I use text editors like Gedit to change the files I'm going to modify? Or is it going to corrupt something? What's the safest and cleanest tool to use?

You can use whatever you want. I recommend Visual Studio Code as is relatively lightweight but useful enough for editing javascript and xml files. The file wont corrupt, you might get some errors if you are modifying some javascript file and the engine tried to do a live-update of the file, but doing a new save usually re-reloads the file correctly.

3 hours ago, archaeopteryx said:

2. If there's a game's new version, will I have to rewrite/remake my mod? In the wiki's page there's nothing about it.

Depends, if you you change some xml templates and use some elements that no longer are removed/moved/removed then yes. For javascript files you can usually keep compatibility with old 0ad versions if you only add or modify superficially some code of the existing one. For changes on the GUI or similar assume yes too.

3 hours ago, archaeopteryx said:

3. How do I add triggers to just one map. Is the JS Console useful for something?

 

Look at maps that already use triggers, (e.g. random maps: Jebel Barkal, Danubius) and code your triggers like those maps do,  can't help more with that you yourself will have to learn how to do them.
The JS console is not really useful for triggers and the console only can access the GUI javascirpt context (not the simulation or the map generation stage) (GUI= graphic user interface)

3 hours ago, archaeopteryx said:

4. Is zero 0ad in its actual stage better for modding the general gameplay?... Or is it also enough capable modifying only a map with triggers plus personalized actors and entities(as far as basic statistics is concerned like the unit's health, the type of defense, range, in brief, all the basic stats including those of the buildings)???

 

You can modify pretty much everything of the gameplay as long as is not defined in c++, assume everything in js to be modifiable except some parts that are performance sensitive (which are coded in c++, thus you can't modify easy). Pyrogenesis is the name of the engine, and 0ad is the main mod people play, that means you can create a "0ad mod" with your own civilizations, art, buildings and custom javascript components (simulation folder)

3 hours ago, archaeopteryx said:

5. This is more for the developers. Currently (A25), what things cause more lag to the game? To illustrate: let's say I'm planning to change heavily the IA with lots of APM and stuff like that so I'm going to face problems, so it's good to know what not to modify heavily. In addition, what exactly causes the lag in maps like the Egypt 3v3?

 

Units -> the more units -> the more lag
Area effects (auras) -> the more and the bigger -> the more lag
Graphics -> the more high quality -> the more lag
AI -> The more state and code each unit has to process -> the more lag (avoid long loops in unitAI.js that)
Egypt 3v3 lag -> probably because the map size is giant size, has many units, many unique buildings, etc

3 hours ago, archaeopteryx said:

6. In one of your last development report there was presented an auto-building feature, how difficult is to implement stuff like that in the actual gameplay?

 

You mean auto-queue? If you mean auto-building you would have to create a new component in the simulation folder to define it and write the functionality you want, then add that component to the units/buildings you want in their simulation/templates and last, if needed, write the GUI code so the player can interact this new feature.

3 hours ago, archaeopteryx said:

7. And lastly, what's the most powerful--in terms of funcionability--programming language to modify 0ad?

 

There is no most powerful as you can only program in javascript, C++ would be if you want to change the engine (I don't recommend)

 

To know more you will have to ask around the IRC chat https://webchat.quakenet.org/?channels=0ad

  • Like 3
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...