C2C - mass XML changes parser

If there is a need, I will surely help. But I am currently far from usable state. -- High fever and awful throat pain. -- And still must work at some damn hard theory (infinite tree automata :cry:) for some foundation for new type systems. So it will need to wait.

Or at least I can help, by giving some instructions, how to write it. But it will require resignation from php. -- Thunderbrd said, he wants to learn c++. I believe, it is really nice occasion for him. Except generation XSLT and some library fighting, it's a piece of cake.

@Nimek, how does it look like from your side? Can you deal with c++ or eventually java? -- With Qt or Windows Forms making GUI in c++ isn't hard.

Tends to be what I learn is driven by a need to know basis where my projects push me. I would not, unfortunately, want this distraction at this time and am quite happy to have Nimek sort this out - it's VERY helpful what he's doing here - not to say that what you're suggesting sounds like a bad idea either but I've got years of projects to work on here and would like to get through those projects as quickly as I can without getting bogged down on side ventures along the way... even if they are ultimately useful things to know (without repetition of use of knowledge I'll probably forget it anyhow ;) )
 
Now all tags are supported by inline editing :)
@n47

Core is already done and php is my native programming language :p so sorry I dont want to change it now.
Entire script is written by me from the beginning with only some jQuery code so it is fast.

Inline editing is only addition. Real purpose is to add mass changes from csv file and to be able to filter xml tags to find bugs.

Everything is simple when you dont do it. In reality it becomes complicated when you doing it first time. Also i decided to php because this parser will be useful in my job.
:shake:
Actually, I think you are rather doing this, to show how useful you are.

The thing is, whatever filters you will make and edition method you will put, this everything is already provided by xslt. Together with much more possibilities, you will never reach.

And no, I did not said, what I proposed is easy, because I'm ignorant. I know, what you are doing may cost you lot of work, that's why I proposed this, as xslt library will do most of work for you, and there is almost nothing to do left except gui and generation xslt templates (something like generation of sql queries). -- And I've done something similar already, so I know what I am saying. Without those xslt templates, it is maybe 30 lines of code + gui form, so yes, it is easy.

But I am of course not in power, to stop you losing your effort. It's your choice. I just feel sorry for you. :(
 
not to say that what you're suggesting sounds like a bad idea
My friend, so you think breaking into CIA computers to steal secret PRUSM plans, trading them to Chinese for starting total war with Russia and making use of the chaos, striking old KGB headquarter to get blueprints of XSLT, is a bad idea? :think:
;)

Please, don't be so hasty to assess my claims. I rather do not propose things recklessly. It is not that, with what I actually pointed, you will get something totally different from what is Nimek making. No. With this, you can include everything what he is planning to do, even in similar form, but you still allows to perform more precise and more complex operations. And moreover, doing this will consume probably 10% of time, what Nimek will need to sacrifice now.

And one more. Are you aware, that what is actually happening here, brings to power one of capitalists' claims, that people can't be free and do what they want to, because they will do it ineffectively or even they results can be useless, so you need to put them under control, to create an effective society? -- This brings me a pain, as I would like to fight this claim, but people are acting like they would have no problem with it and remain it true.
 
Actually, I think you are rather doing this, to show how useful you are.

No comment. but for future please avoid that kind of words.
I started this project to help TB with CombatMod - xml reading and inline editing is for fun .

Updates
  • added file upload option
  • added zip files support
  • code tweaks to support nested tags better
  • code tweaks that allow works with any XML file
  • added tablesort jquery plugin so you can reorder rows by clicking on table header

With this changes you can upload any XML file read it and change it values inline.
My Hosting provider has some server problems so i will upload this changes later.
 
No comment. but for future please avoid that kind of words.
I started this project to help TB with CombatMod - xml reading and inline editing is for fun .
No Nimek. If someone really wants to help, he tries to choose the best possible solution, not the solution he likes, even if it means loss of his work. However, people often help others to fulfill their own desire of usefulness. And this is actually what matches the way you are acting.

