Star Conflict Wiki (discussion)

Oh sure, back in the day modding was actively supported by plenty of games, but that was before DLCs and micro-transaction stores made third-party mods unwanted threats to monetization. :wink:

I don’t know if it’s “actively” supported, but look at http://www.simtropolis.com/ and think about how old SimCity 4 is.  It’s ten years old and still being played!  People are still buying new copies.

 

The wiki’s gone, but it was so useless it’s like it was added hoping the community would support it, but lock out anyone not approved.  If it were actually open to anyone, even the trolls, and the devs gave easy access data about weapons and ships it could have been good.

That we need is a single excel file with the base stats of each ships at synergy level 1, One with all the military/experimental weapons and modules.

 

The Mk1/2/3 can be find in the warehouse. And I will check if I still have my old spreadsheet with a lot of outdated informations.

 

I will take a look on what I can udapte or rework.

The devs could spend a day working on it so there’s a database publicly available that includes everything and is automatically updated for each patch.  Stealth nerfs and bufs seem to be an issue.

There are literally thousands of mods available for World of Tanks and the two games are pretty similar in the basic concept. I, for example, would love to be able to modify the UI in SC, because I’m not happy with it at all.

 

UI mods - I guess they would be fairly doable either, but this is something where the game itself should already run - as I said here or somewhere else, UI programming is one of the most tedious jobs out there; there is a certain kind of hate and love I feel to that part of coding myself; I myself did a lot of jobs in that area, but I do understand, why today’s focus tries to go on web applications.

I did sometimes feel, I am faster in writing a phyiscs engine, than designing an UI, because UI is so much details…

My guess is, that this engine uses some kind of UI scripting anyway - my bet goes on lua, since its the easiest and smallest to use; possibly also one of the fastest - so creating an api, where people can modify stuff on their own might be some good idea for the 1.2 release or sth. - but since the interface had a lot of bugfixing in the last 3 months and is still somewhat glitchy, and also game mechanics change, I would not really expect it atm. Modding UI usually needs a good UI api, to disallow mods becoming unfair or dysfunctional. A non-moddable ui which works is better than a moddable one, which is broken; also a stable API is better, than some where each patch the UI scripts have to be updated or changed.

Just imagine the work of scripting we would have had to do in the last couple months :smiley:

 

 

The devs could spend a day working on it so there’s a database publicly available that includes everything and is automatically updated for each patch.  Stealth nerfs and bufs seem to be an issue.

 

In the dropbox mentioned in this thread earlier is a CSV file. Open it with either Excel or OpenOffice, import with delimiters set to “;” (and ; only, since it uses ‘,’ as decimal separator for floats, so otherwise your table will be incorrect in some rows), and voila, you got your excel table.

Of course this is only the ships, not the modules. And still 6 weeks old.

 

I can also provide a python snippet how to display the data for anyone caring.

 

@Topic

will this dropbox be updated to 0.9? especially the CSV? :slight_smile:

Could it also include modules/weapons as another CSV?

Yes, they do use LUA for UI scripting. Keeping UI mods up to date isn’t all that hard, in particular when the UI is scripted anyway. Mostly you inject scripts to modify/extend what’s already there, so the changes they did in the last couple of months wouldn’t have been much of an impact to UI mods, if any. E.g. a modification to the hard to see reticle would at the base be a mod you’d do once and would never have to touch again.

As to the csv, would be nice to get an official update. Although, if someone was to grab that data directly from the client they’d find some interesting info about so far unreleased ships in addition. Because of EULA that’s entirely hypothetical of course. :wink:

I think that they should assign the Wiki to a dev team member and offer incentives for the top wiki contributors or something. 

I was going to say we’re getting ahead of ourselves when there isn’t currently a wiki to do it on, but it now appears to be back, so woo. \o/

 

Well, parsing the data from the CSV in to whatever format is easy enough, any office spreadsheet or database app will do that. The bit I don’t know how to do is a script to submit edits to the wiki.

Well, using a script to format the data in the CSV to be placed in html code, equal to the wikipage is the first step. what you would solve by script is basicly a template generator.
 
However, posting it on the wiki from external sources is only possible if the section in question is ready to be automated (either, no data inside, or something that marks the beginning and the end of the data to substitute)
 
When I was talking about writing it to the wiki, I meant to build a wiki based on templates which are prepopulated with data; in this case of course, the wiki software has to offer something to guide this, otherwise, existing edits or later additions by people might get swiped in the process.
 
So doing this requires 2 steps:
* One of them is parsing the CSV, and outputting a segment of wiki data, which you want to fill into the wikipage.
That is fairly easy; It includes however the knowledge of how to actually fill out the templates.
 
* The other is to access the wiki on the web, select the right page, and insert or replace the segment, which you auto-update with scripts. That part is more advanced, albeit some selenium script could solve that. This second part I would not really do at all, instead, I would use the templates built by the first part actually on a local script on the system where the wiki runs, and update the wiki contents directly from there, not by simulating web-forms. But it can be done, as I said, I did similar stuff with selenium+python.
 
