Research tree editor

For code related discussions and questions
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

OK, moving forward with the editor, i need to start figuring out some of the mysteries of the research tree in wz, and hell it sure does has a lot...

So before we get to the big mysteries, lets start off with the small ones.

First off... figuring out the resultcomponent.txt file fields (I do know what the file is for, just need more details)

ok, so we have 6 fields inside the file

#1 Research that produces the component
#2 Name of the component that results from the given research in #1
#3 Type of the component in #2
#4 unknown
#5 unknown
#6 modder signature (or unused whatever you like it best.)

So I have seen that some researchs do use #4 & #5, mostly the weird researches. So, I'm starting off with a little weird one....

Understanding Auto Repair

So looking at research.txt we have

R-Sys-Autorepair-General,Level All,IMAGE_RES_GRPREP,0,IMAGE_RES_COMPUTERTECH,ICCCCONS.PIE,0,RES_SY_AR,0,0,BODY,14400,1,1,0,0,0,0,0,1

ok then we have the resulting component from that

R-Sys-Autorepair-General,AutoRepair,REPAIR,ZNULLREPAIR,REPAIR,6

and then we have the entries on the repair.txt

ZNULLREPAIR,Level All,0,0,0,0,0,0,DEFAULT,0,0,0,100,0
AutoRepair,Level One,0,0,0,0,0,1,DEFAULT,0,0,100,75,0

So how do they work?
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Research tree editor

Post by Zarel »

winsrp wrote:ok, so we have 6 fields inside the file

#1 Research that produces the component
#2 Name of the component that results from the given research in #1
#3 Type of the component in #2
#4 unknown
#5 unknown
#6 modder signature (or unused whatever you like it best.)
#4 and #5 are the component it auto-replaces, and the type thereof.

Auto-replace isn't used as much as it used to - the most memorable example is probably the auto-replace Ripple -> Archie (no longer active), and the auto-replace Flashlight -> Pulse (which I think still is).
winsrp wrote:Understanding Auto Repair
...what do you want to know about it? I don't see anything confusing about what you said.
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

So, auto replaces...

In this case you are telling me that ..... Auto Repair, replaces ZNULLREPAIR and that magically makes all my units auto repair itself? No functions no scripts no nothing? So if I put the auto repair line as the first line of the repair.txt then all unit would have auto repair from game start (wild guess here)?
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

let put a more complicated case, how does cyborgs work in terms of researches, and lets put a simple one.

Flamer (cyborg)

This is supposedly given when you research the Flamer, and it will produce the flamer cyborg, but on the research tree, it produces something like the flamer cyborg body not the flamer itself.

resultComponent for flamer

R-Wpn-Flamer01Mk1,CyborgFlamerGrd,BODY,0,0,2

And this relates to the body.txt

CyborgFlamerGrd,Level All,LIGHT,25,95,150,200,cybd_std.pie,100,1,500,12,6,12,6,12,6,12,6,12,6,12,6,0,0

I have seen that on assignweapons.txt there is also a line that relates the cyborg flamer body to the cyborg flamer weapon

Cyb-Flamer-GROUND,CyborgFlamer01,NULL,NULL,0

But what I don't get is

Question: when CyborgFlamerGrd was transformed to Cyb-Flamer-GROUND, so it can be related to the weapon???
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Research tree editor

Post by Zarel »

winsrp wrote:So, auto replaces...

In this case you are telling me that ..... Auto Repair, replaces ZNULLREPAIR and that magically makes all my units auto repair itself? No functions no scripts no nothing? So if I put the auto repair line as the first line of the repair.txt then all unit would have auto repair from game start (wild guess here)?
I think so. ZNULLREPAIR might be hardcoded, though.
winsrp wrote:let put a more complicated case, how does cyborgs work in terms of researches, and lets put a simple one.

Flamer (cyborg)