I am wondering, how would you feel, if I would make a much better editor, in few days and make your work completely useless? You of course will be happy, that everybody have a really good tool, don't you?

-- No, do not worry. I care about people's work. So if there will be no request or I will see no real need for it, I am not going to throw away yours.
 
I dont know where you are going with that kind of talk.
No metter.

1 I am php coder and I work in php and dont want to learn other languages now.
2 I hope that my work will be usefull.
3 This editor costed me maybe 1 full day of work so not so much.

I will be happy when you help to develop better DLL.

NOw I reuploading it to another i hope better hosting provider.
 
1 I am php coder and I work in php and dont want to learn other languages now.
This sounds little strange for me. Are you self-taught man?

I hope that my work will be usefull.
Ok. So do you have an idea, how to add lets say 3 to the strength of all diesel ships with your editor? Or add 20% to the strength of all artillery units? Or add a new nested tag, like <UnitAI> or <TerrainImpassable>? Or manage properly heavily nested <TrainCondition>? Or move all from <PrereqBonuses> to <TrainCondition>? Yes, I believe your work will be somehow useful. But am afraid, it may not cover all needs. And if in some point of time, I will need to do another editor, your will be useless, because there will be no point in using a weaker tool.

3 This editor costed me maybe 1 full day of work so not so much.
I'm really happy to hear that.

Oh, and about that, where I was going. I was going to say:
If your main goal would be to help, you would weigh up your and mine solution and if mine would be better (I can't know what exactly is in your head, but it is very unlikely that solution based on xslt would be weaker) you would try to find the best way to embody this solution. If you would be out of power to make it by yourself, you would probably look for someone who can do it. And if there would be no one and you would be out of other ideas, then! you would go back to your solution.
-- Rather then deep-in-your-as*ing everything, which stand against your idea.

Or maybe I've drunken too much tee and mistaken something with Winnie-the-Pooh? :crazyeye:
 
Ok. So do you have an idea, how to add lets say 3 to the strength of all diesel ships with your editor? Or add 20% to the strength of all artillery units? Or add a new nested tag, like <UnitAI> or <TerrainImpassable>? Or manage properly

Yes it wil be possible. It is easy to code. Mass changes support is another part i want to do.
In php you have simple xml library and xml manipulation is relatively easy with that.
 
@n47

Belive in power of php and power of my skills.
Now. Stop talking. Go to dll work i find new way to significant improve turn times.
Surprise me by that because now you only talk a lot ;)
 
@n47

Belive in power of php and power of my skills.
Now. Stop talking. Go to dll work and find new way to significant improve turn times.
Surprise me by that because now you only talk a lot ;)
 
The problem which I see is not only xml management, but connecting it with your approach of xml viewing. Of course, you can do whatever you want, if you will make a special code for each functionality. But this way, you will need to add new code each time there will be need of a functionality which you do not cover. And there is no guarantee you will be always here to write this new code.

Nimek said:
Belive in power of php
Actually, I am programming languages scientist and from my point of view php is one of worst commonly used languages ever created. So you hit with this, like with a red cape to a bull. ;)

Nimek said:
Now. Stop talking. Go to dll work and find new way to significant improve turn times.
Surprise me by that because now you only talk a lot
This is mostly out of my scope. What takes so much is AI evaluation and this is not in my interests.

Besides, giving orders to an anarchist, isn't the cleverest idea. :lol:
 
Without getting into the gritty details of the XSLT debate, I would like to point out that would probably be possible to implement a system similar to that of Civ 5, where all game data is stored in sqllite databases and you can add/change things either with XML (which is converted automatically to SQL statements) or raw SQL statements. Then you could have something like this

Code:
UPDATE UnitInfos SET iCost = iCost * 2 WHERE Unitcombat = 'UNITCOMBAT_ASSAULT_MECH'