For the first part, if e.g. done in python, some code like the following might be a good place to start. I want to show with this, that actually, the “work” part which still would be needed by a coder who creates such a tool would be how the templates should actually look like in the end.

import csv
# This code is provided as proof of concept, without any warranty.
def parse_specs(csv_file='ShipSpec.csv'):
    ''' opens the CSV file, reads each entry into a dictionary
        returns a list of dictionaries.
    '''
    res = []
    with open(csv_file, 'rb') as csvfile:
        shipreader = csv.reader(csvfile, delimiter=';')
        keys = None
        for row in shipreader:
            if keys is None:
                # first row holds key names.
                keys = row
                continue
            ship = {}
            for i in xrange(len(row)):
                ship[str.lower(keys[i])] = row[i]
            res.append(ship)
    return res

if __name__ == ' __main__':
    specs = parse_specs('ShipSpec.csv') # replace to location where it is saved.
    template = '''
        %(name)s has %(hull_max)s pts. hull and %(shield_max)s pts. shield on synergy level %(synergy)s
    '''
    for spec in specs:
        # print all ship templates
        print template % spec
        print '#' * 80

That post above probably has more characters than the code you’d need to dump the data onto the wiki. :wink:

But as long as we do not have an updated (and official) data source it’s a moot point anyway.

It seems we’re trying to solve different problems. We already have a wiki template that takes data and turns it in to a formatted ship page, like this:

{{Ship
|name=Dvergr
|description=’’ ‘This is a training interceptor belonging to the military-space forces of the Empire; reliable and unpretentious, it is the first ship of any Imperial pilot.’ ‘’

The AJF-12 “Dvergr” is a Tier 1 interceptor and the first available to the Empire faction. It is unlocked at Rank 2 and grants a +15% reward bonus.

|class=Interceptors
|role=Recon
|tech=1
|faction=Empire
|hullmod=n
|shieldmod=n
|capacitormod=n
|compmod=n
|enginemod=n
|active1=y
|active2=y
|active3=n
|active4=n
|passive1=n
|passive2=n
|passive3=n
|passive4=n
|features=
* Main weapon damage increased by 10%
* Beacon capture speed increased by 35%
* Critical chance increased by 15%
|shieldkinetic=30
|shieldthermal=0
|shieldem=-30
|hullkinetic=-15
|hullthermal=15
|hullem=45
|energy=210
|energyregen=41
|hull=3615
|shield=2245
|shieldregen=75
|lockrange=7500
|lockspeed=1
|forwardspeed=262
|reversespeed=80
|strafespeed=91
|acceleration=21
|afterburnerspeed=393
|afterburnerenergyuse=50
|pitchspeed=78
|rollspeed=102
|maxsynergy=3
|maxenergy=
|maxenergyregen=
|maxhull=
|maxshield=
|maxshieldregen=
|maxlockrange=
|maxforwardspeed=
|maxreversespeed=
|maxstrafespeed=
|maxacceleration=
|maxafterburnerspeed=
|maxafterburnerenergyuse=
|maxpitchspeed=
|maxrollspeed=
}}

Creating a macro that will take a line of a spreadsheet and turn it in to that is a quite trivial exercise in any desktop spreadsheet application, you hardly need a python script for it.

 

The bit I’d *really* like to automate is the second part, a script that would open  http://wiki.star-conflict.com/index.php?title=Dvergr&action=edit replace the content with the template with the right numbers in it and submit the edit for me, then repeat for the other 100 or so ships we’re still missing.

Working with spreadsheets and macros is what I actually assumed you would do. I knew there already was a template, and no, we don’t “seem to solve different problems”, my description of each step stays valid no matter what you use, and I basicly tried to find out, what exactly you really wanna do, and how far you got :wink: It is the way I talk, I know people seem to think, if I “assume” things, I really don’t know them, which is a hint for Snib to read my sentences correctly, from earlier. So, I think we arrived at “ah, ok”.

 

 

If you are simply trying to replace the whole edit field, as said, try doing it with selenium.

http://docs.seleniumhq.org/

 

It is fairly simply to use, I think it even does things like recording macros, at least I had such a plugin in Firefox once. Again, it is scriptable - JS or python or anything.

Finding the edit field should be fairly simple. Creating some small script which opens X pages and enters data, too.

 

Which brings me back to the step, where you work with spreadsheets: my code above, used with the template code you provided, extended to use selenium to autofill webpages, and you’re done. The reason why spreadsheet makros are worse is, that once you got the data in something like python, you can just work on with that data, with this even if you solve the updating of websites, you have to put in the spreadsheet-macroed data :slight_smile:

Of course, this would need you to actually use a programming language, if that is too much work, Creating a Selenium macro, and copy pasting the macro-data into it, should work too!

the link you provided does not work for the general population btw.

