Yea it can. The stuff in the devel branch needs C++0x, but for stuff in the master branch it's ok now.
https://github.com/coyotte508/pokemon-online/blob/devel/src/BattleManager/battlecommandinvoker.h <3 C++0x stuff. I'm making good progress. I already have a battle input extracter, now I need to finish BattleData & BattleClientLog, and I'll have a way to convert raw to log & use that in client battles. Then a BattleScene class, and it will be usable for client battles completely. Then a BattleServerLog class, and all the logging code will be removed from battle.cpp and placed into the BattleLogs plugin. Then, battle plugins client side or server side will be possible, and that includes making AI. Battle replays too. Then... Well, I cleared the templating hurdle, now I just have to write code en masse. Mystra will also be happy to know that the code is gcc 4.4 compatible now.
Introduced massive use of macros <3 https://github.com/coyotte508/pokemon-online/blob/devel/src/BattleManager/battlecommandinvoker.h https://github.com/coyotte508/pokemon-online/blob/devel/src/BattleManager/battleextracter.h
https://github.com/coyotte508/pokemon-online/blob/devel/src/BattleManager/battledata.h https://github.com/coyotte508/pokemon-online/blob/devel/src/BattleManager/battledata.cpp Made the battledata class. It's surprisingly light, and will be usable by any other class in the battle command flow. Entirely separating this from GUI is so delightful <3 Of course it'll be changed, and later I intend to add more and more data (like stat boosts, weather, spikes, reflect, leech seed, embargo, etc) plus evaluate data for AI use (item, ...) or client use from battle log. But for now I can already use it to make a spectator window!
Did client logging, works just fine. I'm doing the battle scene now. On to QML learning (and it's awesome). By the way mystra it's type-safe! Maybe I'll do a backup C++ battle scene for poor people with Qt 4.6 ^^
>type-safe JS is weak typed among other things. What a horrible abomination (>_>) Just try to compile on 4.6. Or say me where I can download code to test. Maybe it works. It's not like you are using super mega something. Or maybe you do (O.o)
it's type-safe. Of course you can use full javascript files in QML but all the properties are typed. Even C++ user types all have a different type. The weak-typed thing only applies in scripts you could generate, but if you only base yourself on your properties you'll never encounter that. And if for example you try to assign an int to a Text property, it'll cause an error :) (To test, try the devel branch of PO)
lol... I even removed the for (x : container) to make it compatible with versions prior to 4.6. Just use 4.5.2 already xD
Wheee QML is weird... Some weird thing. Did you know that if you attached the same notify signal to different properties you could have a crash? Or all the ownership rules which catch you offguard? And that you for the love of god you can't just swap items in a grid? How complicated it is to dynamically create objects? That when moving items in a gridview you can't animate them, you have to reparent a subelement to the grid with the coords to the item? That you can't call invoke() cpp methods from properties even if they're QML-registered? (or in some cases...) And ... Well, you gotta learn it somehow. First animation implemented for whoever can compile. Upside is that once it's learned, it's good stuff, but you gotta learn it the hard way with the current internet resources. Plenty of good doc from Qt, but really no index to organize them.
Lol Got so annoyed by the States & Transitions thingie that I did imperative using the declarative interface and some tricks... And animations work. (Though they do need to be improved) Will do States + Transitions & HP display tomorrow, hopefully.
Did States & Transition. Did HP bar animations. Did fainting animation, send out, send back. On a side note, fixed a crash, and added spectator name to battle protocol. Now I'm going to introduce a QML element to do frame animations ... For the pokeballs.
One thing to do soon, is to implement color-shading on the pokemon icons or their sprite, to tell they are KOed, or burned, etc. (Like the pokemon game does) So I think this shadereffect will do : Code (javascript): ShaderEffectItem { id: blendEffect blending: true property variant sourceTexture: sourceImage property color blendColor: "slategray" property real colorAlpha: 0.5 vertexShader: " uniform highp mat4 qt_ModelViewProjectionMatrix; attribute highp vec4 qt_Vertex; attribute highp vec2 qt_MultiTexCoord0; varying highp vec2 qt_TexCoord; void main(void) { qt_TexCoord = qt_MultiTexCoord0; gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex; } " fragmentShader: " uniform lowp sampler2D sourceTexture; uniform lowp vec4 blendColor; uniform lowp float colorAlpha varying highp vec2 qt_TexCoord; void main (void) { vec4 c = texture2D(sourceTexture, qt_TexCoord); vec4 b = blendColor; gl_FragColor = vec4(b.rgb, min(colorAlpha, c.a)); } " } If it works... :D
[secret] Code (text): import QtQuick 1.0 FrameAnimation { id: pokeball; source: "../images/pokeballs.png" width: 41 height: 40 frameCount: 8 delay: 50 col: 6 function trigger() { triggerProp = !triggerProp; } property bool triggerProp: false property int destX: woof.x + (woof.width/2-20); property int destY: woof.y - 20; property int deltaX: woof.back ? - 150 : 150 property int deltaY: woof.back ? 50 : -50 property int sourceX: destX + deltaX; property int sourceY: destY + deltaY; property int amplY: 60; x: sourceX + deltaX * percent; y: sourceY -(0.5-percent)*(0.5-percent)*4*amplY + amplY + percent*deltaY; property real percent: 0; signal animationCompleted(); Behavior on triggerProp { SequentialAnimation { ScriptAction { script: {reset(); paused = false; opacity = 1;} } NumberAnimation { property: percent from: 0; to: 1.0; duration: 700; } NumberAnimation { property: opacity; from: 1.0; to: 0; duration: 150; } ScriptAction { script: { pokeball.paused = true; animationCompleted();} } } } } [/secret] Doesn't work because of a QML bug elsewhere, so putting it there as I'm not putting it in the git repository.
i got headshot by qt >_> Moved to qt 4.8, and in the headers there is some stuff that cause an ICE for mingw 4.4 (got fixed in later gcc) when std-c0xx enabled. :(
ICE is internal compiler error. Worst is when developping PO i had the same kind of structure in C++0X and the same error for gcc, so i bugreported it, but they said it was fixed in 4.5 anyway so i can't do anything.
Okay, so what i've done recently: Multiple teams, reconnect feature, new design for teambuilder. Look at that :p What I am going to do now: - Introduce true RBY support - Support multiple gens in teambuilder - Improve stuff in QML battle window - Finish up network protocol etc. What I'd like to do, what I think would be interesting, side developments of PO: - Make the stats plugin auto move the stats every month (through python, statsextracter?) - Make a basic gui for the stats plugin - Make the stats extracter able to generate the 10000 most popular sets per generation in an easily read format (later to be read by the stat plugin)... For something like a rental cup? - Make the tiers update automatically (for NU etc) using usage statistics, every month - Make a mini website on the PO server (open source of course) or even from the website. A registered player on the server would first /identify himself and alias it to a forum account here. The server would make a webcall to the website, etc. Then, if he gets to a certain rating in a tier (using a weird mathematical, or a simple, formula), he can register it on the server (through server script) and the server would notify the mini-website. Anyway the goal of the mini-website would be wishmkr-like, users would be able to nominate pokemons for suspecting/desuspecting in the tier, have convos in a 4chan way on the nominated pokemons (or w/e), ultimately vote on no-ban/test-ban/ban and following that it would take effect on the server. It would first be placed as an experiment in the DW tiers. I don't mind people working on those though ^^
We can do this in our setup easily, the reason I don't do this is that UsageStats plugin needs to be disabled before doing this. Working on a script for this. I don't think this should be added to C++ code as each server handles these differently. I'm interested in making a Web GUI for Registry, serving two pages: The Server Listing available for all (As in http://valssi.fixme.fi:8088/ - this uses a python script to connect to registry and display that) and Admin page where we could view bans and modify them. I know I'm a lazy bastard and these would just be there to ease my life of registry banning bad server owners and update the tiers.
I have a script to update PO tiers based on usage. It can automatically update stuff it sees is wrong. Code (text): [valssi:~/updatescripts/po-server-goodies] (git)-[master] % python3 updatepotiers.py Reading PO tiers Updating PO tiers... Downloading ranked stats for Wifi OU... Calculating banlists for Wifi UU... Calculated. Proposed changes: Remove bans for {'Deoxys-S', 'Excadrill'} as they are banned in parent tiers. Proceed with changes? [Y/n] Tier Wifi UU updated! Downloading ranked stats for Wifi UU... Calculating banlists for Wifi LU... Calculated. Proposed changes: Add bans for {'Bronzong'} as they should be banned by usage or banlist. Remove bans for {'Tornadus', 'Mamoswine', 'Donphan', 'Jolteon', 'Roserade', 'Metagross'} as they are banned in parent tiers. Proceed with changes? [Y/n] Tier Wifi LU updated! Downloading ranked stats for Wifi LU... Calculating banlists for Wifi NU... Calculated. Unknown bans present: {'Snover', 'Houndoom', 'Misdreavus'} Proposed changes: Add bans for {'Crustle'} as they should be banned by usage or banlist. Remove bans for {'Durant', 'Wobbuffet', 'Escavalier', 'Medicham', 'Stoutland', 'Omastar', 'Virizion'} as they are banned in parent tiers. Proceed with changes? [Y/n] Tier Wifi NU updated! Writing PO tiers Done And rerunning doesn't find the errors again as they are fixed: Code (text): Reading PO tiers Updating PO tiers... Downloading ranked stats for Wifi OU... Calculating banlists for Wifi UU... Calculated. Tier Wifi UU seems fine. Downloading ranked stats for Wifi UU... Calculating banlists for Wifi LU... Calculated. Tier Wifi LU seems fine. Downloading ranked stats for Wifi LU... Calculating banlists for Wifi NU... Calculated. Unknown bans present: {'Snover', 'Houndoom', 'Misdreavus'} Tier Wifi NU seems fine. Writing PO tiers Done One thing I need to prepare it is to check for Pokemon that drop from OU or UU so that they only should drop one tier at the time, such as Houndoom. Then I add Snover to the same BL as Abomasnow: Code (text): [valssi:~/updatescripts/po-server-goodies] (git)-[master] % python3 updatepotiers.py Reading PO tiers Updating PO tiers... Downloading ranked stats for Wifi OU... Calculating banlists for Wifi UU... Calculated. Tier Wifi UU seems fine. Downloading ranked stats for Wifi UU... Calculating banlists for Wifi LU... Calculated. Proposed changes: Add bans for {'Snover'} as they should be banned by usage or banlist. Proceed with changes? [Y/n] Tier Wifi LU updated! Downloading ranked stats for Wifi LU... Calculating banlists for Wifi NU... Calculated. Unknown bans present: {'Houndoom', 'Misdreavus'} Proposed changes: Remove bans for {'Snover'} as they are banned in parent tiers. Proceed with changes? [Y/n] Tier Wifi NU updated! Writing PO tiers Done Victory! Now everything is automatic: Code (text): [valssi:~/updatescripts/po-server-goodies] (git)-[master] % python3 updatepotiers.py Reading PO tiers Updating PO tiers... Downloading ranked stats for Wifi OU... Calculating banlists for Wifi UU... Calculated. Tier Wifi UU seems fine. Downloading ranked stats for Wifi UU... Calculating banlists for Wifi LU... Calculated. Tier Wifi LU seems fine. Downloading ranked stats for Wifi LU... Calculating banlists for Wifi NU... Calculated. Likely dropped from Wifi UU to Wifi LU: {'Sigilyph', 'Froslass', 'Houndoom'}. Added to Wifi NU ban list. Unknown bans present: {'Misdreavus'} Proposed changes: Add bans for {'Sigilyph', 'Froslass'} as they should be banned by usage or banlist. Proceed with changes? [Y/n] Tier Wifi NU updated! Downloading ranked stats for DW OU... Calculating banlists for DW UU... Calculated. Unknown bans present: {'Wobbuffet'} Tier DW UU seems fine. Writing PO tiers Done
Even a server script command would definitely make it easier, but would be better if usage stats wouldn't crash when moving the raw files.
Well I just fixed that (but then, previously you just needed to let the folders there even if you emptied them in order not to crash). There's still the issue of resetting rated stats, as they are kept in memory and loaded only when the plugin is loaded.