run on top of the XML data loaded into memory to easily eliminate repetitive and boring XML tag changes (what I wouldn't have given to have that when I was refactoring unit and building costs!) It also has the benefit that SQL syntax is easier (IMHO) to use than XSLT and both give similar results. This is one feature I love about civ 5 modding that I think C2C could use.

Also n47, please try to be more, shall we say, diplomatic with your responses to other posters. I understand that you are a very advanced programmer but not all of us are at your and Koshling's level and you shouldn't look at people with disdain because of that.
 
Importing xml to sql is not hard but i see no reason to do it for only parser needs. Import xml to sql - make changes - export xml from sql Simply doest make sense.

I dont know that we can to change game engine to work with sql instead with xml?
 
While I like sql XML is more democratic as you can edit it in notepad if necessary. So anyone can work on it. SQL requires extra software that does not come with the operating system.;)
 
Importing xml to sql is not hard but i see no reason to do it for only parser needs. Import xml to sql - make changes - export xml from sql Simply doest make sense.

I dont know that we can to change game engine to work with sql instead with xml?

While I like sql XML is more democratic as you can edit it in notepad if necessary. So anyone can work on it. SQL requires extra software that does not come with the operating system.;)

You can write SQL statements and queries with a text editor.;) And we could use sqllite freely for the backend (if necessary in the DLL) as it is public domain. I'm just throwing another idea out there as among other things it would eliminate the need for such a parser and mass editor.
 
@ls612, it is some option. But I thought that XML is read by engine and we can't do much about it.

And SQL is flat, so you can't do things like nested nodes straight forwardly. So this could be a real problem for modders, to learn how to edit such database. -- Actually, it would be a problem for me to edit for example TrainCondition tag with lets say SQLite Administrator without SQL queries. ;)

Maybe some objective database would do, here ? (I know little about them.)

Still you can be right, that SQL is simpler then XSLT. But please do not demonize XSLT. It isn't hard.
 
Also n47, please try to be more, shall we say, diplomatic with your responses to other posters. I understand that you are a very advanced programmer but not all of us are at your and Koshling's level and you shouldn't look at people with disdain because of that.
Please don't take me wrong. I understand that and absolutely do not look at people with disdain, because of so puny things! I would need a really serious reason for something like that. -- Like hurting other beings, because of some personal desires.

At this point I am rather angry or maybe disappointed, because of Nimek's hypocrisy and one another thing I pointed in the post TD.
 
@ls612, it is some option. But I thought that XML is read by engine and we can't do much about it.

And SQL is flat, so you can't do things like nested nodes straight forwardly. So this could be a real problem for modders, to learn how to edit such database. -- Actually, it would be a problem for me to edit for example TrainCondition tag with lets say SQLite Administrator without SQL queries. ;)

Maybe some objective database would do, here ? (I know little about them.)

Still you can be right, that SQL is simpler then XSLT. But please do not demonize XSLT. It isn't hard.

The XML is not read by the engine at all, only by the DLL. The engine reads it only as entity properties from APIs exposed by the DLL. As ls612 says, we could entirely replace XML storage of assets with SQL at runtime. However, we'd still need export and import to/from SQL to some serialized format for installation and upgrade, so practically we'd probably be exporting to/from some flat format (and XML is as good as any) which would relegate the SQL to a runtime store of the asset definition. IMO it's too much effort to justify just for that. If it also stored game state (so units etc.) as databases, and allowed runtime access to the gamestate via SQL (so it doesn't have to all be memory resident) then it might be justified (and I think that's what drove it for Civ V). However, if game states became database instances we'd then have compatibility issues since we'd have to be able to load them across schema changes, which means we'd AGAIN need to serialize to/from some other format (like current save compatibility format), which would be a bit of a nightmare (Civ V doesn't allow games to be saved in one schema and loaded in another I presume?? [i.e. - doesn't have the equivalent of our compatibility save capability])
 
@Koshling, I rather agree. Only things I can think of is reducing this 150MB to 15, which we probably do not care, and the speed of reading. But I have a feeling, that more then the reading takes some strange evaluation at the beginning, which looks like some strange, damn slow, IO access.

Btw, Koshling, what is going on during that whole time, when used memory is like 16MB, 2% of CPU, and only Other IO counter grows?
 
Top Bottom