:wink:

 

learning selenium is btw. pretty cool for software testing / QA jobs, it is basicly industry standard, it’s not even a complete waste of time to handle it. :slight_smile: if you love excel macros, i guess you’ll love this.

Oh snap, yeah Selenium looks like exactly what I want. Thanks.

I know people seem to think, if I “assume” things, I really don’t know them, which is a hint for Snib to read my sentences correctly, from earlier.

No I’m reading you fine, you’re very much in love with Selenium. It’s ok. :wink:

Also I never attacked your knowledge. If I had, I’d have started by pointing out that you do not want to put HTML onto a wiki and taken it from there. Let’s be friends though. :wink:

Also as a hint for you: You were confusing him because you talk to him like he was a client, trying to impress him with technical lingo and a lot of info that’s largely irrelevant to him (sure, backend access is best but none of us here have it).

 

The bit I’d *really* like to automate is the second part, a script that would open http://wiki.star-conflict.com/index.php?title=Dvergr&action=edit replace the content with the template with the right numbers in it and submit the edit for me, then repeat for the other 100 or so ships we’re still missing.

Since you mentioned Excel, you could even do it in that, it’s got a programming language built in. But it hardly matters, anything works. Even Selenium. :wink: (Browser macro languages save you coding the login to the wiki so if you want that’s an advantage)

To simplify the code to nothing more but a create/replace page operation instead of starting to search&replace content I suggest you dump it into a sub-page and include that into the main via the template. That way you basically need 3 lines of code for the whole uploading logic. It’s how I had set up the World of Tanks wiki, so maybe take a look there to see what I mean: http://wiki.worldoftanks.eu/M46_Patton.

Advanced things you could do: Automatically upload the images to the pages (I noticed you had renamed all ship image file names to the real ship names so now you’ll either need to rename or re-upload them all), automatically generate the overview pages (probably not worth the time to code it since it does not change all that often I suppose), etc.

Also I never attacked your knowledge. If I had, I’d have started by pointing out that you do not want to put HTML onto a wiki and taken it from there. Let’s be friends though. :wink:

 

You read me wrong. I was talking e.g. about the assumption about used scripted languages. :wink:

–

 

I am not in love with selenium. I just know, it works well for Testers who do not code much. I also used it heavily in closed testing suites programmed entirely out of python, combined with internal http tests written entirely in python; so selenium is pretty much bad-assaultship at entry level, and stays bad-assaultship no matter how far you go. It still depends on a browser to be used, tho, so most of the stuff done by selenium is easily doable in a completely native way, either. 

 

As for the lingo  - yeah. You get used to it. But the technical lingo is not there to impress, thats a wrong assumption. It was meant to outline how I see it, how I would solve it, and lead to the specific question of missing information or clarification, so worked as intended. If I sound smart-assy, it is a nice by-product, but not the general intent. I am already old enough to not have to prove myself in every detail :slight_smile:

You read me wrong. I was talking e.g. about the assumption about used scripted languages. :wink:

So you were complaining that I confirmed your “assumption” about LUA because apparently it wasn’t an assumption but you had already checked it yourself? You see me raise an eyebrow, but let’s leave it at that.

 

If I sound smart-assy, it is a nice by-product

No, it’s not. :wink:

Bear in mind no single player is going to be around forever - the aim is to come up with a way to automatically populate the ship database that can be done by anyone and that isn’t reliant on a whizzy personal setup. Hence my objection to a python script to transform a CSV file to text, not because it’s unsuitable but because it’s unnecessary when a common-and-garden office app can do that part of the job. The objective isn’t to come up with the most clever process, quite the opposite in fact, I want it as simple and maintainable as possible.

It seems installing either Selenium or python with the appropriate web forms library is unavoidable though. I guess I’ll look at both. Selenium looks more usable for non-coders though, which future maintainers might not be.

 

Yeah I’d already come to the conclusion that the easiest way to have custom user content on the ship pages without clobbering it is to hive off the data on to a separate page and transclude it.

Bear in mind no single player is going to be around forever - the aim is to come up with a way to automatically populate the ship database that can be done by anyone and that isn’t reliant on a whizzy personal setup.

Several possible solutions to that.

The best one would be a wiki extension that we would need someone with access to the wiki server to install, which I suppose is not an option. Would have to be written in PHP.

Second best would be a hosted remote-updating solution on some free host that automatically pulls the csv from the dropbox account, checks for updates once a week or so and remotely updates the wiki where applicable. Would have to be written in whatever language your host supports (typically PHP or Python).

Finally, you can go with a client based solution that any wiki editor can use and make it available to anyone. Doesn’t matter what language you write it in but compiled code is the most flexible since it works out of the box without the user having to tinker with things like Python first.

FYI re csv:

The developers come back next week and we update.

Just a note: I’ll provide automation once we get the next data file. Wouldn’t have been right to say it’s trivial and then not do it. :wink: