Warzone Database (Stats viewer & calculator) by crab

Did you create a mod, map, music, or a tool? Present them here and earn feedback!
Note: addon requests do not belong here.
Note, everything uploaded to this forum, MUST have a license!
crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: Warzone Database (Stats viewer & calculator) by crab

Post by crab_ »

Duha wrote: If you need I can make python script that converts ini files to json.
PHP allows this functionality
json_encode(parse_ini_file($filename,true)); - this line of code converts ini to json :)

I want to be able open 3.1 stats and mods in my web site
NoQ said we have python-converter() but this converter do not support research.
converter <-- who is author of this?

@Rommel
I have added research tab to design screen
http://wz2100-db-ru.1gb.ru/design.php
designer_research.png
designer_research.png (26.86 KiB) Viewed 9603 times
Last edited by crab_ on 09 Oct 2013, 14:33, edited 1 time in total.
Warzone2100 Guide - http://betaguide.wz2100.net/
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Duha »

crab_ wrote: converter <-- who is author of this?
click history or blame button on github page.
http://addons.wz2100.net/ developer
User avatar
Rommel
Trained
Trained
Posts: 446
Joined: 03 Nov 2012, 19:44

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Rommel »

Nice, hey you know you don't even need to use PHP to convert the ini to JSON? You can do it directly in Javascript - with this approach I am not even sure you would need a server lang to get the data, you can get it directly from the WZ Git Project directly to javascript.

This means that the DB would always be automatically up to date with github

I did a proof of concept here: http://jsfiddle.net/c282E/2/

if you look in the javascript console you will see that there is a JSON object so you can use pure javascript like:

alert( weapons.BusCannon.buildPoints );

I would be nice not have to use a server or php :) makes the system more portable. The only issue with getting the ini direct from github is that github's states that you shouldn't use them for a CDN so maybe the INI files would need to be hosted somewhere
Moving back instead of forward
Seems to me absurd
~
Metallica - Eye of the beholder
crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: Warzone Database (Stats viewer & calculator) by crab

Post by crab_ »

Rommel wrote:Nice, hey you know you don't even need to use PHP to convert the ini to JSON? You can do it directly in Javascript - with this approach I am not even sure you would need a server lang to get the data, you can get it directly from the WZ Git Project directly to javascript.
Wow! Thanks for working example.
I've tried javascript app without server but faced problem - i cant load files with ajax with "cross domain" exception.

Hmm.. I'm afraid javascript+regex can be slower than php-function.
I thinking about caching all stats in localStorage but i need somehow to check if stats data was changed.
I want do loading of stats only 1 time for all pages of my site (i assume localStorage works for whole web-site?)


Currently i use following php-functions:
  1. scandir - check directories for available icons for stats items. I need to know if we have an icon or not.
  2. parse_ini_file
  3. json_encode
  4. ob_start('ob_gzhandler') - enables compression for json data (not sure, may be it is not needed actually)
Warzone2100 Guide - http://betaguide.wz2100.net/
User avatar
Rommel
Trained
Trained
Posts: 446
Joined: 03 Nov 2012, 19:44

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Rommel »

Better to put the processing on the client than the server, even if php is faster for one such call, remember that there is a potential to have many people online at once!

Did you notice it was slow to load or something? Even if the initial load is a little slow, you should only need to load and process the ini files once so after the files are downloaded and saved it should be very fast. To be honest there are a lot of heavier JS app out there than this will be - take Facebook for example, I bet that is heavier on the client than your DB would be! Even youtube!

In regards to local storage you are on the right track and with the files being hosted on GIT I am sure there is a way to tell if files have changed! What you would want to do is process the INI files the first time the user visits the UI and then save it in local storage (probably just save the raw JSON string). After this it would be a simple case of checking the file hashes or what not to find out if they have changed.

What I would do is not even bother checking, just have a button for the user (click to update DB or some such).

You will need some form of local storage anyway so that users can browse the DB while offline.

Keep at it!
Moving back instead of forward
Seems to me absurd
~
Metallica - Eye of the beholder
User avatar
Rommel
Trained
Trained
Posts: 446
Joined: 03 Nov 2012, 19:44

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Rommel »

Oh and just to add, since you won't want all clients loading directly from Gitraw, you would probably have your own central repository holding the ini files in JSON format, then you could load the files from there.

Me I would prefer to have it all contained in pure JS and HTML, without the need for a server side db or processing, but that is what I am into nowadays.
Moving back instead of forward
Seems to me absurd
~
Metallica - Eye of the beholder
crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: Warzone Database (Stats viewer & calculator) by crab

Post by crab_ »

Hello.
My project changed web address: http://warzone2100.info/ (this new hosting looks slower)
direct link to stats database http://warzone2100.info/stats.php
direct link to tank designer http://warzone2100.info/design.php
Now i planning turn this project into new Warzone Guide 8)
Warzone2100 Guide - http://betaguide.wz2100.net/
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Warzone Database (Stats viewer & calculator) by crab

Post by stiv »

Duha wrote:If you need I can make python script that converts ini files to json.
If you have one of these laying around, I could certainly make use of it. Playing with Mongo DB lately which uses JSON as its data format.
crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: Warzone Database (Stats viewer & calculator) by crab

Post by crab_ »

Hello.
I'm continuing working on my project.
Current goal - make new Warzone Guide.

I've added several guide pages, but they are not finished yet.
Weapon page http://warzone2100.info/weapons.php
Body page http://warzone2100.info/Body.php
Propulsion page http://warzone2100.info/propulsion.php
Cyborgs page http://warzone2100.info/cyborgs.php
Buildings page http://warzone2100.info/structure.php

Plans:
1) Redo functionallity and content of the Old Guide (http://web.archive.org/web/201301151511 ... z2100.net/)
2) Add fuctions for testing game balance
3) ..?..

I need fresh ideas and reviews.
Thank you :)

Here is picture for those who dont like clicking links
Attachments
guide1.png
Warzone2100 Guide - http://betaguide.wz2100.net/
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Per »

Looks very good!
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Duha »

crab_ wrote: I need fresh ideas and reviews.
http://warzone2100.info/weapons.php#tank_weapons
Make "align text-align: right;" to all numerical columns
Change research column from time to points. Time depends of you research lab upgrades.
Research time slider is not necessary at this page.
http://addons.wz2100.net/ developer
crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: Warzone Database (Stats viewer & calculator) by crab

Post by crab_ »

Duha wrote:http://warzone2100.info/weapons.php#tank_weapons
Make "align text-align: right;" to all numerical columns
ok, i'll try and see :)
Design can be changed many times (in order to get a good variant), usually i'm playing with css and see what happen.
Duha wrote:Change research column from time to points. Time depends of you research lab upgrades.
In normal Multiplayer game research lab upgrades are maxed at every moment of game.
Research points is more complicated to be understandable.
e.g. Flashlight have 40'000 research points and 200'000 total research point in research path?
What sense have these numbers?
Light cannon have 2000 research points, does it mean it will be researched 20 times faster than flashlight? No, because when you researching light cannon your labs are in slow state.
In case when you see '30:00' - this means you can research Flashlight at 30th minute if you research well.
Research time depends on your tactic, start conditions, but commonly you need research as fast as possible
ResearchPoints.png
ResearchPoints.png (30.34 KiB) Viewed 9388 times
Duha wrote:Research time slider is not necessary at this page.
I plan use research slider to make user able to show numeric values for different research states.
Currently research sliders are not working, it will be working when i finish pages.
Base values of components are insignificant.
What matter if cannon have 20 base damage or 30? i believe more interesting to see values.
Understanding of research is key to warzone :)


Well, if you think research sliders is too compilcated i can remove it or hide.
Warzone2100 Guide - http://betaguide.wz2100.net/
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Duha »

crab_ wrote:
Duha wrote:http://warzone2100.info/weapons.php#tank_weapons
Make "align text-align: right;" to all numerical columns
ok, i'll try and see :)
Design can be changed many times (in order to get a good variant), usually i'm playing with css and see what happen.
Numerical and not numerical columns has same class="ui-jqgrid-sortable" :)
In normal Multiplayer game research lab upgrades are maxed at every moment of game.
Is it average research time? Did it matches real games? May be it should be renamed and have some help text.
Well, if you think research sliders is too compilcated i can remove it or hide.
If it is not working yet just hide it. :)
http://addons.wz2100.net/ developer
User avatar
Rommel
Trained
Trained
Posts: 446
Joined: 03 Nov 2012, 19:44

Re: Warzone Database (Stats viewer & calculator) by crab

Post by Rommel »

Hi Crab,