This is supposedly given when you research the Flamer, and it will produce the flamer cyborg, but on the research tree, it produces something like the flamer cyborg body not the flamer itself.
Oh, man. This is the one part of the research tree I've never understood. I think it's handled in the wzscripting or something.

It's not just "researching the body unlocks all entries using that body in templates.txt" - I think I've tested that hypothesis.
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

hmmm.... starting to get weird then... I like that... :twisted:

then I would need to see how the CyborgFlamerGrd is transformed to Cyb-Flamer-GROUND in order to relate the body to the weapon.

Since it happens the same for all cyborgs, they all produce a body, and that body magically becomes a cyborg, but there is no info on how assignweapons.txt is related to body.txt...

Who offers to give it a deep research on how this works?
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

hey.... wait a minute, what does templates.txt has to do with this? ain't it for SP only? O_o
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Research tree editor

Post by Zarel »

winsrp wrote:hey.... wait a minute, what does templates.txt has to do with this? ain't it for SP only? O_o
Erm... you realize that all units are templates, right? Everything you see in the Manufacture or Design screens are templates. Cyborgs (and Transports) included. When you research a cyborg, activating the cyborg body component will make the corresponding template manufacturable.

...and how can something involve assignweapons but not templates? assignweapons assigns weapons to templates...
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

so... the templates.txt and assignedweapons.txt are just a way to avoid having a design screen for certain types of units, i.e. cyborgs on which you only have 2 parts, a body and a weapon, no propulsion, but in this case, there is no standard body for cyborgs, they all have a different body since the body pie contains the weapon inside it, but, it must be given the behavior when you assign it to a weapon,

In this case i can have the flamer cyborg body shooting lancer rockets if I make the wrong assignment?

Dang... what a complicated game... ;)
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: Research tree editor

Post by Zarel »

winsrp wrote:so... the templates.txt and assignedweapons.txt are just a way to avoid having a design screen for certain types of units, i.e. cyborgs on which you only have 2 parts, a body and a weapon, no propulsion, but in this case, there is no standard body for cyborgs, they all have a different body since the body pie contains the weapon inside it, but, it must be given the behavior when you assign it to a weapon,
Yes, but all of them have all three parts.

Cyborgs have a propulsion, too. They all have the same propulsion. It's called Cyborg Propulsion. You can see it here:

http://guide.wz2100.net/bp/
winsrp wrote:In this case i can have the flamer cyborg body shooting lancer rockets if I make the wrong assignment?
Yep.
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

so the info is now complete.... and I shall make it all work together... somehow... in the editor.

Thanks for the time Zarel.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Research tree editor

Post by Buginator »

winsrp wrote:so the info is now complete.... and I shall make it all work together... somehow... in the editor.
Winsrp, how are you making the editor? If you are using C/C++/C# or something along those lines, would it be possible for you to use Qt, so it can be used on all platforms?

If not, would you consider releasing the source code, so maybe other people can port it to Qt?
and it ends here.
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

well I'm using vb.net 2008 along with linq, so I'm not sure if the linq part can be ported, at least not that easy.

But if you want the code then I will gladly give it.
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

and what the heck is Qt?
winsrp
Trained
Trained
Posts: 417
Joined: 14 May 2008, 17:00

Re: Research tree editor

Post by winsrp »

anyway, back on questions, where can I find a list of the available functions? I know functions.txt has some reation between the the researches, and the actual funcion with parameters, can someone give me the list of functions and what their parameters are for.... so far I have
  • Production
    Research Upgrade
    Repair Droid
    Power Generator
    Resource
    Production Upgrade
    Weapon Upgrade
    Wall Function
    Structure Upgrade
    WallDefence Upgrade
    Research
    Repair Upgrade
    Power Upgrade
    VehicleBody Upgrade
    VehicleConst Upgrade
    VehicleECM Upgrade
    VehicleRepair Upgrade
    VehicleSensor Upgrade
    ReArm
    ReArm Upgrade
Are there more?
Post Reply