First of all the guide is looking fabulous and I am perplexed as to why there is no link to this from the WZ frontpage... as there is currently not an official online guide for WZ :hmm:

Now I will make some grammar corrections for you:

http://warzone2100.info/weapons.php
Weapon is most important part of Tank Design. Strong Weapon can be useful even on weak body and slow propulsion.
First of all: Weapon damage is greatly dependent on enemy propulsion type. See Weapon damage modifiers for exact values.
Each weapon have one of two kinds of damage type: kinetic and thermal.

Code: Select all

Weapons are a very important part of tank design. Weapon types are grouped into Artillery, Anti-Tank and All-rounder with weapon damage being greatly dependent on enemy propulsion type. See weapon damage modifiers for exact values.
Each weapon can have two damage types: kinetic and/or thermal.
Tank weapons splitted into sections by 'research line'. Each section contains list of weapons which use same upgrades, e.g. when you upgrade machinegun damage you actually increase the damage of all weapons in MACHINE GUN group. Click on weapon to see detailed view.

Code: Select all

Tank weapons are split into sections by the chosen "research line". Each section contains a list of weapons which use the same upgrades, e.g. when you research machinegun damage you increase the damage of all weapons in the MACHINE GUN section. Click on a weapon to see it's detailed view.
http://warzone2100.info/body.php
The most important parameters of bodies is armor and hit points (HP). There is 2 kinds of armor: kinetic and thermal. Kinetic armor protects tanks from "physical" damage (from machineguns, cannons, rockets, etc.) Thermal armor uses to protect from "heat" damage typed weapons (flamers, lasers, thermite bombs, etc). Note: to produce tanks with medium bodies you need build factory module. Tanks on heavy bodies are require 2 factory modules.

Code: Select all

The most important parameters of the tank body are armor and hit points (HP). There are 2 kinds of armor: kinetic and thermal. Kinetic armor protects tanks from "physical" damage (ie from machineguns, cannons, rockets, etc.). Thermal armor is used to protect the tank body from "heat" damage type weapons such as flamers, lasers, thermite bombs, etc. Note: to produce tanks with medium bodies you need build a factory module. Tanks with heavy bodies require 2 factory modules.
http://warzone2100.info/propulsion.php
Proper propulsion can make unit fast and well defended. Each propulsion have Maximum Speed parameter. In Warzone most of units have maximum speed all time. Only some few tank designs have slow speed.

Code: Select all

Propulsion has the ability to make a unit very fast (hover), give heavy defense (tracks) or a mixture of defense and speed (half tracked). While propulsion has a great effect on unit speed one must also take into account that high turret and body weight could cause a reduction in unit velocity. 
http://warzone2100.info/cyborgs.php
Cyborg is alternative type of troops in Warzone. Cyborgs are small, fast, and well defended against anti-tank weapons.
Cyborgs are suffer from Artillery and "Anti-Personell" weapons like Machineguns.

Code: Select all

Cyborgs are the "infantry" of Warzone. Cyborgs are small, fast, and well defended against anti-tank weapons (especially rockets). Cyborgs are vulnerable to artillery (mortar, howitzer, ripple rockets, etc) and machinegun type weapons.
http://warzone2100.info/structure.php
in Warzone2100 two groups of structures are present: defensive structures and base structures.
Base structures used to extract oil, produce units and research technologies. Defensive structures used to defense your base structures.

Code: Select all

In Warzone2100 two groups of structures exist: defensive structures and base structures. 
Base structures are used to extract oil, produce units and research technologies while defensive structures are used to defend your base structures.
Your english is good, just had to make a few corrections... hope this helps :) BTW our resident language expert, Rman Virgil maybe able to add to this ;)

Thanks again for the guide, it's really excellent!
Moving back instead of forward
Seems to me absurd
~
Metallica - Eye of the beholder
crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: Warzone Database (Stats viewer & calculator) by crab

Post by crab_ »

Rommel wrote:Now I will make some grammar corrections for you:
This is a very appropriate. It was in my plans, i needed someone who can write guide text content with good english grammar :D
I plan add more texts, i want explain in guide some other things.
Rommel wrote:Your english is good, just had to make a few corrections... hope this helps
My english is worst here XD I use google translate
Rommel wrote:Thanks again for the guide
Guide not finished yet, and there is much work.
Thank you. From tour comments I gain motivation for work on guide :)
Warzone2100 Guide - http://betaguide.wz2100.net/
Post Reply